diff --git a/dist/index.js b/dist/index.js index 1dd4567..454b685 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6027,9 +6027,9 @@ var t = { } }; var b = w; - var R, T; + var R, _; R = s; - T = class Sync { + _ = class Sync { constructor(e, t) { this.schedule = this.schedule.bind(this); this.name = e; @@ -6075,7 +6075,7 @@ var t = { return r; } }; - var _ = T; + var T = _; var k = "2.19.5"; var D = { version: k }; var F = Object.freeze({ version: k, default: D }); @@ -6272,7 +6272,7 @@ var t = { Z = require$$4$1; q = n; X = b; - $ = _; + $ = T; Y = function () { class Bottleneck { constructor(e = {}, ...t) { @@ -6687,6 +6687,42 @@ var t = { } t.Deprecation = Deprecation; }, + 2874: (e, t, r) => { + (function () { + r(8889).config(Object.assign({}, r(9990), r(4531)(process.argv))); + })(); + }, + 4531: (e) => { + const t = /^dotenv_config_(encoding|path|debug|override|DOTENV_KEY)=(.+)$/; + e.exports = function optionMatcher(e) { + return e.reduce(function (e, r) { + const s = r.match(t); + if (s) { + e[s[1]] = s[2]; + } + return e; + }, {}); + }; + }, + 9990: (e) => { + const t = {}; + if (process.env.DOTENV_CONFIG_ENCODING != null) { + t.encoding = process.env.DOTENV_CONFIG_ENCODING; + } + if (process.env.DOTENV_CONFIG_PATH != null) { + t.path = process.env.DOTENV_CONFIG_PATH; + } + if (process.env.DOTENV_CONFIG_DEBUG != null) { + t.debug = process.env.DOTENV_CONFIG_DEBUG; + } + if (process.env.DOTENV_CONFIG_OVERRIDE != null) { + t.override = process.env.DOTENV_CONFIG_OVERRIDE; + } + if (process.env.DOTENV_CONFIG_DOTENV_KEY != null) { + t.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY; + } + e.exports = t; + }, 8889: (e, t, r) => { const s = r(9896); const o = r(6928); @@ -9026,8 +9062,8 @@ var t = { const { kUrl: b, kReset: R, - kServerName: T, - kClient: _, + kServerName: _, + kClient: T, kBusy: k, kParser: D, kConnect: F, @@ -9088,10 +9124,10 @@ var t = { HTTP2_HEADER_SCHEME: we, HTTP2_HEADER_CONTENT_LENGTH: be, HTTP2_HEADER_EXPECT: Re, - HTTP2_HEADER_STATUS: Te, + HTTP2_HEADER_STATUS: _e, }, } = me; - let _e = false; + let Te = false; const ke = Buffer[Symbol.species]; const De = Symbol("kClosedResolve"); const Fe = {}; @@ -9130,7 +9166,7 @@ var t = { strictContentLength: B, maxCachedSessions: y, maxRedirections: R, - connect: _, + connect: T, maxRequestsPerClient: k, localAddress: D, maxResponseSize: F, @@ -9180,7 +9216,7 @@ var t = { if (u != null && (!Number.isInteger(u) || u < 0)) { throw new d("bodyTimeout must be a positive integer or zero"); } - if (_ != null && typeof _ !== "function" && typeof _ !== "object") { + if (T != null && typeof T !== "function" && typeof T !== "object") { throw new d("connect must be a function or an object"); } if (R != null && (!Number.isInteger(R) || R < 0)) { @@ -9204,20 +9240,20 @@ var t = { if (G != null && (typeof G !== "number" || G < 1)) { throw new d("maxConcurrentStreams must be a possitive integer, greater than 0"); } - if (typeof _ !== "function") { - _ = w({ + if (typeof T !== "function") { + T = w({ ...Q, maxCachedSessions: y, allowH2: N, socketPath: C, timeout: c, ...(i.nodeHasAutoSelectFamily && S ? { autoSelectFamily: S, autoSelectFamilyAttemptTimeout: U } : undefined), - ..._, + ...T, }); } this[ue] = t && t.Client && Array.isArray(t.Client) ? t.Client : [ve({ maxRedirections: R })]; this[b] = i.parseOrigin(e); - this[se] = _; + this[se] = T; this[K] = null; this[W] = m != null ? m : 1; this[Z] = r || n.maxHeaderSize; @@ -9225,7 +9261,7 @@ var t = { this[X] = h == null ? 6e5 : h; this[$] = I == null ? 1e3 : I; this[z] = this[V]; - this[T] = null; + this[_] = null; this[le] = D != null ? D : null; this[v] = 0; this[x] = 0; @@ -9328,13 +9364,13 @@ var t = { function onHttp2SessionError(e) { s(e.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); this[K][j] = e; - onError(this[_], e); + onError(this[T], e); } function onHttp2FrameError(e, t, r) { const s = new C(`HTTP/2: "frameError" received - type ${e}, code ${t}`); if (r === 0) { this[K][j] = s; - onError(this[_], s); + onError(this[T], s); } } function onHttp2SessionEnd() { @@ -9342,7 +9378,7 @@ var t = { i.destroy(this[K], new I("other side closed")); } function onHTTP2GoAway(e) { - const t = this[_]; + const t = this[T]; const r = new C(`HTTP/2: "GOAWAY" frame received with code ${e}`); t[K] = null; t[Ee] = null; @@ -9611,7 +9647,7 @@ var t = { o.unshift(e); o[D].destroy(); o[D] = null; - o[_] = null; + o[T] = null; o[j] = null; o.removeListener("error", onSocketError) .removeListener("readable", onSocketReadable) @@ -9793,7 +9829,7 @@ var t = { } } function onSocketError(e) { - const { [_]: t, [D]: r } = this; + const { [T]: t, [D]: r } = this; s(e.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); if (t[de] !== "h2") { if (e.code === "ECONNRESET" && r.statusCode && !r.shouldKeepAlive) { @@ -9802,7 +9838,7 @@ var t = { } } this[j] = e; - onError(this[_], e); + onError(this[T], e); } function onError(e, t) { if (e[U] === 0 && t.code !== "UND_ERR_INFO" && t.code !== "UND_ERR_SOCKET") { @@ -9816,7 +9852,7 @@ var t = { } } function onSocketEnd() { - const { [D]: e, [_]: t } = this; + const { [D]: e, [T]: t } = this; if (t[de] !== "h2") { if (e.statusCode && !e.shouldKeepAlive) { e.onMessageComplete(); @@ -9826,7 +9862,7 @@ var t = { i.destroy(this, new I("other side closed", i.getSocketInfo(this))); } function onSocketClose() { - const { [_]: e, [D]: t } = this; + const { [T]: e, [D]: t } = this; if (e[de] === "h1" && t) { if (!this[j] && t.statusCode && !t.shouldKeepAlive) { t.onMessageComplete(); @@ -9866,11 +9902,11 @@ var t = { } e[M] = true; if (Fe.beforeConnect.hasSubscribers) { - Fe.beforeConnect.publish({ connectParams: { host: t, hostname: r, protocol: n, port: A, servername: e[T], localAddress: e[le] }, connector: e[se] }); + Fe.beforeConnect.publish({ connectParams: { host: t, hostname: r, protocol: n, port: A, servername: e[_], localAddress: e[le] }, connector: e[se] }); } try { const o = await new Promise((s, o) => { - e[se]({ host: t, hostname: r, protocol: n, port: A, servername: e[T], localAddress: e[le] }, (e, t) => { + e[se]({ host: t, hostname: r, protocol: n, port: A, servername: e[_], localAddress: e[le] }, (e, t) => { if (e) { o(e); } else { @@ -9889,13 +9925,13 @@ var t = { s(o); const a = o.alpnProtocol === "h2"; if (a) { - if (!_e) { - _e = true; + if (!Te) { + Te = true; process.emitWarning("H2 support is experimental, expect them to change at any time.", { code: "UNDICI-H2" }); } const t = me.connect(e[b], { createConnection: () => o, peerMaxConcurrentStreams: e[he].maxConcurrentStreams }); e[de] = "h2"; - t[_] = e; + t[T] = e; t[K] = o; t.on("error", onHttp2SessionError); t.on("frameError", onHttp2FrameError); @@ -9918,13 +9954,13 @@ var t = { } o[Ae] = 0; o[ne] = e[ne]; - o[_] = e; + o[T] = e; o[j] = null; o.on("error", onSocketError).on("readable", onSocketReadable).on("end", onSocketEnd).on("close", onSocketClose); e[K] = o; if (Fe.connected.hasSubscribers) { Fe.connected.publish({ - connectParams: { host: t, hostname: r, protocol: n, port: A, servername: e[T], localAddress: e[le] }, + connectParams: { host: t, hostname: r, protocol: n, port: A, servername: e[_], localAddress: e[le] }, connector: e[se], socket: o, }); @@ -9937,14 +9973,14 @@ var t = { e[M] = false; if (Fe.connectError.hasSubscribers) { Fe.connectError.publish({ - connectParams: { host: t, hostname: r, protocol: n, port: A, servername: e[T], localAddress: e[le] }, + connectParams: { host: t, hostname: r, protocol: n, port: A, servername: e[_], localAddress: e[le] }, connector: e[se], error: o, }); } if (o.code === "ERR_TLS_CERT_ALTNAME_INVALID") { s(e[U] === 0); - while (e[N] > 0 && e[L][e[J]].servername === e[T]) { + while (e[N] > 0 && e[L][e[J]].servername === e[_]) { const t = e[L][e[J]++]; errorRequest(e, t, o); } @@ -10024,11 +10060,11 @@ var t = { return; } const o = e[L][e[J]]; - if (e[b].protocol === "https:" && e[T] !== o.servername) { + if (e[b].protocol === "https:" && e[_] !== o.servername) { if (e[U] > 0) { return; } - e[T] = o.servername; + e[_] = o.servername; if (r && r.servername !== o.servername) { i.destroy(r, new C("servername changed")); return; @@ -10251,7 +10287,7 @@ var t = { } ++m.openStreams; I.once("response", (e) => { - const { [Te]: t, ...s } = e; + const { [_e]: t, ...s } = e; if (r.onHeaders(Number(t), s, I.resume.bind(I), "") === false) { I.pause(); } @@ -12408,21 +12444,21 @@ var t = { const { isUint8Array: B, isArrayBuffer: y } = r(8253); const { File: w } = r(3041); const { parseMIMEType: b, serializeAMimeType: R } = r(4322); - let T = globalThis.ReadableStream; - const _ = I ?? w; + let _ = globalThis.ReadableStream; + const T = I ?? w; const k = new TextEncoder(); const D = new TextDecoder(); function extractBody(e, t = false) { - if (!T) { - T = r(3774).ReadableStream; + if (!_) { + _ = r(3774).ReadableStream; } let s = null; - if (e instanceof T) { + if (e instanceof _) { s = e; } else if (A(e)) { s = e.stream(); } else { - s = new T({ + s = new _({ async pull(e) { e.enqueue(typeof u === "string" ? k.encode(u) : u); queueMicrotask(() => a(e)); @@ -12506,14 +12542,14 @@ var t = { if (o.isDisturbed(e) || e.locked) { throw new TypeError("Response body object should not be disturbed or locked"); } - s = e instanceof T ? e : n(e); + s = e instanceof _ ? e : n(e); } if (typeof u === "string" || o.isBuffer(u)) { l = Buffer.byteLength(u); } if (c != null) { let t; - s = new T({ + s = new _({ async start() { t = c(e)[Symbol.asyncIterator](); }, @@ -12540,10 +12576,10 @@ var t = { return [d, g]; } function safelyExtractBody(e, t = false) { - if (!T) { - T = r(3774).ReadableStream; + if (!_) { + _ = r(3774).ReadableStream; } - if (e instanceof T) { + if (e instanceof _) { m(!o.isDisturbed(e), "The body has already been consumed."); m(!e.locked, "The stream is locked."); } @@ -12633,14 +12669,14 @@ var t = { }); r.on("end", () => { A.push(Buffer.from(o, "base64")); - t.append(e, new _(A, s, { type: n })); + t.append(e, new T(A, s, { type: n })); }); } else { r.on("data", (e) => { A.push(e); }); r.on("end", () => { - t.append(e, new _(A, s, { type: n })); + t.append(e, new T(A, s, { type: n })); }); } }); @@ -12847,7 +12883,7 @@ var t = { const w = new Set(y); const b = ["audio", "audioworklet", "font", "image", "manifest", "paintworklet", "script", "style", "track", "video", "xslt", ""]; const R = new Set(b); - const T = + const _ = globalThis.DOMException ?? (() => { try { @@ -12856,23 +12892,23 @@ var t = { return Object.getPrototypeOf(e).constructor; } })(); - let _; + let T; const k = globalThis.structuredClone ?? function structuredClone(e, t = undefined) { if (arguments.length === 0) { throw new TypeError("missing argument"); } - if (!_) { - _ = new s(); + if (!T) { + T = new s(); } - _.port1.unref(); - _.port2.unref(); - _.port1.postMessage(e, t?.transfer); - return o(_.port2).message; + T.port1.unref(); + T.port2.unref(); + T.port1.postMessage(e, t?.transfer); + return o(T.port2).message; }; e.exports = { - DOMException: T, + DOMException: _, structuredClone: k, subresource: b, forbiddenMethods: y, @@ -13743,8 +13779,8 @@ var t = { appendFetchMetadata: w, corsCheck: b, crossOriginResourcePolicyCheck: R, - determineRequestsReferrer: T, - coarsenedSharedCurrentTime: _, + determineRequestsReferrer: _, + coarsenedSharedCurrentTime: T, createDeferredPromise: k, isBlobLike: D, sameOrigin: F, @@ -13877,7 +13913,7 @@ var t = { s = y({ startTime: s.startTime }); o = ""; } - s.endTime = _(); + s.endTime = T(); e.timingInfo = s; markResourceTiming(s, r, t, globalThis, o); } @@ -13928,7 +13964,7 @@ var t = { a = e.client.globalObject; c = e.client.crossOriginIsolatedCapability; } - const u = _(c); + const u = T(c); const l = y({ startTime: u }); const g = { controller: new Fetch(i), @@ -13986,7 +14022,7 @@ var t = { r.referrerPolicy = r.policyContainer.referrerPolicy; } if (r.referrer !== "no-referrer") { - r.referrer = T(r); + r.referrer = _(r); } if (s === null) { s = await (async () => { @@ -14255,7 +14291,7 @@ var t = { r.body = q(r.body.source)[0]; } const A = e.timingInfo; - A.redirectEndTime = A.postRedirectStartTime = _(e.crossOriginIsolatedCapability); + A.redirectEndTime = A.postRedirectStartTime = T(e.crossOriginIsolatedCapability); if (A.redirectStartTime === 0) { A.redirectStartTime = A.startTime; } @@ -14681,7 +14717,7 @@ var t = { requestDuplex: w, } = r(7326); const { kEnumerableProperty: b } = u; - const { kHeaders: R, kSignal: T, kState: _, kGuard: k, kRealm: D } = r(9710); + const { kHeaders: R, kSignal: _, kState: T, kGuard: k, kRealm: D } = r(9710); const { webidl: F } = r(4222); const { getGlobalOrigin: S } = r(5628); const { URLSerializer: v } = r(4322); @@ -14728,8 +14764,8 @@ var t = { n = "cors"; } else { G(e instanceof Request); - o = e[_]; - C = e[T]; + o = e[T]; + C = e[_]; } const m = this[D].settingsObject.origin; let Q = "client"; @@ -14840,10 +14876,10 @@ var t = { if (t.signal !== undefined) { C = t.signal; } - this[_] = o; + this[T] = o; const w = new AbortController(); - this[T] = w.signal; - this[T][D] = this[D]; + this[_] = w.signal; + this[_][D] = this[D]; if (C != null) { if (!C || typeof C.aborted !== "boolean" || typeof C.addEventListener !== "function") { throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal."); @@ -14893,7 +14929,7 @@ var t = { i(this[R], r); } } - const b = e instanceof Request ? e[_].body : null; + const b = e instanceof Request ? e[T].body : null; if ((t.body != null || b != null) && (o.method === "GET" || o.method === "HEAD")) { throw new TypeError("Request with GET/HEAD method cannot have body."); } @@ -14927,15 +14963,15 @@ var t = { b.stream.pipeThrough(e); J = { source: b.source, length: b.length, stream: e.readable }; } - this[_].body = J; + this[T].body = J; } get method() { F.brandCheck(this, Request); - return this[_].method; + return this[T].method; } get url() { F.brandCheck(this, Request); - return v(this[_].url); + return v(this[T].url); } get headers() { F.brandCheck(this, Request); @@ -14943,64 +14979,64 @@ var t = { } get destination() { F.brandCheck(this, Request); - return this[_].destination; + return this[T].destination; } get referrer() { F.brandCheck(this, Request); - if (this[_].referrer === "no-referrer") { + if (this[T].referrer === "no-referrer") { return ""; } - if (this[_].referrer === "client") { + if (this[T].referrer === "client") { return "about:client"; } - return this[_].referrer.toString(); + return this[T].referrer.toString(); } get referrerPolicy() { F.brandCheck(this, Request); - return this[_].referrerPolicy; + return this[T].referrerPolicy; } get mode() { F.brandCheck(this, Request); - return this[_].mode; + return this[T].mode; } get credentials() { - return this[_].credentials; + return this[T].credentials; } get cache() { F.brandCheck(this, Request); - return this[_].cache; + return this[T].cache; } get redirect() { F.brandCheck(this, Request); - return this[_].redirect; + return this[T].redirect; } get integrity() { F.brandCheck(this, Request); - return this[_].integrity; + return this[T].integrity; } get keepalive() { F.brandCheck(this, Request); - return this[_].keepalive; + return this[T].keepalive; } get isReloadNavigation() { F.brandCheck(this, Request); - return this[_].reloadNavigation; + return this[T].reloadNavigation; } get isHistoryNavigation() { F.brandCheck(this, Request); - return this[_].historyNavigation; + return this[T].historyNavigation; } get signal() { F.brandCheck(this, Request); - return this[T]; + return this[_]; } get body() { F.brandCheck(this, Request); - return this[_].body ? this[_].body.stream : null; + return this[T].body ? this[T].body.stream : null; } get bodyUsed() { F.brandCheck(this, Request); - return !!this[_].body && u.isDisturbed(this[_].body.stream); + return !!this[T].body && u.isDisturbed(this[T].body.stream); } get duplex() { F.brandCheck(this, Request); @@ -15011,9 +15047,9 @@ var t = { if (this.bodyUsed || this.body?.locked) { throw new TypeError("unusable"); } - const e = cloneRequest(this[_]); + const e = cloneRequest(this[T]); const t = new Request(N); - t[_] = e; + t[T] = e; t[D] = this[D]; t[R] = new A(N); t[R][U] = e.headersList; @@ -15027,7 +15063,7 @@ var t = { r.abort(this.signal.reason); }); } - t[T] = r.signal; + t[_] = r.signal; return t; } } @@ -15151,8 +15187,8 @@ var t = { const { redirectStatusSet: C, nullBodyStatus: m, DOMException: Q } = r(7326); const { kState: B, kHeaders: y, kGuard: w, kRealm: b } = r(9710); const { webidl: R } = r(4222); - const { FormData: T } = r(3073); - const { getGlobalOrigin: _ } = r(5628); + const { FormData: _ } = r(3073); + const { getGlobalOrigin: T } = r(5628); const { URLSerializer: k } = r(4322); const { kHeadersList: D, kConstruct: F } = r(6443); const S = r(2613); @@ -15192,7 +15228,7 @@ var t = { t = R.converters["unsigned short"](t); let s; try { - s = new URL(e, _()); + s = new URL(e, T()); } catch (t) { throw Object.assign(new TypeError("Failed to parse URL from " + e), { cause: t }); } @@ -15388,7 +15424,7 @@ var t = { } } R.converters.ReadableStream = R.interfaceConverter(U); - R.converters.FormData = R.interfaceConverter(T); + R.converters.FormData = R.interfaceConverter(_); R.converters.URLSearchParams = R.interfaceConverter(URLSearchParams); R.converters.XMLHttpRequestBodyInit = function (e) { if (typeof e === "string") { @@ -18449,8 +18485,8 @@ var t = { const w = Symbol("onDisconnect"); const b = Symbol("onConnectionError"); const R = Symbol("get dispatcher"); - const T = Symbol("add client"); - const _ = Symbol("remove client"); + const _ = Symbol("add client"); + const T = Symbol("remove client"); const k = Symbol("stats"); class PoolBase extends s { constructor() { @@ -18554,7 +18590,7 @@ var t = { } return !this[C]; } - [T](e) { + [_](e) { e.on("drain", this[B]).on("connect", this[y]).on("disconnect", this[w]).on("connectionError", this[b]); this[I].push(e); if (this[C]) { @@ -18566,7 +18602,7 @@ var t = { } return this; } - [_](e) { + [T](e) { e.close(() => { const t = this[I].indexOf(e); if (t !== -1) { @@ -18576,7 +18612,7 @@ var t = { this[C] = this[I].some((e) => !e[C] && e.closed !== true && e.destroyed !== true); } } - e.exports = { PoolBase: PoolBase, kClients: I, kNeedDrain: C, kAddClient: T, kRemoveClient: _, kGetDispatcher: R }; + e.exports = { PoolBase: PoolBase, kClients: I, kNeedDrain: C, kAddClient: _, kRemoveClient: T, kGetDispatcher: R }; }, 4622: (e, t, r) => { const { kFree: s, kConnected: o, kPending: n, kQueued: A, kRunning: i, kSize: a } = r(6443); @@ -19541,7 +19577,7 @@ var t = { const { establishWebSocketConnection: w } = r(8550); const { WebsocketFrameSend: b } = r(1237); const { ByteParser: R } = r(3171); - const { kEnumerableProperty: T, isBlobLike: _ } = r(3440); + const { kEnumerableProperty: _, isBlobLike: T } = r(3440); const { getGlobalDispatcher: k } = r(2581); const { types: D } = r(9023); let F = false; @@ -19674,7 +19710,7 @@ var t = { t.write(o, () => { this.#g -= r.byteLength; }); - } else if (_(e)) { + } else if (T(e)) { const r = new b(); e.arrayBuffer().then((e) => { const s = Buffer.from(e); @@ -19812,18 +19848,18 @@ var t = { OPEN: i, CLOSING: i, CLOSED: i, - url: T, - readyState: T, - bufferedAmount: T, - onopen: T, - onerror: T, - onclose: T, - close: T, - onmessage: T, - binaryType: T, - send: T, - extensions: T, - protocol: T, + url: _, + readyState: _, + bufferedAmount: _, + onopen: _, + onerror: _, + onclose: _, + close: _, + onmessage: _, + binaryType: _, + send: _, + extensions: _, + protocol: _, [Symbol.toStringTag]: { value: "WebSocket", writable: false, enumerable: false, configurable: true }, }); Object.defineProperties(WebSocket, { CONNECTING: i, OPEN: i, CLOSING: i, CLOSED: i }); @@ -19859,7 +19895,7 @@ var t = { }; s.converters.WebSocketSendData = function (e) { if (s.util.Type(e) === "Object") { - if (_(e)) { + if (T(e)) { return s.converters.Blob(e, { strict: false }); } if (ArrayBuffer.isView(e) || D.isAnyArrayBuffer(e)) { @@ -20560,8 +20596,8 @@ var t = { const w = c(h, "fileSize", Infinity); const b = c(h, "files", Infinity); const R = c(h, "fields", Infinity); - const T = c(h, "parts", Infinity); - const _ = c(h, "headerPairs", 2e3); + const _ = c(h, "parts", Infinity); + const T = c(h, "headerPairs", 2e3); const k = c(h, "headerSize", 80 * 1024); let D = 0; let F = 0; @@ -20574,7 +20610,7 @@ var t = { this._cb = undefined; this._nparts = 0; this._boy = e; - const G = { boundary: E, maxHeaderPairs: _, maxHeaderSize: k, partHwm: B.highWaterMark, highWaterMark: t.highWaterMark }; + const G = { boundary: E, maxHeaderPairs: T, maxHeaderSize: k, partHwm: B.highWaterMark, highWaterMark: t.highWaterMark }; this.parser = new n(G); this.parser .on("drain", function () { @@ -20586,7 +20622,7 @@ var t = { } }) .on("part", function onPart(t) { - if (++o._nparts > T) { + if (++o._nparts > _) { o.parser.removeListener("part", onPart); o.parser.on("part", skipPart); e.hitPartsLimit = true; @@ -20604,8 +20640,8 @@ var t = { let E; let h; let C; - let T; - let _ = 0; + let _; + let T = 0; if (n["content-type"]) { E = A(n["content-type"][0]); if (E[0]) { @@ -20633,9 +20669,9 @@ var t = { if (p.test(E[r][0])) { u = E[r][1]; } else if (d.test(E[r][0])) { - T = E[r][1]; + _ = E[r][1]; if (!Q) { - T = a(T); + _ = a(_); } } } @@ -20648,7 +20684,7 @@ var t = { C = "7bit"; } let k, N; - if (I(u, c, T)) { + if (I(u, c, _)) { if (D === b) { if (!e.hitFilesLimit) { e.hitFilesLimit = true; @@ -20685,10 +20721,10 @@ var t = { e(); } }; - e.emit("file", u, r, T, C, c); + e.emit("file", u, r, _, C, c); k = function (e) { - if ((_ += e.length) > w) { - const s = w - _ + e.length; + if ((T += e.length) > w) { + const s = w - T + e.length; if (s > 0) { r.push(e.slice(0, s)); } @@ -20700,7 +20736,7 @@ var t = { } else if (!r.push(e)) { o._pause = true; } - r.bytesRead = _; + r.bytesRead = T; }; N = function () { v = undefined; @@ -20720,8 +20756,8 @@ var t = { let s = false; U = t; k = function (e) { - if ((_ += e.length) > y) { - const o = y - (_ - e.length); + if ((T += e.length) > y) { + const o = y - (T - e.length); r += e.toString("binary", 0, o); s = true; t.removeAllListeners("data"); @@ -21867,7 +21903,7 @@ function __nccwpck_require__(e) { if (typeof __nccwpck_require__ !== "undefined") __nccwpck_require__.ab = new URL(".", import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/"; var s = {}; -__nccwpck_require__.d(s, { b: () => runPlugin }); +__nccwpck_require__.d(s, { A: () => Nt }); var o = {}; __nccwpck_require__.r(o); __nccwpck_require__.d(o, { @@ -25071,12 +25107,12 @@ function DefaultErrorFunction(e) { return "Unknown error type"; } } -let T = DefaultErrorFunction; +let _ = DefaultErrorFunction; function SetErrorFunction(e) { - T = e; + _ = e; } function GetErrorFunction() { - return T; + return _; } class TypeDereferenceError extends TypeBoxError { constructor(e) { @@ -25098,7 +25134,7 @@ class ValueHashError extends TypeBoxError { this.value = e; } } -var _; +var T; (function (e) { e[(e["Undefined"] = 0)] = "Undefined"; e[(e["Null"] = 1)] = "Null"; @@ -25111,7 +25147,7 @@ var _; e[(e["Uint8Array"] = 8)] = "Uint8Array"; e[(e["Symbol"] = 9)] = "Symbol"; e[(e["BigInt"] = 10)] = "BigInt"; -})(_ || (_ = {})); +})(T || (T = {})); let k = BigInt("14695981039346656037"); const [D, F] = [BigInt("1099511628211"), BigInt("2") ** BigInt("64")]; const S = Array.from({ length: 256 }).map((e, t) => BigInt(t)); @@ -25125,45 +25161,45 @@ function* NumberToBytes(e) { } } function hash_ArrayType(e) { - FNV1A64(_.Array); + FNV1A64(T.Array); for (const t of e) { hash_Visit(t); } } function BooleanType(e) { - FNV1A64(_.Boolean); + FNV1A64(T.Boolean); FNV1A64(e ? 1 : 0); } function BigIntType(e) { - FNV1A64(_.BigInt); + FNV1A64(T.BigInt); U.setBigInt64(0, e); for (const e of N) { FNV1A64(e); } } function hash_DateType(e) { - FNV1A64(_.Date); + FNV1A64(T.Date); hash_Visit(e.getTime()); } function NullType(e) { - FNV1A64(_.Null); + FNV1A64(T.Null); } function NumberType(e) { - FNV1A64(_.Number); + FNV1A64(T.Number); U.setFloat64(0, e); for (const e of N) { FNV1A64(e); } } function hash_ObjectType(e) { - FNV1A64(_.Object); + FNV1A64(T.Object); for (const t of globalThis.Object.getOwnPropertyNames(e).sort()) { hash_Visit(t); hash_Visit(e[t]); } } function StringType(e) { - FNV1A64(_.String); + FNV1A64(T.String); for (let t = 0; t < e.length; t++) { for (const r of NumberToBytes(e.charCodeAt(t))) { FNV1A64(r); @@ -25171,17 +25207,17 @@ function StringType(e) { } } function SymbolType(e) { - FNV1A64(_.Symbol); + FNV1A64(T.Symbol); hash_Visit(e.description); } function hash_Uint8ArrayType(e) { - FNV1A64(_.Uint8Array); + FNV1A64(T.Uint8Array); for (let t = 0; t < e.length; t++) { FNV1A64(e[t]); } } function UndefinedType(e) { - return FNV1A64(_.Undefined); + return FNV1A64(T.Undefined); } function hash_Visit(e) { if (guard_IsArray(e)) return hash_ArrayType(e); @@ -28641,8 +28677,8 @@ var se = class { error; #b = 200; #R; - #T; #_; + #T; #k; #D = true; #F; @@ -28723,10 +28759,10 @@ var se = class { }; header = (e, t, r) => { if (t === void 0) { - if (this.#T) { - this.#T.delete(e); - } else if (this.#_) { - delete this.#_[e.toLocaleLowerCase()]; + if (this.#_) { + this.#_.delete(e); + } else if (this.#T) { + delete this.#T[e.toLocaleLowerCase()]; } if (this.finalized) { this.res.headers.delete(e); @@ -28734,18 +28770,18 @@ var se = class { return; } if (r?.append) { - if (!this.#T) { + if (!this.#_) { this.#D = false; - this.#T = new Headers(this.#_); - this.#_ = {}; + this.#_ = new Headers(this.#T); + this.#T = {}; } - this.#T.append(e, t); + this.#_.append(e, t); } else { - if (this.#T) { - this.#T.set(e, t); + if (this.#_) { + this.#_.set(e, t); } else { - this.#_ ??= {}; - this.#_[e.toLowerCase()] = t; + this.#T ??= {}; + this.#T[e.toLowerCase()] = t; } } if (this.finalized) { @@ -28773,12 +28809,12 @@ var se = class { } #N(e, t, r) { if (this.#D && !r && !t && this.#b === 200) { - return new Response(e, { headers: this.#_ }); + return new Response(e, { headers: this.#T }); } if (t && typeof t !== "number") { const r = new Headers(t.headers); - if (this.#T) { - this.#T.forEach((e, t) => { + if (this.#_) { + this.#_.forEach((e, t) => { if (t === "set-cookie") { r.append(t, e); } else { @@ -28786,46 +28822,46 @@ var se = class { } }); } - const s = setHeaders(r, this.#_); + const s = setHeaders(r, this.#T); return new Response(e, { headers: s, status: t.status ?? this.#b }); } const s = typeof t === "number" ? t : this.#b; - this.#_ ??= {}; - this.#T ??= new Headers(); - setHeaders(this.#T, this.#_); + this.#T ??= {}; + this.#_ ??= new Headers(); + setHeaders(this.#_, this.#T); if (this.#k) { this.#k.headers.forEach((e, t) => { if (t === "set-cookie") { - this.#T?.append(t, e); + this.#_?.append(t, e); } else { - this.#T?.set(t, e); + this.#_?.set(t, e); } }); - setHeaders(this.#T, this.#_); + setHeaders(this.#_, this.#T); } r ??= {}; for (const [e, t] of Object.entries(r)) { if (typeof t === "string") { - this.#T.set(e, t); + this.#_.set(e, t); } else { - this.#T.delete(e); + this.#_.delete(e); for (const r of t) { - this.#T.append(e, r); + this.#_.append(e, r); } } } - return new Response(e, { status: s, headers: this.#T }); + return new Response(e, { status: s, headers: this.#_ }); } newResponse = (...e) => this.#N(...e); body = (e, t, r) => (typeof t === "number" ? this.#N(e, t, r) : this.#N(e, t)); text = (e, t, r) => { - if (!this.#_) { + if (!this.#T) { if (this.#D && !r && !t) { return new Response(e); } - this.#_ = {}; + this.#T = {}; } - this.#_["content-type"] = re; + this.#T["content-type"] = re; if (typeof t === "number") { return this.#N(e, t, r); } @@ -28833,21 +28869,21 @@ var se = class { }; json = (e, t, r) => { const s = JSON.stringify(e); - this.#_ ??= {}; - this.#_["content-type"] = "application/json"; + this.#T ??= {}; + this.#T["content-type"] = "application/json"; return typeof t === "number" ? this.#N(s, t, r) : this.#N(s, t); }; html = (e, t, r) => { - this.#_ ??= {}; - this.#_["content-type"] = "text/html; charset=UTF-8"; + this.#T ??= {}; + this.#T["content-type"] = "text/html; charset=UTF-8"; if (typeof e === "object") { return resolveCallback(e, ee.Stringify, false, {}).then((e) => (typeof t === "number" ? this.#N(e, t, r) : this.#N(e, t))); } return typeof t === "number" ? this.#N(e, t, r) : this.#N(e, t); }; redirect = (e, t) => { - this.#T ??= new Headers(); - this.#T.set("Location", String(e)); + this.#_ ??= new Headers(); + this.#_.set("Location", String(e)); return this.newResponse(null, t ?? 302); }; notFound = () => { @@ -29666,12 +29702,12 @@ var env = (e, t) => { }; return o[t](); }; -var Te = { deno: "Deno", bun: "Bun", workerd: "Cloudflare-Workers", node: "Node.js" }; +var _e = { deno: "Deno", bun: "Bun", workerd: "Cloudflare-Workers", node: "Node.js" }; var getRuntimeKey = () => { const e = globalThis; const t = typeof navigator !== "undefined" && typeof navigator.userAgent === "string"; if (t) { - for (const [e, t] of Object.entries(Te)) { + for (const [e, t] of Object.entries(_e)) { if (checkUserAgentEquals(t)) { return e; } @@ -29692,7 +29728,7 @@ var checkUserAgentEquals = (e) => { const t = navigator.userAgent; return t.startsWith(e); }; -var _e = class extends Error { +var Te = class extends Error { res; status; constructor(e = 500, t) { @@ -32249,16 +32285,14 @@ var wt = class extends Bt { return ke.context.payload.repository ? `${ke.context.payload.repository?.html_url}/actions/runs/${ke.context.runId}` : "http://localhost"; } }; -var bt = - null && - `-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs96DOU+JqM8SyNXOB6u3\nuBKIFiyrcST/LZTYN6y7LeJlyCuGPqSDrWCfjU9Ph5PLf9TWiNmeM8DGaOpwEFC7\nU3NRxOSglo4plnQ5zRwIHHXvxyK400sQP2oISXymISuBQWjEIqkC9DybQrKwNzf+\nI0JHWPqmwMIw26UvVOtXGOOWBqTkk+N2+/9f8eDIJP5QQVwwszc8s1rXOsLMlVIf\nwShw7GO4E2jyK8TSJKpyjV8eb1JJMDwFhPiRrtZfQJUtDf2mV/67shQww61BH2Y/\nPlnalo58kWIbkqZoq1yJrL5sFb73osM5+vADTXVn79bkvea7W19nSkdMiarYt4Hq\nJQIDAQAB\n-----END PUBLIC KEY-----\n`; +var bt = `-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs96DOU+JqM8SyNXOB6u3\nuBKIFiyrcST/LZTYN6y7LeJlyCuGPqSDrWCfjU9Ph5PLf9TWiNmeM8DGaOpwEFC7\nU3NRxOSglo4plnQ5zRwIHHXvxyK400sQP2oISXymISuBQWjEIqkC9DybQrKwNzf+\nI0JHWPqmwMIw26UvVOtXGOOWBqTkk+N2+/9f8eDIJP5QQVwwszc8s1rXOsLMlVIf\nwShw7GO4E2jyK8TSJKpyjV8eb1JJMDwFhPiRrtZfQJUtDf2mV/67shQww61BH2Y/\nPlnalo58kWIbkqZoq1yJrL5sFb73osM5+vADTXVn79bkvea7W19nSkdMiarYt4Hq\nJQIDAQAB\n-----END PUBLIC KEY-----\n`; function sanitizeMetadata(e) { return JSON.stringify(e, null, 2).replace(//g, ">").replace(/--/g, "--"); } function getPluginOptions(e) { return { kernelPublicKey: e?.kernelPublicKey || bt, - logLevel: e?.logLevel ?? LOG_LEVEL.INFO, + logLevel: e?.logLevel ?? J.INFO, postCommentOnError: e?.postCommentOnError ?? true, settingsSchema: e?.settingsSchema, envSchema: e?.envSchema, @@ -32340,7 +32374,7 @@ async function createStructuredMetadataWithMessage(e, t, r) { } return `${r.raw ? s?.raw : s?.diff}\n\n${l}\n`; } -var Tt = { +var _t = { throttle: { onAbuseLimit: (e, t, r) => { r.log.warn(`Abuse limit hit with "${t.method} ${t.url}", retrying in ${e} seconds.`); @@ -32356,7 +32390,7 @@ var Tt = { }, }, }; -var _t = Octokit.plugin(throttling, retry, paginateRest, restEndpointMethods, paginateGraphQL).defaults((e) => ({ ...Tt, ...e })); +var Tt = Octokit.plugin(throttling, retry, paginateRest, restEndpointMethods, paginateGraphQL).defaults((e) => ({ ..._t, ...e })); async function verifySignature(e, t, r) { try { const s = { @@ -32448,7 +32482,7 @@ function createPlugin(e, t, r) { eventName: n.eventName, payload: n.eventPayload, command: l, - octokit: new _t({ auth: n.authToken }), + octokit: new Tt({ auth: n.authToken }), config: i, env: a, logger: new Logs(s.logLevel), @@ -32497,29 +32531,29 @@ async function createActionsPlugin(e, t) { const r = getPluginOptions(t); const s = process.env.PLUGIN_GITHUB_TOKEN; if (!s) { - core.setFailed("Error: PLUGIN_GITHUB_TOKEN env is not set"); + mt.setFailed("Error: PLUGIN_GITHUB_TOKEN env is not set"); return; } - const o = github2.context.payload.inputs; + const o = ke.context.payload.inputs; const n = o.signature; if (!r.bypassSignatureVerification && !(await verifySignature(r.kernelPublicKey, o, n))) { - core.setFailed(`Error: Invalid signature`); + mt.setFailed(`Error: Invalid signature`); return; } - const A = github2.context.payload.inputs; - const i = [...Value3.Errors(Ft, A)]; + const A = ke.context.payload.inputs; + const i = [...value_Errors(Ft, A)]; if (i.length) { console.dir(i, { depth: null }); - core.setFailed(`Error: Invalid inputs payload: ${i.join(",")}`); + mt.setFailed(`Error: Invalid inputs payload: ${i.join(",")}`); return; } - const a = Value3.Decode(Ft, A); + const a = Decode(Ft, A); let c; if (r.settingsSchema) { try { - c = Value3.Decode(r.settingsSchema, Value3.Default(r.settingsSchema, a.settings)); + c = Decode(r.settingsSchema, value_Default(r.settingsSchema, a.settings)); } catch (e) { - console.dir(...Value3.Errors(r.settingsSchema, a.settings), { depth: null }); + console.dir(...value_Errors(r.settingsSchema, a.settings), { depth: null }); throw e; } } else { @@ -32528,9 +32562,9 @@ async function createActionsPlugin(e, t) { let u; if (r.envSchema) { try { - u = Value3.Decode(r.envSchema, Value3.Default(r.envSchema, process.env)); + u = Decode(r.envSchema, value_Default(r.envSchema, process.env)); } catch (e) { - console.dir(...Value3.Errors(r.envSchema, process.env), { depth: null }); + console.dir(...value_Errors(r.envSchema, process.env), { depth: null }); throw e; } } else { @@ -32539,9 +32573,9 @@ async function createActionsPlugin(e, t) { let l = null; if (a.command && r.commandSchema) { try { - l = Value3.Decode(r.commandSchema, Value3.Default(r.commandSchema, a.command)); + l = Decode(r.commandSchema, value_Default(r.commandSchema, a.command)); } catch (e) { - console.dir(...Value3.Errors(r.commandSchema, a.command), { depth: null }); + console.dir(...value_Errors(r.commandSchema, a.command), { depth: null }); throw e; } } else if (a.command) { @@ -32551,26 +32585,26 @@ async function createActionsPlugin(e, t) { eventName: a.eventName, payload: a.eventPayload, command: l, - octokit: new _t({ auth: a.authToken }), + octokit: new Tt({ auth: a.authToken }), config: c, env: u, - logger: new Logs2(r.logLevel), + logger: new W(r.logLevel), }; try { const t = await e(g); - core.setOutput("result", t); + mt.setOutput("result", t); await returnDataToKernel(s, a.stateId, t); } catch (e) { console.error(e); let t; if (e instanceof Error) { - core.setFailed(e); + mt.setFailed(e); t = g.logger.error(`Error: ${e}`, { error: e }); - } else if (e instanceof LogReturn3) { - core.setFailed(e.logMessage.raw); + } else if (e instanceof j) { + mt.setFailed(e.logMessage.raw); t = e; } else { - core.setFailed(`Error: ${e}`); + mt.setFailed(`Error: ${e}`); t = g.logger.error(`Error: ${e}`); } if (r.postCommentOnError && t) { @@ -32579,10 +32613,10 @@ async function createActionsPlugin(e, t) { } } async function returnDataToKernel(e, t, r) { - const s = new _t({ auth: e }); + const s = new Tt({ auth: e }); await s.rest.repos.createDispatchEvent({ - owner: github2.context.repo.owner, - repo: github2.context.repo.repo, + owner: ke.context.repo.owner, + repo: ke.context.repo.repo, event_type: "return-data-to-ubiquity-os-kernel", client_payload: { state_id: t, output: r ? JSON.stringify(r) : null }, }); @@ -32622,5 +32656,15 @@ async function runPlugin(e) { } t.error(`Unsupported event: ${r}`); } -var St = s.b; -export { St as runPlugin }; +var St = __nccwpck_require__(2874); +const vt = w.Object({ LOG_LEVEL: w.Optional(w.Enum(J)), KERNEL_PUBLIC_KEY: w.Optional(w.String()) }); +const Ut = w.Object({ configurableResponse: w.String({ default: "Hello, world!" }), customStringsUrl: w.Optional(w.String()) }, { default: {} }); +const Nt = createActionsPlugin((e) => runPlugin(e), { + logLevel: process.env.LOG_LEVEL ?? "info", + settingsSchema: Ut, + envSchema: vt, + ...(process.env.KERNEL_PUBLIC_KEY && { kernelPublicKey: process.env.KERNEL_PUBLIC_KEY }), + postCommentOnError: true, +}); +var Gt = s.A; +export { Gt as default };