From c696dd935e72a771c4f5da39fc3ea1d391b9d408 Mon Sep 17 00:00:00 2001 From: teatimeguest Date: Wed, 18 Oct 2023 15:36:25 +0900 Subject: [PATCH] chore(release): prepare for v3.0.0 --- README.md | 5 + dist/NOTICE.md | 66 +- dist/index.mjs | 82587 ++++++++++++++++++++++++++------------------ package-lock.json | 4 +- package.json | 2 +- 5 files changed, 49633 insertions(+), 33031 deletions(-) diff --git a/README.md b/README.md index 8389b4c..27712f7 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,10 @@ Linux, Windows, and macOS are supported. GitHub Actions beginning the [transition to Node.js v20][actions-node20], the action has upgraded its default runtime to Node.js v20. + If you are using a self-hosted runner, + update it to [v2.308.0][runner-node20] or later + to ensure `node20` runtime functionality. + - Change the condition under which `cache-hit` is set to `true`. To be more consistent with official actions @@ -302,6 +306,7 @@ See the [releases page][releases]. [node16-eol]: https://nodejs.org/en/blog/announcements/nodejs16-eol [portable]: https://tug.org/texlive/doc/texlive-en/texlive-en.html#tlportable [releases]: https://github.com/teatimeguest/setup-texlive-action/releases +[runner-node20]: https://github.com/actions/runner/releases/tag/v2.308.0 [texdir]: https://tug.org/texlive/doc/texlive-en/texlive-en.html#x1-250003.2.3 [texlive]: https://tug.org/texlive/ [tlcontrib]: https://contrib.texlive.info diff --git a/dist/NOTICE.md b/dist/NOTICE.md index aeef0ec..436a98a 100644 --- a/dist/NOTICE.md +++ b/dist/NOTICE.md @@ -18,6 +18,7 @@ This software incorporates the following third-party software components: - [`@azure/core-util`](#azurecore-util) - [`@azure/logger`](#azurelogger) - [`@azure/storage-blob`](#azurestorage-blob) +- [`@fastify/busboy`](#fastifybusboy) - [`@opentelemetry/api`](#opentelemetryapi) - [`asynckit`](#asynckit) - [`balanced-match`](#balanced-match) @@ -42,6 +43,7 @@ This software incorporates the following third-party software components: - [`tslib`](#tslib) - [`tunnel`](#tunnel) - [`unctx`](#unctx) +- [`undici`](#undici) - [`uuid`](#uuid) - [`xml2js`](#xml2js) - [`xmlbuilder`](#xmlbuilder) @@ -461,6 +463,36 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` +## `@fastify/busboy` + +Copyright (c) Brian White \ + +URL: + +License: `MIT` + +``` +Copyright Brian White. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +``` + ## `@opentelemetry/api` Copyright (c) OpenTelemetry Authors @@ -1141,7 +1173,7 @@ License: `ISC` ``` The ISC License -Copyright (c) Isaac Z. Schlueter and Contributors +Copyright (c) 2010-2022 Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -1160,7 +1192,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. `String.fromCodePoint` by Mathias Bynens used according to terms of MIT License, as follows: - Copyright Mathias Bynens +Copyright (c) 2010-2022 Mathias Bynens Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -1367,6 +1399,36 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` +## `undici` + +URL: + +License: `MIT` + +``` +MIT License + +Copyright (c) Matteo Collina and Undici contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` + ## `uuid` URL: diff --git a/dist/index.mjs b/dist/index.mjs index ab69386..32440d9 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -320,8 +320,8 @@ var require_engine_v8_version = __commonJS({ var global4 = require_global(); var userAgent = require_engine_user_agent(); var process2 = global4.process; - var Deno = global4.Deno; - var versions = process2 && process2.versions || Deno && Deno.version; + var Deno2 = global4.Deno; + var versions = process2 && process2.versions || Deno2 && Deno2.version; var v8 = versions && versions.v8; var match; var version4; @@ -730,12 +730,12 @@ var require_object_define_property = __commonJS({ var require_well_known_symbol_define = __commonJS({ "node_modules/core-js/internals/well-known-symbol-define.js"(exports, module) { "use strict"; - var path15 = require_path(); + var path14 = require_path(); var hasOwn = require_has_own_property(); var wrappedWellKnownSymbolModule = require_well_known_symbol_wrapped(); var defineProperty3 = require_object_define_property().f; module.exports = function(NAME) { - var Symbol4 = path15.Symbol || (path15.Symbol = {}); + var Symbol4 = path14.Symbol || (path14.Symbol = {}); if (!hasOwn(Symbol4, NAME)) defineProperty3(Symbol4, NAME, { value: wrappedWellKnownSymbolModule.f(NAME) @@ -1666,6784 +1666,15614 @@ var require_tunnel2 = __commonJS({ } }); -// node_modules/@actions/http-client/lib/index.js -var require_lib = __commonJS({ - "node_modules/@actions/http-client/lib/index.js"(exports) { +// node_modules/undici/lib/core/symbols.js +var require_symbols = __commonJS({ + "node_modules/undici/lib/core/symbols.js"(exports, module) { + module.exports = { + kClose: Symbol("close"), + kDestroy: Symbol("destroy"), + kDispatch: Symbol("dispatch"), + kUrl: Symbol("url"), + kWriting: Symbol("writing"), + kResuming: Symbol("resuming"), + kQueue: Symbol("queue"), + kConnect: Symbol("connect"), + kConnecting: Symbol("connecting"), + kHeadersList: Symbol("headers list"), + kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), + kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), + kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), + kKeepAliveTimeoutValue: Symbol("keep alive timeout"), + kKeepAlive: Symbol("keep alive"), + kHeadersTimeout: Symbol("headers timeout"), + kBodyTimeout: Symbol("body timeout"), + kServerName: Symbol("server name"), + kLocalAddress: Symbol("local address"), + kHost: Symbol("host"), + kNoRef: Symbol("no ref"), + kBodyUsed: Symbol("used"), + kRunning: Symbol("running"), + kBlocking: Symbol("blocking"), + kPending: Symbol("pending"), + kSize: Symbol("size"), + kBusy: Symbol("busy"), + kQueued: Symbol("queued"), + kFree: Symbol("free"), + kConnected: Symbol("connected"), + kClosed: Symbol("closed"), + kNeedDrain: Symbol("need drain"), + kReset: Symbol("reset"), + kDestroyed: Symbol.for("nodejs.stream.destroyed"), + kMaxHeadersSize: Symbol("max headers size"), + kRunningIdx: Symbol("running index"), + kPendingIdx: Symbol("pending index"), + kError: Symbol("error"), + kClients: Symbol("clients"), + kClient: Symbol("client"), + kParser: Symbol("parser"), + kOnDestroyed: Symbol("destroy callbacks"), + kPipelining: Symbol("pipelining"), + kSocket: Symbol("socket"), + kHostHeader: Symbol("host header"), + kConnector: Symbol("connector"), + kStrictContentLength: Symbol("strict content length"), + kMaxRedirections: Symbol("maxRedirections"), + kMaxRequests: Symbol("maxRequestsPerClient"), + kProxy: Symbol("proxy agent options"), + kCounter: Symbol("socket request counter"), + kInterceptors: Symbol("dispatch interceptors"), + kMaxResponseSize: Symbol("max response size"), + kHTTP2Session: Symbol("http2Session"), + kHTTP2SessionState: Symbol("http2Session state"), + kHTTP2BuildRequest: Symbol("http2 build request"), + kHTTP1BuildRequest: Symbol("http1 build request"), + kHTTP2CopyHeaders: Symbol("http2 copy headers"), + kHTTPConnVersion: Symbol("http connection version") + }; + } +}); + +// node_modules/undici/lib/core/errors.js +var require_errors = __commonJS({ + "node_modules/undici/lib/core/errors.js"(exports, module) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - Object.defineProperty(o2, k22, { enumerable: true, get: function() { - return m3[k2]; - } }); - } : function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - o2[k22] = m3[k2]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { - Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); - } : function(o2, v2) { - o2["default"] = v2; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k2 in mod) - if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) - __createBinding(result, mod, k2); + var UndiciError = class extends Error { + constructor(message) { + super(message); + this.name = "UndiciError"; + this.code = "UND_ERR"; } - __setModuleDefault(result, mod); - return result; }; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve2) { - resolve2(value); - }); + var ConnectTimeoutError = class _ConnectTimeoutError extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, _ConnectTimeoutError); + this.name = "ConnectTimeoutError"; + this.message = message || "Connect Timeout Error"; + this.code = "UND_ERR_CONNECT_TIMEOUT"; } - return new (P2 || (P2 = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e2) { - reject(e2); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e2) { - reject(e2); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; - var http4 = __importStar(__require("http")); - var https3 = __importStar(__require("https")); - var pm = __importStar(require_proxy()); - var tunnel2 = __importStar(require_tunnel2()); - var HttpCodes2; - (function(HttpCodes3) { - HttpCodes3[HttpCodes3["OK"] = 200] = "OK"; - HttpCodes3[HttpCodes3["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes3[HttpCodes3["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes3[HttpCodes3["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes3[HttpCodes3["SeeOther"] = 303] = "SeeOther"; - HttpCodes3[HttpCodes3["NotModified"] = 304] = "NotModified"; - HttpCodes3[HttpCodes3["UseProxy"] = 305] = "UseProxy"; - HttpCodes3[HttpCodes3["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes3[HttpCodes3["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes3[HttpCodes3["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes3[HttpCodes3["BadRequest"] = 400] = "BadRequest"; - HttpCodes3[HttpCodes3["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes3[HttpCodes3["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes3[HttpCodes3["Forbidden"] = 403] = "Forbidden"; - HttpCodes3[HttpCodes3["NotFound"] = 404] = "NotFound"; - HttpCodes3[HttpCodes3["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes3[HttpCodes3["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes3[HttpCodes3["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes3[HttpCodes3["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes3[HttpCodes3["Conflict"] = 409] = "Conflict"; - HttpCodes3[HttpCodes3["Gone"] = 410] = "Gone"; - HttpCodes3[HttpCodes3["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes3[HttpCodes3["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes3[HttpCodes3["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes3[HttpCodes3["BadGateway"] = 502] = "BadGateway"; - HttpCodes3[HttpCodes3["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes3[HttpCodes3["GatewayTimeout"] = 504] = "GatewayTimeout"; - })(HttpCodes2 = exports.HttpCodes || (exports.HttpCodes = {})); - var Headers2; - (function(Headers3) { - Headers3["Accept"] = "accept"; - Headers3["ContentType"] = "content-type"; - })(Headers2 = exports.Headers || (exports.Headers = {})); - var MediaTypes; - (function(MediaTypes2) { - MediaTypes2["ApplicationJson"] = "application/json"; - })(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); - function getProxyUrl(serverUrl) { - const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); - return proxyUrl ? proxyUrl.href : ""; - } - exports.getProxyUrl = getProxyUrl; - var HttpRedirectCodes = [ - HttpCodes2.MovedPermanently, - HttpCodes2.ResourceMoved, - HttpCodes2.SeeOther, - HttpCodes2.TemporaryRedirect, - HttpCodes2.PermanentRedirect - ]; - var HttpResponseRetryCodes = [ - HttpCodes2.BadGateway, - HttpCodes2.ServiceUnavailable, - HttpCodes2.GatewayTimeout - ]; - var RetryableHttpVerbs = ["OPTIONS", "GET", "DELETE", "HEAD"]; - var ExponentialBackoffCeiling = 10; - var ExponentialBackoffTimeSlice = 5; - var HttpClientError2 = class _HttpClientError extends Error { - constructor(message, statusCode) { + var HeadersTimeoutError = class _HeadersTimeoutError extends UndiciError { + constructor(message) { super(message); - this.name = "HttpClientError"; - this.statusCode = statusCode; - Object.setPrototypeOf(this, _HttpClientError.prototype); + Error.captureStackTrace(this, _HeadersTimeoutError); + this.name = "HeadersTimeoutError"; + this.message = message || "Headers Timeout Error"; + this.code = "UND_ERR_HEADERS_TIMEOUT"; } }; - exports.HttpClientError = HttpClientError2; - var HttpClientResponse = class { + var HeadersOverflowError = class _HeadersOverflowError extends UndiciError { constructor(message) { - this.message = message; + super(message); + Error.captureStackTrace(this, _HeadersOverflowError); + this.name = "HeadersOverflowError"; + this.message = message || "Headers Overflow Error"; + this.code = "UND_ERR_HEADERS_OVERFLOW"; } - readBody() { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter(this, void 0, void 0, function* () { - let output = Buffer.alloc(0); - this.message.on("data", (chunk) => { - output = Buffer.concat([output, chunk]); - }); - this.message.on("end", () => { - resolve2(output.toString()); - }); - })); - }); + }; + var BodyTimeoutError = class _BodyTimeoutError extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, _BodyTimeoutError); + this.name = "BodyTimeoutError"; + this.message = message || "Body Timeout Error"; + this.code = "UND_ERR_BODY_TIMEOUT"; } - readBodyBuffer() { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve2(Buffer.concat(chunks)); - }); - })); - }); + }; + var ResponseStatusCodeError = class _ResponseStatusCodeError extends UndiciError { + constructor(message, statusCode, headers, body2) { + super(message); + Error.captureStackTrace(this, _ResponseStatusCodeError); + this.name = "ResponseStatusCodeError"; + this.message = message || "Response Status Code Error"; + this.code = "UND_ERR_RESPONSE_STATUS_CODE"; + this.body = body2; + this.status = statusCode; + this.statusCode = statusCode; + this.headers = headers; } }; - exports.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - exports.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = userAgent; - this.handlers = handlers || []; - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; - } - this._socketTimeout = requestOptions.socketTimeout; - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; - } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; - } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; - } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; - } - } + var InvalidArgumentError = class _InvalidArgumentError extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, _InvalidArgumentError); + this.name = "InvalidArgumentError"; + this.message = message || "Invalid Argument Error"; + this.code = "UND_ERR_INVALID_ARG"; } - options(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); + }; + var InvalidReturnValueError = class _InvalidReturnValueError extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, _InvalidReturnValueError); + this.name = "InvalidReturnValueError"; + this.message = message || "Invalid Return Value Error"; + this.code = "UND_ERR_INVALID_RETURN_VALUE"; } - get(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); + }; + var RequestAbortedError = class _RequestAbortedError extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, _RequestAbortedError); + this.name = "AbortError"; + this.message = message || "Request aborted"; + this.code = "UND_ERR_ABORTED"; } - del(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); + }; + var InformationalError = class _InformationalError extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, _InformationalError); + this.name = "InformationalError"; + this.message = message || "Request information"; + this.code = "UND_ERR_INFO"; } - post(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); + }; + var RequestContentLengthMismatchError = class _RequestContentLengthMismatchError extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, _RequestContentLengthMismatchError); + this.name = "RequestContentLengthMismatchError"; + this.message = message || "Request body length does not match content-length header"; + this.code = "UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"; } - patch(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); + }; + var ResponseContentLengthMismatchError = class _ResponseContentLengthMismatchError extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, _ResponseContentLengthMismatchError); + this.name = "ResponseContentLengthMismatchError"; + this.message = message || "Response body length does not match content-length header"; + this.code = "UND_ERR_RES_CONTENT_LENGTH_MISMATCH"; } - put(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); + }; + var ClientDestroyedError = class _ClientDestroyedError extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, _ClientDestroyedError); + this.name = "ClientDestroyedError"; + this.message = message || "The client is destroyed"; + this.code = "UND_ERR_DESTROYED"; } - head(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + }; + var ClientClosedError = class _ClientClosedError extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, _ClientClosedError); + this.name = "ClientClosedError"; + this.message = message || "The client is closed"; + this.code = "UND_ERR_CLOSED"; } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); + }; + var SocketError = class _SocketError extends UndiciError { + constructor(message, socket) { + super(message); + Error.captureStackTrace(this, _SocketError); + this.name = "SocketError"; + this.message = message || "Socket error"; + this.code = "UND_ERR_SOCKET"; + this.socket = socket; } - /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise - */ - getJson(requestUrl, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); - const res = yield this.get(requestUrl, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); + }; + var NotSupportedError = class _NotSupportedError extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, _NotSupportedError); + this.name = "NotSupportedError"; + this.message = message || "Not supported error"; + this.code = "UND_ERR_NOT_SUPPORTED"; } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.ContentType, MediaTypes.ApplicationJson); - const res = yield this.post(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); + }; + var BalancedPoolMissingUpstreamError = class extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, NotSupportedError); + this.name = "MissingUpstreamError"; + this.message = message || "No upstream has been added to the BalancedPool"; + this.code = "UND_ERR_BPL_MISSING_UPSTREAM"; } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.ContentType, MediaTypes.ApplicationJson); - const res = yield this.put(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); + }; + var HTTPParserError = class _HTTPParserError extends Error { + constructor(message, code, data) { + super(message); + Error.captureStackTrace(this, _HTTPParserError); + this.name = "HTTPParserError"; + this.code = code ? `HPE_${code}` : void 0; + this.data = data ? data.toString() : void 0; } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.ContentType, MediaTypes.ApplicationJson); - const res = yield this.patch(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); + }; + var ResponseExceededMaxSizeError = class _ResponseExceededMaxSizeError extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, _ResponseExceededMaxSizeError); + this.name = "ResponseExceededMaxSizeError"; + this.message = message || "Response content exceeded max size"; + this.code = "UND_ERR_RES_EXCEEDED_MAX_SIZE"; } - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - request(verb, requestUrl, data, headers) { - return __awaiter(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info3 = this._prepareRequest(verb, parsedUrl, headers); - const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; - let numTries = 0; - let response; - do { - response = yield this.requestRaw(info3, data); - if (response && response.message && response.message.statusCode === HttpCodes2.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info3, data); - } else { - return response; - } - } - let redirectsRemaining = this._maxRedirects; - while (response.message.statusCode && HttpRedirectCodes.includes(response.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) { - const redirectUrl = response.message.headers["location"]; - if (!redirectUrl) { - break; - } - const parsedRedirectUrl = new URL(redirectUrl); - if (parsedUrl.protocol === "https:" && parsedUrl.protocol !== parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { - throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); - } - yield response.readBody(); - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - if (header.toLowerCase() === "authorization") { - delete headers[header]; - } - } - } - info3 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info3, data); - redirectsRemaining--; - } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; - } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); - } - } while (numTries < maxTries); - return response; - }); + }; + module.exports = { + HTTPParserError, + UndiciError, + HeadersTimeoutError, + HeadersOverflowError, + BodyTimeoutError, + RequestContentLengthMismatchError, + ConnectTimeoutError, + ResponseStatusCodeError, + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError, + ClientDestroyedError, + ClientClosedError, + InformationalError, + SocketError, + NotSupportedError, + ResponseContentLengthMismatchError, + BalancedPoolMissingUpstreamError, + ResponseExceededMaxSizeError + }; + } +}); + +// node_modules/undici/lib/core/util.js +var require_util = __commonJS({ + "node_modules/undici/lib/core/util.js"(exports, module) { + "use strict"; + var assert = __require("assert"); + var { kDestroyed, kBodyUsed } = require_symbols(); + var { IncomingMessage } = __require("http"); + var stream = __require("stream"); + var net = __require("net"); + var { InvalidArgumentError } = require_errors(); + var { Blob: Blob4 } = __require("buffer"); + var nodeUtil = __require("util"); + var { stringify: stringify3 } = __require("querystring"); + var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v2) => Number(v2)); + function nop() { + } + function isStream(obj) { + return obj && typeof obj === "object" && typeof obj.pipe === "function" && typeof obj.on === "function"; + } + function isBlobLike(object) { + return Blob4 && object instanceof Blob4 || object && typeof object === "object" && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && /^(Blob|File)$/.test(object[Symbol.toStringTag]); + } + function buildURL(url2, queryParams) { + if (url2.includes("?") || url2.includes("#")) { + throw new Error('Query params cannot be passed when url already contains "?" or "#".'); } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); + const stringified = stringify3(queryParams); + if (stringified) { + url2 += "?" + stringified; + } + return url2; + } + function parseURL2(url2) { + if (typeof url2 === "string") { + url2 = new URL(url2); + if (!/^https?:/.test(url2.origin || url2.protocol)) { + throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); } - this._disposed = true; + return url2; } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info3, data) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve2(res); - } - } - this.requestRawWithCallback(info3, data, callbackForResult); - }); - }); + if (!url2 || typeof url2 !== "object") { + throw new InvalidArgumentError("Invalid URL: The URL argument must be a non-null object."); } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info3, data, onResult) { - if (typeof data === "string") { - if (!info3.options.headers) { - info3.options.headers = {}; - } - info3.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + if (!/^https?:/.test(url2.origin || url2.protocol)) { + throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); + } + if (!(url2 instanceof URL)) { + if (url2.port != null && url2.port !== "" && !Number.isFinite(parseInt(url2.port))) { + throw new InvalidArgumentError("Invalid URL: port must be a valid integer or a string representation of an integer."); } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } + if (url2.path != null && typeof url2.path !== "string") { + throw new InvalidArgumentError("Invalid URL path: the path must be a string or null/undefined."); } - const req = info3.httpModule.request(info3.options, (msg) => { - const res = new HttpClientResponse(msg); - handleResult(void 0, res); - }); - let socket; - req.on("socket", (sock) => { - socket = sock; - }); - req.setTimeout(this._socketTimeout || 3 * 6e4, () => { - if (socket) { - socket.end(); - } - handleResult(new Error(`Request timeout: ${info3.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); - }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + if (url2.pathname != null && typeof url2.pathname !== "string") { + throw new InvalidArgumentError("Invalid URL pathname: the pathname must be a string or null/undefined."); } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); - } else { - req.end(); + if (url2.hostname != null && typeof url2.hostname !== "string") { + throw new InvalidArgumentError("Invalid URL hostname: the hostname must be a string or null/undefined."); } - } - /** - * Gets an http agent. This function is useful when you need an http agent that handles - * routing through a proxy server - depending upon the url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ - getAgent(serverUrl) { - const parsedUrl = new URL(serverUrl); - return this._getAgent(parsedUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info3 = {}; - info3.parsedUrl = requestUrl; - const usingSsl = info3.parsedUrl.protocol === "https:"; - info3.httpModule = usingSsl ? https3 : http4; - const defaultPort = usingSsl ? 443 : 80; - info3.options = {}; - info3.options.host = info3.parsedUrl.hostname; - info3.options.port = info3.parsedUrl.port ? parseInt(info3.parsedUrl.port) : defaultPort; - info3.options.path = (info3.parsedUrl.pathname || "") + (info3.parsedUrl.search || ""); - info3.options.method = method; - info3.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info3.options.headers["user-agent"] = this.userAgent; + if (url2.origin != null && typeof url2.origin !== "string") { + throw new InvalidArgumentError("Invalid URL origin: the origin must be a string or null/undefined."); } - info3.options.agent = this._getAgent(info3.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info3.options); - } + const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; + let origin = url2.origin != null ? url2.origin : `${url2.protocol}//${url2.hostname}:${port}`; + let path14 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + if (origin.endsWith("/")) { + origin = origin.substring(0, origin.length - 1); } - return info3; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + if (path14 && !path14.startsWith("/")) { + path14 = `/${path14}`; } - return lowercaseKeys(headers || {}); + url2 = new URL(origin + path14); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default; + return url2; + } + function parseOrigin(url2) { + url2 = parseURL2(url2); + if (url2.pathname !== "/" || url2.search || url2.hash) { + throw new InvalidArgumentError("invalid url"); } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; - } - if (this._keepAlive && !useProxy) { - agent = this._agent; - } - if (agent) { - return agent; - } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http4.globalAgent.maxSockets; + return url2; + } + function getHostname(host) { + if (host[0] === "[") { + const idx2 = host.indexOf("]"); + assert(idx2 !== -1); + return host.substr(1, idx2 - 1); + } + const idx = host.indexOf(":"); + if (idx === -1) + return host; + return host.substr(0, idx); + } + function getServerName(host) { + if (!host) { + return null; + } + assert.strictEqual(typeof host, "string"); + const servername = getHostname(host); + if (net.isIP(servername)) { + return ""; + } + return servername; + } + function deepClone(obj) { + return JSON.parse(JSON.stringify(obj)); + } + function isAsyncIterable(obj) { + return !!(obj != null && typeof obj[Symbol.asyncIterator] === "function"); + } + function isIterable2(obj) { + return !!(obj != null && (typeof obj[Symbol.iterator] === "function" || typeof obj[Symbol.asyncIterator] === "function")); + } + function bodyLength(body2) { + if (body2 == null) { + return 0; + } else if (isStream(body2)) { + const state = body2._readableState; + return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length) ? state.length : null; + } else if (isBlobLike(body2)) { + return body2.size != null ? body2.size : null; + } else if (isBuffer(body2)) { + return body2.byteLength; + } + return null; + } + function isDestroyed(stream2) { + return !stream2 || !!(stream2.destroyed || stream2[kDestroyed]); + } + function isReadableAborted(stream2) { + const state = stream2 && stream2._readableState; + return isDestroyed(stream2) && state && !state.endEmitted; + } + function destroy2(stream2, err) { + if (!isStream(stream2) || isDestroyed(stream2)) { + return; + } + if (typeof stream2.destroy === "function") { + if (Object.getPrototypeOf(stream2).constructor === IncomingMessage) { + stream2.socket = null; } - if (proxyUrl && proxyUrl.hostname) { - const agentOptions = { - maxSockets, - keepAlive: this._keepAlive, - proxy: Object.assign(Object.assign({}, (proxyUrl.username || proxyUrl.password) && { - proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` - }), { host: proxyUrl.hostname, port: proxyUrl.port }) - }; - let tunnelAgent; - const overHttps = proxyUrl.protocol === "https:"; - if (usingSsl) { - tunnelAgent = overHttps ? tunnel2.httpsOverHttps : tunnel2.httpsOverHttp; + stream2.destroy(err); + } else if (err) { + process.nextTick((stream3, err2) => { + stream3.emit("error", err2); + }, stream2, err); + } + if (stream2.destroyed !== true) { + stream2[kDestroyed] = true; + } + } + var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; + function parseKeepAliveTimeout(val) { + const m3 = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); + return m3 ? parseInt(m3[1], 10) * 1e3 : null; + } + function parseHeaders2(headers, obj = {}) { + if (!Array.isArray(headers)) + return headers; + for (let i2 = 0; i2 < headers.length; i2 += 2) { + const key = headers[i2].toString().toLowerCase(); + let val = obj[key]; + if (!val) { + if (Array.isArray(headers[i2 + 1])) { + obj[key] = headers[i2 + 1]; } else { - tunnelAgent = overHttps ? tunnel2.httpOverHttps : tunnel2.httpOverHttp; + obj[key] = headers[i2 + 1].toString("utf8"); } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; + } else { + if (!Array.isArray(val)) { + val = [val]; + obj[key] = val; + } + val.push(headers[i2 + 1].toString("utf8")); } - if (this._keepAlive && !agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https3.Agent(options) : new http4.Agent(options); - this._agent = agent; + } + if ("content-length" in obj && "content-disposition" in obj) { + obj["content-disposition"] = Buffer.from(obj["content-disposition"]).toString("latin1"); + } + return obj; + } + function parseRawHeaders(headers) { + const ret = []; + let hasContentLength = false; + let contentDispositionIdx = -1; + for (let n2 = 0; n2 < headers.length; n2 += 2) { + const key = headers[n2 + 0].toString(); + const val = headers[n2 + 1].toString("utf8"); + if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) { + ret.push(key, val); + hasContentLength = true; + } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { + contentDispositionIdx = ret.push(key, val) - 1; + } else { + ret.push(key, val); } - if (!agent) { - agent = usingSsl ? https3.globalAgent : http4.globalAgent; + } + if (hasContentLength && contentDispositionIdx !== -1) { + ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString("latin1"); + } + return ret; + } + function isBuffer(buffer) { + return buffer instanceof Uint8Array || Buffer.isBuffer(buffer); + } + function validateHandler(handler, method, upgrade) { + if (!handler || typeof handler !== "object") { + throw new InvalidArgumentError("handler must be an object"); + } + if (typeof handler.onConnect !== "function") { + throw new InvalidArgumentError("invalid onConnect method"); + } + if (typeof handler.onError !== "function") { + throw new InvalidArgumentError("invalid onError method"); + } + if (typeof handler.onBodySent !== "function" && handler.onBodySent !== void 0) { + throw new InvalidArgumentError("invalid onBodySent method"); + } + if (upgrade || method === "CONNECT") { + if (typeof handler.onUpgrade !== "function") { + throw new InvalidArgumentError("invalid onUpgrade method"); } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + } else { + if (typeof handler.onHeaders !== "function") { + throw new InvalidArgumentError("invalid onHeaders method"); + } + if (typeof handler.onData !== "function") { + throw new InvalidArgumentError("invalid onData method"); + } + if (typeof handler.onComplete !== "function") { + throw new InvalidArgumentError("invalid onComplete method"); } - return agent; } - _performExponentialBackoff(retryNumber) { - return __awaiter(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); - }); + } + function isDisturbed(body2) { + return !!(body2 && (stream.isDisturbed ? stream.isDisturbed(body2) || body2[kBodyUsed] : body2[kBodyUsed] || body2.readableDidRead || body2._readableState && body2._readableState.dataEmitted || isReadableAborted(body2))); + } + function isErrored(body2) { + return !!(body2 && (stream.isErrored ? stream.isErrored(body2) : /state: 'errored'/.test( + nodeUtil.inspect(body2) + ))); + } + function isReadable(body2) { + return !!(body2 && (stream.isReadable ? stream.isReadable(body2) : /state: 'readable'/.test( + nodeUtil.inspect(body2) + ))); + } + function getSocketInfo(socket) { + return { + localAddress: socket.localAddress, + localPort: socket.localPort, + remoteAddress: socket.remoteAddress, + remotePort: socket.remotePort, + remoteFamily: socket.remoteFamily, + timeout: socket.timeout, + bytesWritten: socket.bytesWritten, + bytesRead: socket.bytesRead + }; + } + async function* convertIterableToBuffer(iterable) { + for await (const chunk of iterable) { + yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk); } - _processResponse(res, options) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes2.NotFound) { - resolve2(response); - } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a2 = new Date(value); - if (!isNaN(a2.valueOf())) { - return a2; - } - } - return value; - } - let obj; - let contents; - try { - contents = yield res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, dateTimeDeserializer); - } else { - obj = JSON.parse(contents); - } - response.result = obj; - } - response.headers = res.message.headers; - } catch (err) { - } - if (statusCode > 299) { - let msg; - if (obj && obj.message) { - msg = obj.message; - } else if (contents && contents.length > 0) { - msg = contents; - } else { - msg = `Failed request: (${statusCode})`; - } - const err = new HttpClientError2(msg, statusCode); - err.result = response.result; - reject(err); + } + var ReadableStream; + function ReadableStreamFrom(iterable) { + if (!ReadableStream) { + ReadableStream = __require("stream/web").ReadableStream; + } + if (ReadableStream.from) { + return ReadableStream.from(convertIterableToBuffer(iterable)); + } + let iterator; + return new ReadableStream( + { + async start() { + iterator = iterable[Symbol.asyncIterator](); + }, + async pull(controller) { + const { done, value } = await iterator.next(); + if (done) { + queueMicrotask(() => { + controller.close(); + }); } else { - resolve2(response); + const buf = Buffer.isBuffer(value) ? value : Buffer.from(value); + controller.enqueue(new Uint8Array(buf)); } - })); - }); + return controller.desiredSize > 0; + }, + async cancel(reason) { + await iterator.return(); + } + }, + 0 + ); + } + function isFormDataLike(object) { + return object && typeof object === "object" && typeof object.append === "function" && typeof object.delete === "function" && typeof object.get === "function" && typeof object.getAll === "function" && typeof object.has === "function" && typeof object.set === "function" && object[Symbol.toStringTag] === "FormData"; + } + function throwIfAborted(signal) { + if (!signal) { + return; + } + if (typeof signal.throwIfAborted === "function") { + signal.throwIfAborted(); + } else { + if (signal.aborted) { + const err = new Error("The operation was aborted"); + err.name = "AbortError"; + throw err; + } + } + } + var events; + function addAbortListener(signal, listener) { + if (typeof Symbol.dispose === "symbol") { + if (!events) { + events = __require("events"); + } + if (typeof events.addAbortListener === "function" && "aborted" in signal) { + return events.addAbortListener(signal, listener); + } + } + if ("addEventListener" in signal) { + signal.addEventListener("abort", listener, { once: true }); + return () => signal.removeEventListener("abort", listener); } + signal.addListener("abort", listener); + return () => signal.removeListener("abort", listener); + } + var hasToWellFormed = !!String.prototype.toWellFormed; + function toUSVString(val) { + if (hasToWellFormed) { + return `${val}`.toWellFormed(); + } else if (nodeUtil.toUSVString) { + return nodeUtil.toUSVString(val); + } + return `${val}`; + } + var kEnumerableProperty = /* @__PURE__ */ Object.create(null); + kEnumerableProperty.enumerable = true; + module.exports = { + kEnumerableProperty, + nop, + isDisturbed, + isErrored, + isReadable, + toUSVString, + isReadableAborted, + isBlobLike, + parseOrigin, + parseURL: parseURL2, + getServerName, + isStream, + isIterable: isIterable2, + isAsyncIterable, + isDestroyed, + parseRawHeaders, + parseHeaders: parseHeaders2, + parseKeepAliveTimeout, + destroy: destroy2, + bodyLength, + deepClone, + ReadableStreamFrom, + isBuffer, + validateHandler, + getSocketInfo, + isFormDataLike, + buildURL, + throwIfAborted, + addAbortListener, + nodeMajor, + nodeMinor, + nodeHasAutoSelectFamily: nodeMajor > 18 || nodeMajor === 18 && nodeMinor >= 13 }; - exports.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c2, k2) => (c2[k2.toLowerCase()] = obj[k2], c2), {}); } }); -// node_modules/@actions/http-client/lib/auth.js -var require_auth = __commonJS({ - "node_modules/@actions/http-client/lib/auth.js"(exports) { +// node_modules/undici/lib/timers.js +var require_timers = __commonJS({ + "node_modules/undici/lib/timers.js"(exports, module) { "use strict"; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve2) { - resolve2(value); - }); - } - return new (P2 || (P2 = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e2) { - reject(e2); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e2) { - reject(e2); + var fastNow = Date.now(); + var fastNowTimeout; + var fastTimers = []; + function onTimeout() { + fastNow = Date.now(); + let len = fastTimers.length; + let idx = 0; + while (idx < len) { + const timer = fastTimers[idx]; + if (timer.state === 0) { + timer.state = fastNow + timer.delay; + } else if (timer.state > 0 && fastNow >= timer.state) { + timer.state = -1; + timer.callback(timer.opaque); + } + if (timer.state === -1) { + timer.state = -2; + if (idx !== len - 1) { + fastTimers[idx] = fastTimers.pop(); + } else { + fastTimers.pop(); } + len -= 1; + } else { + idx += 1; } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + if (fastTimers.length > 0) { + refreshTimeout(); + } + } + function refreshTimeout() { + if (fastNowTimeout && fastNowTimeout.refresh) { + fastNowTimeout.refresh(); + } else { + clearTimeout(fastNowTimeout); + fastNowTimeout = setTimeout(onTimeout, 1e3); + if (fastNowTimeout.unref) { + fastNowTimeout.unref(); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; - var BasicCredentialHandler = class { - constructor(username, password) { - this.username = username; - this.password = password; } - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); + } + var Timeout = class { + constructor(callback, delay3, opaque) { + this.callback = callback; + this.delay = delay3; + this.opaque = opaque; + this.state = -2; + this.refresh(); + } + refresh() { + if (this.state === -2) { + fastTimers.push(this); + if (!fastNowTimeout || fastTimers.length === 1) { + refreshTimeout(); + } } - options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; + this.state = 0; } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + clear() { + this.state = -1; } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + }; + module.exports = { + setTimeout(callback, delay3, opaque) { + return delay3 < 1e3 ? setTimeout(callback, delay3, opaque) : new Timeout(callback, delay3, opaque); + }, + clearTimeout(timeout) { + if (timeout instanceof Timeout) { + timeout.clear(); + } else { + clearTimeout(timeout); + } } }; - exports.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler = class { - constructor(token) { - this.token = token; + } +}); + +// node_modules/@fastify/busboy/deps/streamsearch/sbmh.js +var require_sbmh = __commonJS({ + "node_modules/@fastify/busboy/deps/streamsearch/sbmh.js"(exports, module) { + "use strict"; + var EventEmitter3 = __require("node:events").EventEmitter; + var inherits = __require("node:util").inherits; + function SBMH(needle) { + if (typeof needle === "string") { + needle = Buffer.from(needle); + } + if (!Buffer.isBuffer(needle)) { + throw new TypeError("The needle has to be a String or a Buffer."); + } + const needleLength = needle.length; + if (needleLength === 0) { + throw new Error("The needle cannot be an empty String/Buffer."); + } + if (needleLength > 256) { + throw new Error("The needle cannot have a length bigger than 256."); + } + this.maxMatches = Infinity; + this.matches = 0; + this._occ = new Array(256).fill(needleLength); + this._lookbehind_size = 0; + this._needle = needle; + this._bufpos = 0; + this._lookbehind = Buffer.alloc(needleLength); + for (var i2 = 0; i2 < needleLength - 1; ++i2) { + this._occ[needle[i2]] = needleLength - 1 - i2; } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); + } + inherits(SBMH, EventEmitter3); + SBMH.prototype.reset = function() { + this._lookbehind_size = 0; + this.matches = 0; + this._bufpos = 0; + }; + SBMH.prototype.push = function(chunk, pos) { + if (!Buffer.isBuffer(chunk)) { + chunk = Buffer.from(chunk, "binary"); + } + const chlen = chunk.length; + this._bufpos = pos || 0; + let r2; + while (r2 !== chlen && this.matches < this.maxMatches) { + r2 = this._sbmh_feed(chunk); + } + return r2; + }; + SBMH.prototype._sbmh_feed = function(data) { + const len = data.length; + const needle = this._needle; + const needleLength = needle.length; + const lastNeedleChar = needle[needleLength - 1]; + let pos = -this._lookbehind_size; + let ch; + if (pos < 0) { + while (pos < 0 && pos <= len - needleLength) { + ch = this._sbmh_lookup_char(data, pos + needleLength - 1); + if (ch === lastNeedleChar && this._sbmh_memcmp(data, pos, needleLength - 1)) { + this._lookbehind_size = 0; + ++this.matches; + this.emit("info", true); + return this._bufpos = pos + needleLength; + } + pos += this._occ[ch]; + } + if (pos < 0) { + while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { + ++pos; + } + } + if (pos >= 0) { + this.emit("info", false, this._lookbehind, 0, this._lookbehind_size); + this._lookbehind_size = 0; + } else { + const bytesToCutOff = this._lookbehind_size + pos; + if (bytesToCutOff > 0) { + this.emit("info", false, this._lookbehind, 0, bytesToCutOff); + } + this._lookbehind.copy( + this._lookbehind, + 0, + bytesToCutOff, + this._lookbehind_size - bytesToCutOff + ); + this._lookbehind_size -= bytesToCutOff; + data.copy(this._lookbehind, this._lookbehind_size); + this._lookbehind_size += len; + this._bufpos = len; + return len; + } + } + pos += (pos >= 0) * this._bufpos; + if (data.indexOf(needle, pos) !== -1) { + pos = data.indexOf(needle, pos); + ++this.matches; + if (pos > 0) { + this.emit("info", true, data, this._bufpos, pos); + } else { + this.emit("info", true); } - options.headers["Authorization"] = `Bearer ${this.token}`; + return this._bufpos = pos + needleLength; + } else { + pos = len - needleLength; } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + while (pos < len && (data[pos] !== needle[0] || Buffer.compare( + data.subarray(pos, pos + len - pos), + needle.subarray(0, len - pos) + ) !== 0)) { + ++pos; } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + if (pos < len) { + data.copy(this._lookbehind, 0, pos, pos + (len - pos)); + this._lookbehind_size = len - pos; } - }; - exports.BearerCredentialHandler = BearerCredentialHandler; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; + if (pos > 0) { + this.emit("info", false, data, this._bufpos, pos < len ? pos : len); } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); + this._bufpos = len; + return len; + }; + SBMH.prototype._sbmh_lookup_char = function(data, pos) { + return pos < 0 ? this._lookbehind[this._lookbehind_size + pos] : data[pos]; + }; + SBMH.prototype._sbmh_memcmp = function(data, pos, len) { + for (var i2 = 0; i2 < len; ++i2) { + if (this._sbmh_lookup_char(data, pos + i2) !== this._needle[i2]) { + return false; } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + return true; + }; + module.exports = SBMH; + } +}); + +// node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js +var require_PartStream = __commonJS({ + "node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js"(exports, module) { + "use strict"; + var inherits = __require("node:util").inherits; + var ReadableStream = __require("node:stream").Readable; + function PartStream(opts) { + ReadableStream.call(this, opts); + } + inherits(PartStream, ReadableStream); + PartStream.prototype._read = function(n2) { + }; + module.exports = PartStream; + } +}); + +// node_modules/@fastify/busboy/lib/utils/getLimit.js +var require_getLimit = __commonJS({ + "node_modules/@fastify/busboy/lib/utils/getLimit.js"(exports, module) { + "use strict"; + module.exports = function getLimit(limits, name2, defaultLimit) { + if (!limits || limits[name2] === void 0 || limits[name2] === null) { + return defaultLimit; } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + if (typeof limits[name2] !== "number" || isNaN(limits[name2])) { + throw new TypeError("Limit " + name2 + " is not a valid number"); } + return limits[name2]; }; - exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; } }); -// node_modules/@actions/core/lib/oidc-utils.js -var require_oidc_utils = __commonJS({ - "node_modules/@actions/core/lib/oidc-utils.js"(exports) { +// node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js +var require_HeaderParser = __commonJS({ + "node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js"(exports, module) { "use strict"; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve2) { - resolve2(value); - }); - } - return new (P2 || (P2 = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e2) { - reject(e2); + var EventEmitter3 = __require("node:events").EventEmitter; + var inherits = __require("node:util").inherits; + var getLimit = require_getLimit(); + var StreamSearch = require_sbmh(); + var B_DCRLF = Buffer.from("\r\n\r\n"); + var RE_CRLF = /\r\n/g; + var RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/; + function HeaderParser(cfg) { + EventEmitter3.call(this); + cfg = cfg || {}; + const self2 = this; + this.nread = 0; + this.maxed = false; + this.npairs = 0; + this.maxHeaderPairs = getLimit(cfg, "maxHeaderPairs", 2e3); + this.maxHeaderSize = getLimit(cfg, "maxHeaderSize", 80 * 1024); + this.buffer = ""; + this.header = {}; + this.finished = false; + this.ss = new StreamSearch(B_DCRLF); + this.ss.on("info", function(isMatch, data, start, end) { + if (data && !self2.maxed) { + if (self2.nread + end - start >= self2.maxHeaderSize) { + end = self2.maxHeaderSize - self2.nread + start; + self2.nread = self2.maxHeaderSize; + self2.maxed = true; + } else { + self2.nread += end - start; } + self2.buffer += data.toString("binary", start, end); } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e2) { - reject(e2); + if (isMatch) { + self2._finish(); + } + }); + } + inherits(HeaderParser, EventEmitter3); + HeaderParser.prototype.push = function(data) { + const r2 = this.ss.push(data); + if (this.finished) { + return r2; + } + }; + HeaderParser.prototype.reset = function() { + this.finished = false; + this.buffer = ""; + this.header = {}; + this.ss.reset(); + }; + HeaderParser.prototype._finish = function() { + if (this.buffer) { + this._parseHeader(); + } + this.ss.matches = this.ss.maxMatches; + const header = this.header; + this.header = {}; + this.buffer = ""; + this.finished = true; + this.nread = this.npairs = 0; + this.maxed = false; + this.emit("header", header); + }; + HeaderParser.prototype._parseHeader = function() { + if (this.npairs === this.maxHeaderPairs) { + return; + } + const lines = this.buffer.split(RE_CRLF); + const len = lines.length; + let m3, h2; + for (var i2 = 0; i2 < len; ++i2) { + if (lines[i2].length === 0) { + continue; + } + if (lines[i2][0] === " " || lines[i2][0] === " ") { + if (h2) { + this.header[h2][this.header[h2].length - 1] += lines[i2]; + continue; } } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + const posColon = lines[i2].indexOf(":"); + if (posColon === -1 || posColon === 0) { + return; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + m3 = RE_HDR.exec(lines[i2]); + h2 = m3[1].toLowerCase(); + this.header[h2] = this.header[h2] || []; + this.header[h2].push(m3[2] || ""); + if (++this.npairs === this.maxHeaderPairs) { + break; + } + } + }; + module.exports = HeaderParser; + } +}); + +// node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js +var require_Dicer = __commonJS({ + "node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js"(exports, module) { + "use strict"; + var WritableStream = __require("node:stream").Writable; + var inherits = __require("node:util").inherits; + var StreamSearch = require_sbmh(); + var PartStream = require_PartStream(); + var HeaderParser = require_HeaderParser(); + var DASH = 45; + var B_ONEDASH = Buffer.from("-"); + var B_CRLF = Buffer.from("\r\n"); + var EMPTY_FN = function() { + }; + function Dicer(cfg) { + if (!(this instanceof Dicer)) { + return new Dicer(cfg); + } + WritableStream.call(this, cfg); + if (!cfg || !cfg.headerFirst && typeof cfg.boundary !== "string") { + throw new TypeError("Boundary required"); + } + if (typeof cfg.boundary === "string") { + this.setBoundary(cfg.boundary); + } else { + this._bparser = void 0; + } + this._headerFirst = cfg.headerFirst; + this._dashes = 0; + this._parts = 0; + this._finished = false; + this._realFinish = false; + this._isPreamble = true; + this._justMatched = false; + this._firstWrite = true; + this._inHeader = true; + this._part = void 0; + this._cb = void 0; + this._ignoreData = false; + this._partOpts = { highWaterMark: cfg.partHwm }; + this._pause = false; + const self2 = this; + this._hparser = new HeaderParser(cfg); + this._hparser.on("header", function(header) { + self2._inHeader = false; + self2._part.emit("header", header); }); + } + inherits(Dicer, WritableStream); + Dicer.prototype.emit = function(ev) { + if (ev === "finish" && !this._realFinish) { + if (!this._finished) { + const self2 = this; + process.nextTick(function() { + self2.emit("error", new Error("Unexpected end of multipart data")); + if (self2._part && !self2._ignoreData) { + const type3 = self2._isPreamble ? "Preamble" : "Part"; + self2._part.emit("error", new Error(type3 + " terminated early due to unexpected end of multipart data")); + self2._part.push(null); + process.nextTick(function() { + self2._realFinish = true; + self2.emit("finish"); + self2._realFinish = false; + }); + return; + } + self2._realFinish = true; + self2.emit("finish"); + self2._realFinish = false; + }); + } + } else { + WritableStream.prototype.emit.apply(this, arguments); + } }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.OidcClient = void 0; - var http_client_1 = require_lib(); - var auth_1 = require_auth(); - var core_1 = require_core(); - var OidcClient = class _OidcClient { - static createHttpClient(allowRetry = true, maxRetry = 10) { - const requestOptions = { - allowRetries: allowRetry, - maxRetries: maxRetry - }; - return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(_OidcClient.getRequestToken())], requestOptions); + Dicer.prototype._write = function(data, encoding, cb) { + if (!this._hparser && !this._bparser) { + return cb(); } - static getRequestToken() { - const token = process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"]; - if (!token) { - throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable"); + if (this._headerFirst && this._isPreamble) { + if (!this._part) { + this._part = new PartStream(this._partOpts); + if (this._events.preamble) { + this.emit("preamble", this._part); + } else { + this._ignore(); + } + } + const r2 = this._hparser.push(data); + if (!this._inHeader && r2 !== void 0 && r2 < data.length) { + data = data.slice(r2); + } else { + return cb(); } - return token; } - static getIDTokenUrl() { - const runtimeUrl = process.env["ACTIONS_ID_TOKEN_REQUEST_URL"]; - if (!runtimeUrl) { - throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable"); + if (this._firstWrite) { + this._bparser.push(B_CRLF); + this._firstWrite = false; + } + this._bparser.push(data); + if (this._pause) { + this._cb = cb; + } else { + cb(); + } + }; + Dicer.prototype.reset = function() { + this._part = void 0; + this._bparser = void 0; + this._hparser = void 0; + }; + Dicer.prototype.setBoundary = function(boundary) { + const self2 = this; + this._bparser = new StreamSearch("\r\n--" + boundary); + this._bparser.on("info", function(isMatch, data, start, end) { + self2._oninfo(isMatch, data, start, end); + }); + }; + Dicer.prototype._ignore = function() { + if (this._part && !this._ignoreData) { + this._ignoreData = true; + this._part.on("error", EMPTY_FN); + this._part.resume(); + } + }; + Dicer.prototype._oninfo = function(isMatch, data, start, end) { + let buf; + const self2 = this; + let i2 = 0; + let r2; + let shouldWriteMore = true; + if (!this._part && this._justMatched && data) { + while (this._dashes < 2 && start + i2 < end) { + if (data[start + i2] === DASH) { + ++i2; + ++this._dashes; + } else { + if (this._dashes) { + buf = B_ONEDASH; + } + this._dashes = 0; + break; + } + } + if (this._dashes === 2) { + if (start + i2 < end && this._events.trailer) { + this.emit("trailer", data.slice(start + i2, end)); + } + this.reset(); + this._finished = true; + if (self2._parts === 0) { + self2._realFinish = true; + self2.emit("finish"); + self2._realFinish = false; + } + } + if (this._dashes) { + return; } - return runtimeUrl; } - static getCall(id_token_url) { - var _a2; - return __awaiter(this, void 0, void 0, function* () { - const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error) => { - throw new Error(`Failed to get ID Token. - - Error Code : ${error.statusCode} - - Error Message: ${error.message}`); - }); - const id_token = (_a2 = res.result) === null || _a2 === void 0 ? void 0 : _a2.value; - if (!id_token) { - throw new Error("Response json body do not have ID Token field"); + if (this._justMatched) { + this._justMatched = false; + } + if (!this._part) { + this._part = new PartStream(this._partOpts); + this._part._read = function(n2) { + self2._unpause(); + }; + if (this._isPreamble && this._events.preamble) { + this.emit("preamble", this._part); + } else if (this._isPreamble !== true && this._events.part) { + this.emit("part", this._part); + } else { + this._ignore(); + } + if (!this._isPreamble) { + this._inHeader = true; + } + } + if (data && start < end && !this._ignoreData) { + if (this._isPreamble || !this._inHeader) { + if (buf) { + shouldWriteMore = this._part.push(buf); } - return id_token; - }); + shouldWriteMore = this._part.push(data.slice(start, end)); + if (!shouldWriteMore) { + this._pause = true; + } + } else if (!this._isPreamble && this._inHeader) { + if (buf) { + this._hparser.push(buf); + } + r2 = this._hparser.push(data.slice(start, end)); + if (!this._inHeader && r2 !== void 0 && r2 < end) { + this._oninfo(false, data, start + r2, end); + } + } } - static getIDToken(audience) { - return __awaiter(this, void 0, void 0, function* () { - try { - let id_token_url = _OidcClient.getIDTokenUrl(); - if (audience) { - const encodedAudience = encodeURIComponent(audience); - id_token_url = `${id_token_url}&audience=${encodedAudience}`; - } - core_1.debug(`ID token url is ${id_token_url}`); - const id_token = yield _OidcClient.getCall(id_token_url); - core_1.setSecret(id_token); - return id_token; - } catch (error) { - throw new Error(`Error message: ${error.message}`); + if (isMatch) { + this._hparser.reset(); + if (this._isPreamble) { + this._isPreamble = false; + } else { + if (start !== end) { + ++this._parts; + this._part.on("end", function() { + if (--self2._parts === 0) { + if (self2._finished) { + self2._realFinish = true; + self2.emit("finish"); + self2._realFinish = false; + } else { + self2._unpause(); + } + } + }); } - }); + } + this._part.push(null); + this._part = void 0; + this._ignoreData = false; + this._justMatched = true; + this._dashes = 0; } }; - exports.OidcClient = OidcClient; + Dicer.prototype._unpause = function() { + if (!this._pause) { + return; + } + this._pause = false; + if (this._cb) { + const cb = this._cb; + this._cb = void 0; + cb(); + } + }; + module.exports = Dicer; } }); -// node_modules/@actions/core/lib/summary.js -var require_summary = __commonJS({ - "node_modules/@actions/core/lib/summary.js"(exports) { +// node_modules/@fastify/busboy/lib/utils/decodeText.js +var require_decodeText = __commonJS({ + "node_modules/@fastify/busboy/lib/utils/decodeText.js"(exports, module) { "use strict"; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve2) { - resolve2(value); - }); - } - return new (P2 || (P2 = Promise))(function(resolve2, reject) { - function fulfilled(value) { + var utf8Decoder = new TextDecoder("utf-8"); + var textDecoders = /* @__PURE__ */ new Map([ + ["utf-8", utf8Decoder], + ["utf8", utf8Decoder] + ]); + function decodeText(text, textEncoding, destEncoding) { + if (text) { + if (textDecoders.has(destEncoding)) { try { - step(generator.next(value)); + return textDecoders.get(destEncoding).decode(Buffer.from(text, textEncoding)); } catch (e2) { - reject(e2); } - } - function rejected(value) { + } else { try { - step(generator["throw"](value)); + textDecoders.set(destEncoding, new TextDecoder(destEncoding)); + return textDecoders.get(destEncoding).decode(Buffer.from(text, textEncoding)); } catch (e2) { - reject(e2); } } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; - var os_1 = __require("os"); - var fs_1 = __require("fs"); - var { access: access2, appendFile, writeFile: writeFile3 } = fs_1.promises; - exports.SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; - exports.SUMMARY_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary"; - var Summary = class { - constructor() { - this._buffer = ""; } - /** - * Finds the summary file path from the environment, rejects if env var is not found or file does not exist - * Also checks r/w permissions. - * - * @returns step summary file path - */ - filePath() { - return __awaiter(this, void 0, void 0, function* () { - if (this._filePath) { - return this._filePath; + return text; + } + module.exports = decodeText; + } +}); + +// node_modules/@fastify/busboy/lib/utils/parseParams.js +var require_parseParams = __commonJS({ + "node_modules/@fastify/busboy/lib/utils/parseParams.js"(exports, module) { + "use strict"; + var decodeText = require_decodeText(); + var RE_ENCODED = /%([a-fA-F0-9]{2})/g; + function encodedReplacer(match, byte) { + return String.fromCharCode(parseInt(byte, 16)); + } + function parseParams(str) { + const res = []; + let state = "key"; + let charset = ""; + let inquote = false; + let escaping = false; + let p2 = 0; + let tmp = ""; + for (var i2 = 0, len = str.length; i2 < len; ++i2) { + const char = str[i2]; + if (char === "\\" && inquote) { + if (escaping) { + escaping = false; + } else { + escaping = true; + continue; } - const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR]; - if (!pathFromEnv) { - throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); + } else if (char === '"') { + if (!escaping) { + if (inquote) { + inquote = false; + state = "key"; + } else { + inquote = true; + } + continue; + } else { + escaping = false; } - try { - yield access2(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); - } catch (_a2) { - throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } else { + if (escaping && inquote) { + tmp += "\\"; } - this._filePath = pathFromEnv; - return this._filePath; - }); + escaping = false; + if ((state === "charset" || state === "lang") && char === "'") { + if (state === "charset") { + state = "lang"; + charset = tmp.substring(1); + } else { + state = "value"; + } + tmp = ""; + continue; + } else if (state === "key" && (char === "*" || char === "=") && res.length) { + if (char === "*") { + state = "charset"; + } else { + state = "value"; + } + res[p2] = [tmp, void 0]; + tmp = ""; + continue; + } else if (!inquote && char === ";") { + state = "key"; + if (charset) { + if (tmp.length) { + tmp = decodeText( + tmp.replace(RE_ENCODED, encodedReplacer), + "binary", + charset + ); + } + charset = ""; + } else if (tmp.length) { + tmp = decodeText(tmp, "binary", "utf8"); + } + if (res[p2] === void 0) { + res[p2] = tmp; + } else { + res[p2][1] = tmp; + } + tmp = ""; + ++p2; + continue; + } else if (!inquote && (char === " " || char === " ")) { + continue; + } + } + tmp += char; } - /** - * Wraps content in an HTML tag, adding any HTML attributes - * - * @param {string} tag HTML tag to wrap - * @param {string | null} content content within the tag - * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add - * - * @returns {string} content wrapped in HTML element - */ - wrap(tag, content, attrs = {}) { - const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join(""); - if (!content) { - return `<${tag}${htmlAttrs}>`; - } - return `<${tag}${htmlAttrs}>${content}`; + if (charset && tmp.length) { + tmp = decodeText( + tmp.replace(RE_ENCODED, encodedReplacer), + "binary", + charset + ); + } else if (tmp) { + tmp = decodeText(tmp, "binary", "utf8"); } - /** - * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. - * - * @param {SummaryWriteOptions} [options] (optional) options for write operation - * - * @returns {Promise} summary instance - */ - write(options) { - return __awaiter(this, void 0, void 0, function* () { - const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); - const filePath = yield this.filePath(); - const writeFunc = overwrite ? writeFile3 : appendFile; - yield writeFunc(filePath, this._buffer, { encoding: "utf8" }); - return this.emptyBuffer(); - }); + if (res[p2] === void 0) { + if (tmp) { + res[p2] = tmp; + } + } else { + res[p2][1] = tmp; } - /** - * Clears the summary buffer and wipes the summary file - * - * @returns {Summary} summary instance - */ - clear() { - return __awaiter(this, void 0, void 0, function* () { - return this.emptyBuffer().write({ overwrite: true }); - }); + return res; + } + module.exports = parseParams; + } +}); + +// node_modules/@fastify/busboy/lib/utils/basename.js +var require_basename = __commonJS({ + "node_modules/@fastify/busboy/lib/utils/basename.js"(exports, module) { + "use strict"; + module.exports = function basename(path14) { + if (typeof path14 !== "string") { + return ""; } - /** - * Returns the current summary buffer as a string - * - * @returns {string} string of summary buffer - */ - stringify() { - return this._buffer; + for (var i2 = path14.length - 1; i2 >= 0; --i2) { + switch (path14.charCodeAt(i2)) { + case 47: + case 92: + path14 = path14.slice(i2 + 1); + return path14 === ".." || path14 === "." ? "" : path14; + } } - /** - * If the summary buffer is empty - * - * @returns {boolen} true if the buffer is empty - */ - isEmptyBuffer() { - return this._buffer.length === 0; + return path14 === ".." || path14 === "." ? "" : path14; + }; + } +}); + +// node_modules/@fastify/busboy/lib/types/multipart.js +var require_multipart = __commonJS({ + "node_modules/@fastify/busboy/lib/types/multipart.js"(exports, module) { + "use strict"; + var { Readable: Readable5 } = __require("node:stream"); + var { inherits } = __require("node:util"); + var Dicer = require_Dicer(); + var parseParams = require_parseParams(); + var decodeText = require_decodeText(); + var basename = require_basename(); + var getLimit = require_getLimit(); + var RE_BOUNDARY = /^boundary$/i; + var RE_FIELD = /^form-data$/i; + var RE_CHARSET = /^charset$/i; + var RE_FILENAME = /^filename$/i; + var RE_NAME = /^name$/i; + Multipart.detect = /^multipart\/form-data/i; + function Multipart(boy, cfg) { + let i2; + let len; + const self2 = this; + let boundary; + const limits = cfg.limits; + const isPartAFile = cfg.isPartAFile || ((fieldName, contentType2, fileName) => contentType2 === "application/octet-stream" || fileName !== void 0); + const parsedConType = cfg.parsedConType || []; + const defCharset = cfg.defCharset || "utf8"; + const preservePath = cfg.preservePath; + const fileOpts = { highWaterMark: cfg.fileHwm }; + for (i2 = 0, len = parsedConType.length; i2 < len; ++i2) { + if (Array.isArray(parsedConType[i2]) && RE_BOUNDARY.test(parsedConType[i2][0])) { + boundary = parsedConType[i2][1]; + break; + } } - /** - * Resets the summary buffer without writing to summary file - * - * @returns {Summary} summary instance - */ - emptyBuffer() { - this._buffer = ""; - return this; + function checkFinished() { + if (nends === 0 && finished && !boy._done) { + finished = false; + self2.end(); + } + } + if (typeof boundary !== "string") { + throw new Error("Multipart: Boundary not found"); + } + const fieldSizeLimit = getLimit(limits, "fieldSize", 1 * 1024 * 1024); + const fileSizeLimit = getLimit(limits, "fileSize", Infinity); + const filesLimit = getLimit(limits, "files", Infinity); + const fieldsLimit = getLimit(limits, "fields", Infinity); + const partsLimit = getLimit(limits, "parts", Infinity); + const headerPairsLimit = getLimit(limits, "headerPairs", 2e3); + const headerSizeLimit = getLimit(limits, "headerSize", 80 * 1024); + let nfiles = 0; + let nfields = 0; + let nends = 0; + let curFile; + let curField; + let finished = false; + this._needDrain = false; + this._pause = false; + this._cb = void 0; + this._nparts = 0; + this._boy = boy; + const parserCfg = { + boundary, + maxHeaderPairs: headerPairsLimit, + maxHeaderSize: headerSizeLimit, + partHwm: fileOpts.highWaterMark, + highWaterMark: cfg.highWaterMark + }; + this.parser = new Dicer(parserCfg); + this.parser.on("drain", function() { + self2._needDrain = false; + if (self2._cb && !self2._pause) { + const cb = self2._cb; + self2._cb = void 0; + cb(); + } + }).on("part", function onPart(part) { + if (++self2._nparts > partsLimit) { + self2.parser.removeListener("part", onPart); + self2.parser.on("part", skipPart); + boy.hitPartsLimit = true; + boy.emit("partsLimit"); + return skipPart(part); + } + if (curField) { + const field = curField; + field.emit("end"); + field.removeAllListeners("end"); + } + part.on("header", function(header) { + let contype; + let fieldname; + let parsed; + let charset; + let encoding; + let filename; + let nsize = 0; + if (header["content-type"]) { + parsed = parseParams(header["content-type"][0]); + if (parsed[0]) { + contype = parsed[0].toLowerCase(); + for (i2 = 0, len = parsed.length; i2 < len; ++i2) { + if (RE_CHARSET.test(parsed[i2][0])) { + charset = parsed[i2][1].toLowerCase(); + break; + } + } + } + } + if (contype === void 0) { + contype = "text/plain"; + } + if (charset === void 0) { + charset = defCharset; + } + if (header["content-disposition"]) { + parsed = parseParams(header["content-disposition"][0]); + if (!RE_FIELD.test(parsed[0])) { + return skipPart(part); + } + for (i2 = 0, len = parsed.length; i2 < len; ++i2) { + if (RE_NAME.test(parsed[i2][0])) { + fieldname = parsed[i2][1]; + } else if (RE_FILENAME.test(parsed[i2][0])) { + filename = parsed[i2][1]; + if (!preservePath) { + filename = basename(filename); + } + } + } + } else { + return skipPart(part); + } + if (header["content-transfer-encoding"]) { + encoding = header["content-transfer-encoding"][0].toLowerCase(); + } else { + encoding = "7bit"; + } + let onData, onEnd; + if (isPartAFile(fieldname, contype, filename)) { + if (nfiles === filesLimit) { + if (!boy.hitFilesLimit) { + boy.hitFilesLimit = true; + boy.emit("filesLimit"); + } + return skipPart(part); + } + ++nfiles; + if (!boy._events.file) { + self2.parser._ignore(); + return; + } + ++nends; + const file = new FileStream(fileOpts); + curFile = file; + file.on("end", function() { + --nends; + self2._pause = false; + checkFinished(); + if (self2._cb && !self2._needDrain) { + const cb = self2._cb; + self2._cb = void 0; + cb(); + } + }); + file._read = function(n2) { + if (!self2._pause) { + return; + } + self2._pause = false; + if (self2._cb && !self2._needDrain) { + const cb = self2._cb; + self2._cb = void 0; + cb(); + } + }; + boy.emit("file", fieldname, file, filename, encoding, contype); + onData = function(data) { + if ((nsize += data.length) > fileSizeLimit) { + const extralen = fileSizeLimit - nsize + data.length; + if (extralen > 0) { + file.push(data.slice(0, extralen)); + } + file.truncated = true; + file.bytesRead = fileSizeLimit; + part.removeAllListeners("data"); + file.emit("limit"); + return; + } else if (!file.push(data)) { + self2._pause = true; + } + file.bytesRead = nsize; + }; + onEnd = function() { + curFile = void 0; + file.push(null); + }; + } else { + if (nfields === fieldsLimit) { + if (!boy.hitFieldsLimit) { + boy.hitFieldsLimit = true; + boy.emit("fieldsLimit"); + } + return skipPart(part); + } + ++nfields; + ++nends; + let buffer = ""; + let truncated = false; + curField = part; + onData = function(data) { + if ((nsize += data.length) > fieldSizeLimit) { + const extralen = fieldSizeLimit - (nsize - data.length); + buffer += data.toString("binary", 0, extralen); + truncated = true; + part.removeAllListeners("data"); + } else { + buffer += data.toString("binary"); + } + }; + onEnd = function() { + curField = void 0; + if (buffer.length) { + buffer = decodeText(buffer, "binary", charset); + } + boy.emit("field", fieldname, buffer, false, truncated, encoding, contype); + --nends; + checkFinished(); + }; + } + part._readableState.sync = false; + part.on("data", onData); + part.on("end", onEnd); + }).on("error", function(err) { + if (curFile) { + curFile.emit("error", err); + } + }); + }).on("error", function(err) { + boy.emit("error", err); + }).on("finish", function() { + finished = true; + checkFinished(); + }); + } + Multipart.prototype.write = function(chunk, cb) { + const r2 = this.parser.write(chunk); + if (r2 && !this._pause) { + cb(); + } else { + this._needDrain = !r2; + this._cb = cb; } - /** - * Adds raw text to the summary buffer - * - * @param {string} text content to add - * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) - * - * @returns {Summary} summary instance - */ - addRaw(text, addEOL = false) { - this._buffer += text; - return addEOL ? this.addEOL() : this; + }; + Multipart.prototype.end = function() { + const self2 = this; + if (self2.parser.writable) { + self2.parser.end(); + } else if (!self2._boy._done) { + process.nextTick(function() { + self2._boy._done = true; + self2._boy.emit("finish"); + }); } - /** - * Adds the operating system-specific end-of-line marker to the buffer - * - * @returns {Summary} summary instance - */ - addEOL() { - return this.addRaw(os_1.EOL); + }; + function skipPart(part) { + part.resume(); + } + function FileStream(opts) { + Readable5.call(this, opts); + this.bytesRead = 0; + this.truncated = false; + } + inherits(FileStream, Readable5); + FileStream.prototype._read = function(n2) { + }; + module.exports = Multipart; + } +}); + +// node_modules/@fastify/busboy/lib/utils/Decoder.js +var require_Decoder = __commonJS({ + "node_modules/@fastify/busboy/lib/utils/Decoder.js"(exports, module) { + "use strict"; + var RE_PLUS = /\+/g; + var HEX = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ]; + function Decoder() { + this.buffer = void 0; + } + Decoder.prototype.write = function(str) { + str = str.replace(RE_PLUS, " "); + let res = ""; + let i2 = 0; + let p2 = 0; + const len = str.length; + for (; i2 < len; ++i2) { + if (this.buffer !== void 0) { + if (!HEX[str.charCodeAt(i2)]) { + res += "%" + this.buffer; + this.buffer = void 0; + --i2; + } else { + this.buffer += str[i2]; + ++p2; + if (this.buffer.length === 2) { + res += String.fromCharCode(parseInt(this.buffer, 16)); + this.buffer = void 0; + } + } + } else if (str[i2] === "%") { + if (i2 > p2) { + res += str.substring(p2, i2); + p2 = i2; + } + this.buffer = ""; + ++p2; + } } - /** - * Adds an HTML codeblock to the summary buffer - * - * @param {string} code content to render within fenced code block - * @param {string} lang (optional) language to syntax highlight code - * - * @returns {Summary} summary instance - */ - addCodeBlock(code, lang) { - const attrs = Object.assign({}, lang && { lang }); - const element = this.wrap("pre", this.wrap("code", code), attrs); - return this.addRaw(element).addEOL(); + if (p2 < len && this.buffer === void 0) { + res += str.substring(p2); } - /** - * Adds an HTML list to the summary buffer - * - * @param {string[]} items list of items to render - * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) - * - * @returns {Summary} summary instance - */ - addList(items, ordered = false) { - const tag = ordered ? "ol" : "ul"; - const listItems = items.map((item) => this.wrap("li", item)).join(""); - const element = this.wrap(tag, listItems); - return this.addRaw(element).addEOL(); + return res; + }; + Decoder.prototype.reset = function() { + this.buffer = void 0; + }; + module.exports = Decoder; + } +}); + +// node_modules/@fastify/busboy/lib/types/urlencoded.js +var require_urlencoded = __commonJS({ + "node_modules/@fastify/busboy/lib/types/urlencoded.js"(exports, module) { + "use strict"; + var Decoder = require_Decoder(); + var decodeText = require_decodeText(); + var getLimit = require_getLimit(); + var RE_CHARSET = /^charset$/i; + UrlEncoded.detect = /^application\/x-www-form-urlencoded/i; + function UrlEncoded(boy, cfg) { + const limits = cfg.limits; + const parsedConType = cfg.parsedConType; + this.boy = boy; + this.fieldSizeLimit = getLimit(limits, "fieldSize", 1 * 1024 * 1024); + this.fieldNameSizeLimit = getLimit(limits, "fieldNameSize", 100); + this.fieldsLimit = getLimit(limits, "fields", Infinity); + let charset; + for (var i2 = 0, len = parsedConType.length; i2 < len; ++i2) { + if (Array.isArray(parsedConType[i2]) && RE_CHARSET.test(parsedConType[i2][0])) { + charset = parsedConType[i2][1].toLowerCase(); + break; + } } - /** - * Adds an HTML table to the summary buffer - * - * @param {SummaryTableCell[]} rows table rows - * - * @returns {Summary} summary instance - */ - addTable(rows) { - const tableBody = rows.map((row) => { - const cells = row.map((cell) => { - if (typeof cell === "string") { - return this.wrap("td", cell); + if (charset === void 0) { + charset = cfg.defCharset || "utf8"; + } + this.decoder = new Decoder(); + this.charset = charset; + this._fields = 0; + this._state = "key"; + this._checkingBytes = true; + this._bytesKey = 0; + this._bytesVal = 0; + this._key = ""; + this._val = ""; + this._keyTrunc = false; + this._valTrunc = false; + this._hitLimit = false; + } + UrlEncoded.prototype.write = function(data, cb) { + if (this._fields === this.fieldsLimit) { + if (!this.boy.hitFieldsLimit) { + this.boy.hitFieldsLimit = true; + this.boy.emit("fieldsLimit"); + } + return cb(); + } + let idxeq; + let idxamp; + let i2; + let p2 = 0; + const len = data.length; + while (p2 < len) { + if (this._state === "key") { + idxeq = idxamp = void 0; + for (i2 = p2; i2 < len; ++i2) { + if (!this._checkingBytes) { + ++p2; + } + if (data[i2] === 61) { + idxeq = i2; + break; + } else if (data[i2] === 38) { + idxamp = i2; + break; } - const { header, data, colspan, rowspan } = cell; - const tag = header ? "th" : "td"; - const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); - return this.wrap(tag, data, attrs); - }).join(""); - return this.wrap("tr", cells); - }).join(""); - const element = this.wrap("table", tableBody); - return this.addRaw(element).addEOL(); - } - /** - * Adds a collapsable HTML details element to the summary buffer - * - * @param {string} label text for the closed state - * @param {string} content collapsable content - * - * @returns {Summary} summary instance - */ - addDetails(label, content) { - const element = this.wrap("details", this.wrap("summary", label) + content); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML image tag to the summary buffer - * - * @param {string} src path to the image you to embed - * @param {string} alt text description of the image - * @param {SummaryImageOptions} options (optional) addition image attributes - * - * @returns {Summary} summary instance - */ - addImage(src, alt, options) { - const { width, height } = options || {}; - const attrs = Object.assign(Object.assign({}, width && { width }), height && { height }); - const element = this.wrap("img", null, Object.assign({ src, alt }, attrs)); - return this.addRaw(element).addEOL(); + if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) { + this._hitLimit = true; + break; + } else if (this._checkingBytes) { + ++this._bytesKey; + } + } + if (idxeq !== void 0) { + if (idxeq > p2) { + this._key += this.decoder.write(data.toString("binary", p2, idxeq)); + } + this._state = "val"; + this._hitLimit = false; + this._checkingBytes = true; + this._val = ""; + this._bytesVal = 0; + this._valTrunc = false; + this.decoder.reset(); + p2 = idxeq + 1; + } else if (idxamp !== void 0) { + ++this._fields; + let key; + const keyTrunc = this._keyTrunc; + if (idxamp > p2) { + key = this._key += this.decoder.write(data.toString("binary", p2, idxamp)); + } else { + key = this._key; + } + this._hitLimit = false; + this._checkingBytes = true; + this._key = ""; + this._bytesKey = 0; + this._keyTrunc = false; + this.decoder.reset(); + if (key.length) { + this.boy.emit( + "field", + decodeText(key, "binary", this.charset), + "", + keyTrunc, + false + ); + } + p2 = idxamp + 1; + if (this._fields === this.fieldsLimit) { + return cb(); + } + } else if (this._hitLimit) { + if (i2 > p2) { + this._key += this.decoder.write(data.toString("binary", p2, i2)); + } + p2 = i2; + if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) { + this._checkingBytes = false; + this._keyTrunc = true; + } + } else { + if (p2 < len) { + this._key += this.decoder.write(data.toString("binary", p2)); + } + p2 = len; + } + } else { + idxamp = void 0; + for (i2 = p2; i2 < len; ++i2) { + if (!this._checkingBytes) { + ++p2; + } + if (data[i2] === 38) { + idxamp = i2; + break; + } + if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) { + this._hitLimit = true; + break; + } else if (this._checkingBytes) { + ++this._bytesVal; + } + } + if (idxamp !== void 0) { + ++this._fields; + if (idxamp > p2) { + this._val += this.decoder.write(data.toString("binary", p2, idxamp)); + } + this.boy.emit( + "field", + decodeText(this._key, "binary", this.charset), + decodeText(this._val, "binary", this.charset), + this._keyTrunc, + this._valTrunc + ); + this._state = "key"; + this._hitLimit = false; + this._checkingBytes = true; + this._key = ""; + this._bytesKey = 0; + this._keyTrunc = false; + this.decoder.reset(); + p2 = idxamp + 1; + if (this._fields === this.fieldsLimit) { + return cb(); + } + } else if (this._hitLimit) { + if (i2 > p2) { + this._val += this.decoder.write(data.toString("binary", p2, i2)); + } + p2 = i2; + if (this._val === "" && this.fieldSizeLimit === 0 || (this._bytesVal = this._val.length) === this.fieldSizeLimit) { + this._checkingBytes = false; + this._valTrunc = true; + } + } else { + if (p2 < len) { + this._val += this.decoder.write(data.toString("binary", p2)); + } + p2 = len; + } + } } - /** - * Adds an HTML section heading element - * - * @param {string} text heading text - * @param {number | string} [level=1] (optional) the heading level, default: 1 - * - * @returns {Summary} summary instance - */ - addHeading(text, level) { - const tag = `h${level}`; - const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag) ? tag : "h1"; - const element = this.wrap(allowedTag, text); - return this.addRaw(element).addEOL(); + cb(); + }; + UrlEncoded.prototype.end = function() { + if (this.boy._done) { + return; } - /** - * Adds an HTML thematic break (
) to the summary buffer - * - * @returns {Summary} summary instance - */ - addSeparator() { - const element = this.wrap("hr", null); - return this.addRaw(element).addEOL(); + if (this._state === "key" && this._key.length > 0) { + this.boy.emit( + "field", + decodeText(this._key, "binary", this.charset), + "", + this._keyTrunc, + false + ); + } else if (this._state === "val") { + this.boy.emit( + "field", + decodeText(this._key, "binary", this.charset), + decodeText(this._val, "binary", this.charset), + this._keyTrunc, + this._valTrunc + ); } - /** - * Adds an HTML line break (
) to the summary buffer - * - * @returns {Summary} summary instance - */ - addBreak() { - const element = this.wrap("br", null); - return this.addRaw(element).addEOL(); + this.boy._done = true; + this.boy.emit("finish"); + }; + module.exports = UrlEncoded; + } +}); + +// node_modules/@fastify/busboy/lib/main.js +var require_main = __commonJS({ + "node_modules/@fastify/busboy/lib/main.js"(exports, module) { + "use strict"; + var WritableStream = __require("node:stream").Writable; + var { inherits } = __require("node:util"); + var Dicer = require_Dicer(); + var MultipartParser = require_multipart(); + var UrlencodedParser = require_urlencoded(); + var parseParams = require_parseParams(); + function Busboy(opts) { + if (!(this instanceof Busboy)) { + return new Busboy(opts); + } + if (typeof opts !== "object") { + throw new TypeError("Busboy expected an options-Object."); + } + if (typeof opts.headers !== "object") { + throw new TypeError("Busboy expected an options-Object with headers-attribute."); + } + if (typeof opts.headers["content-type"] !== "string") { + throw new TypeError("Missing Content-Type-header."); + } + const { + headers, + ...streamOptions + } = opts; + this.opts = { + autoDestroy: false, + ...streamOptions + }; + WritableStream.call(this, this.opts); + this._done = false; + this._parser = this.getParserByHeaders(headers); + this._finished = false; + } + inherits(Busboy, WritableStream); + Busboy.prototype.emit = function(ev) { + if (ev === "finish") { + if (!this._done) { + this._parser?.end(); + return; + } else if (this._finished) { + return; + } + this._finished = true; } - /** - * Adds an HTML blockquote to the summary buffer - * - * @param {string} text quote text - * @param {string} cite (optional) citation url - * - * @returns {Summary} summary instance - */ - addQuote(text, cite) { - const attrs = Object.assign({}, cite && { cite }); - const element = this.wrap("blockquote", text, attrs); - return this.addRaw(element).addEOL(); + WritableStream.prototype.emit.apply(this, arguments); + }; + Busboy.prototype.getParserByHeaders = function(headers) { + const parsed = parseParams(headers["content-type"]); + const cfg = { + defCharset: this.opts.defCharset, + fileHwm: this.opts.fileHwm, + headers, + highWaterMark: this.opts.highWaterMark, + isPartAFile: this.opts.isPartAFile, + limits: this.opts.limits, + parsedConType: parsed, + preservePath: this.opts.preservePath + }; + if (MultipartParser.detect.test(parsed[0])) { + return new MultipartParser(this, cfg); } - /** - * Adds an HTML anchor tag to the summary buffer - * - * @param {string} text link text/content - * @param {string} href hyperlink - * - * @returns {Summary} summary instance - */ - addLink(text, href) { - const element = this.wrap("a", text, { href }); - return this.addRaw(element).addEOL(); + if (UrlencodedParser.detect.test(parsed[0])) { + return new UrlencodedParser(this, cfg); } + throw new Error("Unsupported Content-Type."); }; - var _summary = new Summary(); - exports.markdownSummary = _summary; - exports.summary = _summary; + Busboy.prototype._write = function(chunk, encoding, cb) { + this._parser.write(chunk, cb); + }; + module.exports = Busboy; + module.exports.default = Busboy; + module.exports.Busboy = Busboy; + module.exports.Dicer = Dicer; } }); -// node_modules/@actions/core/lib/path-utils.js -var require_path_utils = __commonJS({ - "node_modules/@actions/core/lib/path-utils.js"(exports) { +// node_modules/undici/lib/fetch/constants.js +var require_constants = __commonJS({ + "node_modules/undici/lib/fetch/constants.js"(exports, module) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - Object.defineProperty(o2, k22, { enumerable: true, get: function() { - return m3[k2]; - } }); - } : function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - o2[k22] = m3[k2]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { - Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); - } : function(o2, v2) { - o2["default"] = v2; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k2 in mod) - if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) - __createBinding(result, mod, k2); + var { MessageChannel, receiveMessageOnPort } = __require("worker_threads"); + var corsSafeListedMethods = ["GET", "HEAD", "POST"]; + var nullBodyStatus = [101, 204, 205, 304]; + var redirectStatus = [301, 302, 303, 307, 308]; + var badPorts = [ + "1", + "7", + "9", + "11", + "13", + "15", + "17", + "19", + "20", + "21", + "22", + "23", + "25", + "37", + "42", + "43", + "53", + "69", + "77", + "79", + "87", + "95", + "101", + "102", + "103", + "104", + "109", + "110", + "111", + "113", + "115", + "117", + "119", + "123", + "135", + "137", + "139", + "143", + "161", + "179", + "389", + "427", + "465", + "512", + "513", + "514", + "515", + "526", + "530", + "531", + "532", + "540", + "548", + "554", + "556", + "563", + "587", + "601", + "636", + "989", + "990", + "993", + "995", + "1719", + "1720", + "1723", + "2049", + "3659", + "4045", + "5060", + "5061", + "6000", + "6566", + "6665", + "6666", + "6667", + "6668", + "6669", + "6697", + "10080" + ]; + var referrerPolicy = [ + "", + "no-referrer", + "no-referrer-when-downgrade", + "same-origin", + "origin", + "strict-origin", + "origin-when-cross-origin", + "strict-origin-when-cross-origin", + "unsafe-url" + ]; + var requestRedirect = ["follow", "manual", "error"]; + var safeMethods = ["GET", "HEAD", "OPTIONS", "TRACE"]; + var requestMode = ["navigate", "same-origin", "no-cors", "cors"]; + var requestCredentials = ["omit", "same-origin", "include"]; + var requestCache = [ + "default", + "no-store", + "reload", + "no-cache", + "force-cache", + "only-if-cached" + ]; + var requestBodyHeader = [ + "content-encoding", + "content-language", + "content-location", + "content-type", + // See https://github.com/nodejs/undici/issues/2021 + // 'Content-Length' is a forbidden header name, which is typically + // removed in the Headers implementation. However, undici doesn't + // filter out headers, so we add it here. + "content-length" + ]; + var requestDuplex = [ + "half" + ]; + var forbiddenMethods = ["CONNECT", "TRACE", "TRACK"]; + var subresource = [ + "audio", + "audioworklet", + "font", + "image", + "manifest", + "paintworklet", + "script", + "style", + "track", + "video", + "xslt", + "" + ]; + var DOMException2 = globalThis.DOMException ?? (() => { + try { + atob("~"); + } catch (err) { + return Object.getPrototypeOf(err).constructor; } - __setModuleDefault(result, mod); - return result; + })(); + var channel; + var structuredClone = globalThis.structuredClone ?? // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js + // structuredClone was added in v17.0.0, but fetch supports v16.8 + function structuredClone2(value, options = void 0) { + if (arguments.length === 0) { + throw new TypeError("missing argument"); + } + if (!channel) { + channel = new MessageChannel(); + } + channel.port1.unref(); + channel.port2.unref(); + channel.port1.postMessage(value, options?.transfer); + return receiveMessageOnPort(channel.port2).message; + }; + module.exports = { + DOMException: DOMException2, + structuredClone, + subresource, + forbiddenMethods, + requestBodyHeader, + referrerPolicy, + requestRedirect, + requestMode, + requestCredentials, + requestCache, + redirectStatus, + corsSafeListedMethods, + nullBodyStatus, + safeMethods, + badPorts, + requestDuplex }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; - var path15 = __importStar(__require("path")); - function toPosixPath(pth) { - return pth.replace(/[\\]/g, "/"); - } - exports.toPosixPath = toPosixPath; - function toWin32Path(pth) { - return pth.replace(/[/]/g, "\\"); - } - exports.toWin32Path = toWin32Path; - function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path15.sep); - } - exports.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/core/lib/core.js"(exports) { +// node_modules/undici/lib/fetch/global.js +var require_global2 = __commonJS({ + "node_modules/undici/lib/fetch/global.js"(exports, module) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - Object.defineProperty(o2, k22, { enumerable: true, get: function() { - return m3[k2]; - } }); - } : function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - o2[k22] = m3[k2]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { - Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); - } : function(o2, v2) { - o2["default"] = v2; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k2 in mod) - if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) - __createBinding(result, mod, k2); - } - __setModuleDefault(result, mod); - return result; - }; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve2) { - resolve2(value); + var globalOrigin = Symbol.for("undici.globalOrigin.1"); + function getGlobalOrigin() { + return globalThis[globalOrigin]; + } + function setGlobalOrigin(newOrigin) { + if (newOrigin === void 0) { + Object.defineProperty(globalThis, globalOrigin, { + value: void 0, + writable: true, + enumerable: false, + configurable: false }); + return; } - return new (P2 || (P2 = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e2) { - reject(e2); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e2) { - reject(e2); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + const parsedURL = new URL(newOrigin); + if (parsedURL.protocol !== "http:" && parsedURL.protocol !== "https:") { + throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`); + } + Object.defineProperty(globalThis, globalOrigin, { + value: parsedURL, + writable: true, + enumerable: false, + configurable: false }); + } + module.exports = { + getGlobalOrigin, + setGlobalOrigin }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; - var command_1 = require_command(); - var file_command_1 = require_file_command(); - var utils_1 = require_utils(); - var os3 = __importStar(__require("os")); - var path15 = __importStar(__require("path")); - var oidc_utils_1 = require_oidc_utils(); - var ExitCode; - (function(ExitCode2) { - ExitCode2[ExitCode2["Success"] = 0] = "Success"; - ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; - })(ExitCode = exports.ExitCode || (exports.ExitCode = {})); - function exportVariable2(name2, val) { - const convertedVal = utils_1.toCommandValue(val); - process.env[name2] = convertedVal; - const filePath = process.env["GITHUB_ENV"] || ""; - if (filePath) { - return file_command_1.issueFileCommand("ENV", file_command_1.prepareKeyValueMessage(name2, val)); - } - command_1.issueCommand("set-env", { name: name2 }, convertedVal); + } +}); + +// node_modules/undici/lib/fetch/util.js +var require_util2 = __commonJS({ + "node_modules/undici/lib/fetch/util.js"(exports, module) { + "use strict"; + var { redirectStatus, badPorts, referrerPolicy: referrerPolicyTokens } = require_constants(); + var { getGlobalOrigin } = require_global2(); + var { performance: performance2 } = __require("perf_hooks"); + var { isBlobLike, toUSVString, ReadableStreamFrom } = require_util(); + var assert = __require("assert"); + var { isUint8Array } = __require("util/types"); + var crypto5; + try { + crypto5 = __require("crypto"); + } catch { } - exports.exportVariable = exportVariable2; - function setSecret(secret) { - command_1.issueCommand("add-mask", {}, secret); + function responseURL(response) { + const urlList = response.urlList; + const length = urlList.length; + return length === 0 ? null : urlList[length - 1].toString(); } - exports.setSecret = setSecret; - function addPath2(inputPath) { - const filePath = process.env["GITHUB_PATH"] || ""; - if (filePath) { - file_command_1.issueFileCommand("PATH", inputPath); - } else { - command_1.issueCommand("add-path", {}, inputPath); + function responseLocationURL(response, requestFragment) { + if (!redirectStatus.includes(response.status)) { + return null; } - process.env["PATH"] = `${inputPath}${path15.delimiter}${process.env["PATH"]}`; - } - exports.addPath = addPath2; - function getInput2(name2, options) { - const val = process.env[`INPUT_${name2.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val) { - throw new Error(`Input required and not supplied: ${name2}`); + let location = response.headersList.get("location"); + if (location !== null && isValidHeaderValue(location)) { + location = new URL(location, responseURL(response)); } - if (options && options.trimWhitespace === false) { - return val; + if (location && !location.hash) { + location.hash = requestFragment; } - return val.trim(); + return location; } - exports.getInput = getInput2; - function getMultilineInput(name2, options) { - const inputs = getInput2(name2, options).split("\n").filter((x2) => x2 !== ""); - if (options && options.trimWhitespace === false) { - return inputs; + function requestCurrentURL(request) { + return request.urlList[request.urlList.length - 1]; + } + function requestBadPort(request) { + const url2 = requestCurrentURL(request); + if (urlIsHttpHttpsScheme(url2) && badPorts.includes(url2.port)) { + return "blocked"; } - return inputs.map((input) => input.trim()); + return "allowed"; } - exports.getMultilineInput = getMultilineInput; - function getBooleanInput2(name2, options) { - const trueValue = ["true", "True", "TRUE"]; - const falseValue = ["false", "False", "FALSE"]; - const val = getInput2(name2, options); - if (trueValue.includes(val)) - return true; - if (falseValue.includes(val)) + function isErrorLike(object) { + return object instanceof Error || (object?.constructor?.name === "Error" || object?.constructor?.name === "DOMException"); + } + function isValidReasonPhrase(statusText) { + for (let i2 = 0; i2 < statusText.length; ++i2) { + const c2 = statusText.charCodeAt(i2); + if (!(c2 === 9 || // HTAB + c2 >= 32 && c2 <= 126 || // SP / VCHAR + c2 >= 128 && c2 <= 255)) { + return false; + } + } + return true; + } + function isTokenChar(c2) { + return !(c2 >= 127 || c2 <= 32 || c2 === "(" || c2 === ")" || c2 === "<" || c2 === ">" || c2 === "@" || c2 === "," || c2 === ";" || c2 === ":" || c2 === "\\" || c2 === '"' || c2 === "/" || c2 === "[" || c2 === "]" || c2 === "?" || c2 === "=" || c2 === "{" || c2 === "}"); + } + function isValidHTTPToken(characters) { + if (!characters || typeof characters !== "string") { return false; - throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name2} -Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); + } + for (let i2 = 0; i2 < characters.length; ++i2) { + const c2 = characters.charCodeAt(i2); + if (c2 > 127 || !isTokenChar(c2)) { + return false; + } + } + return true; } - exports.getBooleanInput = getBooleanInput2; - function setOutput3(name2, value) { - const filePath = process.env["GITHUB_OUTPUT"] || ""; - if (filePath) { - return file_command_1.issueFileCommand("OUTPUT", file_command_1.prepareKeyValueMessage(name2, value)); + function isValidHeaderName(potentialValue) { + if (potentialValue.length === 0) { + return false; } - process.stdout.write(os3.EOL); - command_1.issueCommand("set-output", { name: name2 }, utils_1.toCommandValue(value)); + return isValidHTTPToken(potentialValue); } - exports.setOutput = setOutput3; - function setCommandEcho(enabled2) { - command_1.issue("echo", enabled2 ? "on" : "off"); + function isValidHeaderValue(potentialValue) { + if (potentialValue.startsWith(" ") || potentialValue.startsWith(" ") || potentialValue.endsWith(" ") || potentialValue.endsWith(" ")) { + return false; + } + if (potentialValue.includes("\0") || potentialValue.includes("\r") || potentialValue.includes("\n")) { + return false; + } + return true; } - exports.setCommandEcho = setCommandEcho; - function setFailed2(message) { - process.exitCode = ExitCode.Failure; - error(message); + function setRequestReferrerPolicyOnRedirect(request, actualResponse) { + const { headersList } = actualResponse; + const policyHeader = (headersList.get("referrer-policy") ?? "").split(","); + let policy = ""; + if (policyHeader.length > 0) { + for (let i2 = policyHeader.length; i2 !== 0; i2--) { + const token = policyHeader[i2 - 1].trim(); + if (referrerPolicyTokens.includes(token)) { + policy = token; + break; + } + } + } + if (policy !== "") { + request.referrerPolicy = policy; + } } - exports.setFailed = setFailed2; - function isDebug2() { - return process.env["RUNNER_DEBUG"] === "1"; + function crossOriginResourcePolicyCheck() { + return "allowed"; } - exports.isDebug = isDebug2; - function debug3(message) { - command_1.issueCommand("debug", {}, message); + function corsCheck() { + return "success"; } - exports.debug = debug3; - function error(message, properties = {}) { - command_1.issueCommand("error", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + function TAOCheck() { + return "success"; } - exports.error = error; - function warning2(message, properties = {}) { - command_1.issueCommand("warning", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + function appendFetchMetadata(httpRequest) { + let header = null; + header = httpRequest.mode; + httpRequest.headersList.set("sec-fetch-mode", header); } - exports.warning = warning2; - function notice2(message, properties = {}) { - command_1.issueCommand("notice", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + function appendRequestOriginHeader(request) { + let serializedOrigin = request.origin; + if (request.responseTainting === "cors" || request.mode === "websocket") { + if (serializedOrigin) { + request.headersList.append("origin", serializedOrigin); + } + } else if (request.method !== "GET" && request.method !== "HEAD") { + switch (request.referrerPolicy) { + case "no-referrer": + serializedOrigin = null; + break; + case "no-referrer-when-downgrade": + case "strict-origin": + case "strict-origin-when-cross-origin": + if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) { + serializedOrigin = null; + } + break; + case "same-origin": + if (!sameOrigin(request, requestCurrentURL(request))) { + serializedOrigin = null; + } + break; + default: + } + if (serializedOrigin) { + request.headersList.append("origin", serializedOrigin); + } + } } - exports.notice = notice2; - function info3(message) { - process.stdout.write(message + os3.EOL); + function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) { + return performance2.now(); } - exports.info = info3; - function startGroup(name2) { - command_1.issue("group", name2); + function createOpaqueTimingInfo(timingInfo) { + return { + startTime: timingInfo.startTime ?? 0, + redirectStartTime: 0, + redirectEndTime: 0, + postRedirectStartTime: timingInfo.startTime ?? 0, + finalServiceWorkerStartTime: 0, + finalNetworkResponseStartTime: 0, + finalNetworkRequestStartTime: 0, + endTime: 0, + encodedBodySize: 0, + decodedBodySize: 0, + finalConnectionTimingInfo: null + }; } - exports.startGroup = startGroup; - function endGroup() { - command_1.issue("endgroup"); + function makePolicyContainer() { + return { + referrerPolicy: "strict-origin-when-cross-origin" + }; } - exports.endGroup = endGroup; - function group2(name2, fn2) { - return __awaiter(this, void 0, void 0, function* () { - startGroup(name2); - let result; - try { - result = yield fn2(); - } finally { - endGroup(); - } - return result; - }); + function clonePolicyContainer(policyContainer) { + return { + referrerPolicy: policyContainer.referrerPolicy + }; } - exports.group = group2; - function saveState3(name2, value) { - const filePath = process.env["GITHUB_STATE"] || ""; - if (filePath) { - return file_command_1.issueFileCommand("STATE", file_command_1.prepareKeyValueMessage(name2, value)); + function determineRequestsReferrer(request) { + const policy = request.referrerPolicy; + assert(policy); + let referrerSource = null; + if (request.referrer === "client") { + const globalOrigin = getGlobalOrigin(); + if (!globalOrigin || globalOrigin.origin === "null") { + return "no-referrer"; + } + referrerSource = new URL(globalOrigin); + } else if (request.referrer instanceof URL) { + referrerSource = request.referrer; + } + let referrerURL = stripURLForReferrer(referrerSource); + const referrerOrigin = stripURLForReferrer(referrerSource, true); + if (referrerURL.toString().length > 4096) { + referrerURL = referrerOrigin; + } + const areSameOrigin = sameOrigin(request, referrerURL); + const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(request.url); + switch (policy) { + case "origin": + return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true); + case "unsafe-url": + return referrerURL; + case "same-origin": + return areSameOrigin ? referrerOrigin : "no-referrer"; + case "origin-when-cross-origin": + return areSameOrigin ? referrerURL : referrerOrigin; + case "strict-origin-when-cross-origin": { + const currentURL = requestCurrentURL(request); + if (sameOrigin(referrerURL, currentURL)) { + return referrerURL; + } + if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) { + return "no-referrer"; + } + return referrerOrigin; + } + case "strict-origin": + case "no-referrer-when-downgrade": + default: + return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin; } - command_1.issueCommand("save-state", { name: name2 }, utils_1.toCommandValue(value)); } - exports.saveState = saveState3; - function getState3(name2) { - return process.env[`STATE_${name2}`] || ""; + function stripURLForReferrer(url2, originOnly) { + assert(url2 instanceof URL); + if (url2.protocol === "file:" || url2.protocol === "about:" || url2.protocol === "blank:") { + return "no-referrer"; + } + url2.username = ""; + url2.password = ""; + url2.hash = ""; + if (originOnly) { + url2.pathname = ""; + url2.search = ""; + } + return url2; } - exports.getState = getState3; - function getIDToken(aud) { - return __awaiter(this, void 0, void 0, function* () { - return yield oidc_utils_1.OidcClient.getIDToken(aud); - }); + function isURLPotentiallyTrustworthy(url2) { + if (!(url2 instanceof URL)) { + return false; + } + if (url2.href === "about:blank" || url2.href === "about:srcdoc") { + return true; + } + if (url2.protocol === "data:") + return true; + if (url2.protocol === "file:") + return true; + return isOriginPotentiallyTrustworthy(url2.origin); + function isOriginPotentiallyTrustworthy(origin) { + if (origin == null || origin === "null") + return false; + const originAsURL = new URL(origin); + if (originAsURL.protocol === "https:" || originAsURL.protocol === "wss:") { + return true; + } + if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) || (originAsURL.hostname === "localhost" || originAsURL.hostname.includes("localhost.")) || originAsURL.hostname.endsWith(".localhost")) { + return true; + } + return false; + } } - exports.getIDToken = getIDToken; - var summary_1 = require_summary(); - Object.defineProperty(exports, "summary", { enumerable: true, get: function() { - return summary_1.summary; - } }); - var summary_2 = require_summary(); - Object.defineProperty(exports, "markdownSummary", { enumerable: true, get: function() { - return summary_2.markdownSummary; - } }); - var path_utils_1 = require_path_utils(); - Object.defineProperty(exports, "toPosixPath", { enumerable: true, get: function() { - return path_utils_1.toPosixPath; - } }); - Object.defineProperty(exports, "toWin32Path", { enumerable: true, get: function() { - return path_utils_1.toWin32Path; - } }); - Object.defineProperty(exports, "toPlatformPath", { enumerable: true, get: function() { - return path_utils_1.toPlatformPath; - } }); - } -}); - -// node_modules/@actions/io/lib/io-util.js -var require_io_util = __commonJS({ - "node_modules/@actions/io/lib/io-util.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - Object.defineProperty(o2, k22, { enumerable: true, get: function() { - return m3[k2]; - } }); - } : function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - o2[k22] = m3[k2]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { - Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); - } : function(o2, v2) { - o2["default"] = v2; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k2 in mod) - if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) - __createBinding(result, mod, k2); + function bytesMatch(bytes, metadataList) { + if (crypto5 === void 0) { + return true; } - __setModuleDefault(result, mod); - return result; - }; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve2) { - resolve2(value); - }); + const parsedMetadata = parseMetadata(metadataList); + if (parsedMetadata === "no metadata") { + return true; } - return new (P2 || (P2 = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e2) { - reject(e2); - } + if (parsedMetadata.length === 0) { + return true; + } + const list3 = parsedMetadata.sort((c2, d2) => d2.algo.localeCompare(c2.algo)); + const strongest = list3[0].algo; + const metadata3 = list3.filter((item) => item.algo === strongest); + for (const item of metadata3) { + const algorithm = item.algo; + let expectedValue = item.hash; + if (expectedValue.endsWith("==")) { + expectedValue = expectedValue.slice(0, -2); } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e2) { - reject(e2); - } + let actualValue = crypto5.createHash(algorithm).update(bytes).digest("base64"); + if (actualValue.endsWith("==")) { + actualValue = actualValue.slice(0, -2); } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + if (actualValue === expectedValue) { + return true; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var _a2; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; - var fs3 = __importStar(__require("fs")); - var path15 = __importStar(__require("path")); - _a2 = fs3.promises, exports.chmod = _a2.chmod, exports.copyFile = _a2.copyFile, exports.lstat = _a2.lstat, exports.mkdir = _a2.mkdir, exports.open = _a2.open, exports.readdir = _a2.readdir, exports.readlink = _a2.readlink, exports.rename = _a2.rename, exports.rm = _a2.rm, exports.rmdir = _a2.rmdir, exports.stat = _a2.stat, exports.symlink = _a2.symlink, exports.unlink = _a2.unlink; - exports.IS_WINDOWS = process.platform === "win32"; - exports.UV_FS_O_EXLOCK = 268435456; - exports.READONLY = fs3.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter(this, void 0, void 0, function* () { - try { - yield exports.stat(fsPath); - } catch (err) { - if (err.code === "ENOENT") { - return false; - } - throw err; + let actualBase64URL = crypto5.createHash(algorithm).update(bytes).digest("base64url"); + if (actualBase64URL.endsWith("==")) { + actualBase64URL = actualBase64URL.slice(0, -2); + } + if (actualBase64URL === expectedValue) { + return true; + } + } + return false; + } + var parseHashWithOptions = /((?sha256|sha384|sha512)-(?[A-z0-9+/]{1}.*={0,2}))( +[\x21-\x7e]?)?/i; + function parseMetadata(metadata3) { + const result = []; + let empty = true; + const supportedHashes = crypto5.getHashes(); + for (const token of metadata3.split(" ")) { + empty = false; + const parsedToken = parseHashWithOptions.exec(token); + if (parsedToken === null || parsedToken.groups === void 0) { + continue; + } + const algorithm = parsedToken.groups.algo; + if (supportedHashes.includes(algorithm.toLowerCase())) { + result.push(parsedToken.groups); } + } + if (empty === true) { + return "no metadata"; + } + return result; + } + function tryUpgradeRequestToAPotentiallyTrustworthyURL(request) { + } + function sameOrigin(A2, B2) { + if (A2.origin === B2.origin && A2.origin === "null") { return true; - }); + } + if (A2.protocol === B2.protocol && A2.hostname === B2.hostname && A2.port === B2.port) { + return true; + } + return false; } - exports.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter(this, void 0, void 0, function* () { - const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); - return stats.isDirectory(); + function createDeferredPromise() { + let res; + let rej; + const promise = new Promise((resolve2, reject) => { + res = resolve2; + rej = reject; }); + return { promise, resolve: res, reject: rej }; } - exports.isDirectory = isDirectory; - function isRooted(p2) { - p2 = normalizeSeparators(p2); - if (!p2) { - throw new Error('isRooted() parameter "p" cannot be empty'); - } - if (exports.IS_WINDOWS) { - return p2.startsWith("\\") || /^[A-Z]:/i.test(p2); + function isAborted(fetchParams) { + return fetchParams.controller.state === "aborted"; + } + function isCancelled(fetchParams) { + return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated"; + } + function normalizeMethod(method) { + return /^(DELETE|GET|HEAD|OPTIONS|POST|PUT)$/i.test(method) ? method.toUpperCase() : method; + } + function serializeJavascriptValueToJSONString(value) { + const result = JSON.stringify(value); + if (result === void 0) { + throw new TypeError("Value is not JSON serializable"); } - return p2.startsWith("/"); + assert(typeof result === "string"); + return result; } - exports.isRooted = isRooted; - function tryGetExecutablePath(filePath, extensions) { - return __awaiter(this, void 0, void 0, function* () { - let stats = void 0; - try { - stats = yield exports.stat(filePath); - } catch (err) { - if (err.code !== "ENOENT") { - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + var esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); + function makeIterator(iterator, name2, kind) { + const object = { + index: 0, + kind, + target: iterator + }; + const i2 = { + next() { + if (Object.getPrototypeOf(this) !== i2) { + throw new TypeError( + `'next' called on an object that does not implement interface ${name2} Iterator.` + ); } - } - if (stats && stats.isFile()) { - if (exports.IS_WINDOWS) { - const upperExt = path15.extname(filePath).toUpperCase(); - if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { - return filePath; - } - } else { - if (isUnixExecutable(stats)) { - return filePath; - } + const { index, kind: kind2, target } = object; + const values = target(); + const len = values.length; + if (index >= len) { + return { value: void 0, done: true }; } + const pair = values[index]; + object.index = index + 1; + return iteratorResult(pair, kind2); + }, + // The class string of an iterator prototype object for a given interface is the + // result of concatenating the identifier of the interface and the string " Iterator". + [Symbol.toStringTag]: `${name2} Iterator` + }; + Object.setPrototypeOf(i2, esIteratorPrototype); + return Object.setPrototypeOf({}, i2); + } + function iteratorResult(pair, kind) { + let result; + switch (kind) { + case "key": { + result = pair[0]; + break; } - const originalFilePath = filePath; - for (const extension of extensions) { - filePath = originalFilePath + extension; - stats = void 0; - try { - stats = yield exports.stat(filePath); - } catch (err) { - if (err.code !== "ENOENT") { - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } - } - if (stats && stats.isFile()) { - if (exports.IS_WINDOWS) { - try { - const directory = path15.dirname(filePath); - const upperName = path15.basename(filePath).toUpperCase(); - for (const actualName of yield exports.readdir(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path15.join(directory, actualName); - break; - } - } - } catch (err) { - console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); - } - return filePath; - } else { - if (isUnixExecutable(stats)) { - return filePath; - } - } - } + case "value": { + result = pair[1]; + break; } - return ""; - }); + case "key+value": { + result = pair; + break; + } + } + return { value: result, done: false }; } - exports.tryGetExecutablePath = tryGetExecutablePath; - function normalizeSeparators(p2) { - p2 = p2 || ""; - if (exports.IS_WINDOWS) { - p2 = p2.replace(/\//g, "\\"); - return p2.replace(/\\\\+/g, "\\"); + async function fullyReadBody(body2, processBody, processBodyError) { + const successSteps = processBody; + const errorSteps = processBodyError; + let reader; + try { + reader = body2.stream.getReader(); + } catch (e2) { + errorSteps(e2); + return; + } + try { + const result = await readAllBytes(reader); + successSteps(result); + } catch (e2) { + errorSteps(e2); } - return p2.replace(/\/\/+/g, "/"); } - function isUnixExecutable(stats) { - return (stats.mode & 1) > 0 || (stats.mode & 8) > 0 && stats.gid === process.getgid() || (stats.mode & 64) > 0 && stats.uid === process.getuid(); + var ReadableStream = globalThis.ReadableStream; + function isReadableStreamLike(stream) { + if (!ReadableStream) { + ReadableStream = __require("stream/web").ReadableStream; + } + return stream instanceof ReadableStream || stream[Symbol.toStringTag] === "ReadableStream" && typeof stream.tee === "function"; } - function getCmdPath() { - var _a3; - return (_a3 = process.env["COMSPEC"]) !== null && _a3 !== void 0 ? _a3 : `cmd.exe`; + var MAXIMUM_ARGUMENT_LENGTH = 65535; + function isomorphicDecode(input) { + if (input.length < MAXIMUM_ARGUMENT_LENGTH) { + return String.fromCharCode(...input); + } + return input.reduce((previous, current) => previous + String.fromCharCode(current), ""); } - exports.getCmdPath = getCmdPath; + function readableStreamClose(controller) { + try { + controller.close(); + } catch (err) { + if (!err.message.includes("Controller is already closed")) { + throw err; + } + } + } + function isomorphicEncode(input) { + for (let i2 = 0; i2 < input.length; i2++) { + assert(input.charCodeAt(i2) <= 255); + } + return input; + } + async function readAllBytes(reader) { + const bytes = []; + let byteLength = 0; + while (true) { + const { done, value: chunk } = await reader.read(); + if (done) { + return Buffer.concat(bytes, byteLength); + } + if (!isUint8Array(chunk)) { + throw new TypeError("Received non-Uint8Array chunk"); + } + bytes.push(chunk); + byteLength += chunk.length; + } + } + function urlIsLocal(url2) { + assert("protocol" in url2); + const protocol = url2.protocol; + return protocol === "about:" || protocol === "blob:" || protocol === "data:"; + } + function urlHasHttpsScheme(url2) { + if (typeof url2 === "string") { + return url2.startsWith("https:"); + } + return url2.protocol === "https:"; + } + function urlIsHttpHttpsScheme(url2) { + assert("protocol" in url2); + const protocol = url2.protocol; + return protocol === "http:" || protocol === "https:"; + } + var hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key)); + module.exports = { + isAborted, + isCancelled, + createDeferredPromise, + ReadableStreamFrom, + toUSVString, + tryUpgradeRequestToAPotentiallyTrustworthyURL, + coarsenedSharedCurrentTime, + determineRequestsReferrer, + makePolicyContainer, + clonePolicyContainer, + appendFetchMetadata, + appendRequestOriginHeader, + TAOCheck, + corsCheck, + crossOriginResourcePolicyCheck, + createOpaqueTimingInfo, + setRequestReferrerPolicyOnRedirect, + isValidHTTPToken, + requestBadPort, + requestCurrentURL, + responseURL, + responseLocationURL, + isBlobLike, + isURLPotentiallyTrustworthy, + isValidReasonPhrase, + sameOrigin, + normalizeMethod, + serializeJavascriptValueToJSONString, + makeIterator, + isValidHeaderName, + isValidHeaderValue, + hasOwn, + isErrorLike, + fullyReadBody, + bytesMatch, + isReadableStreamLike, + readableStreamClose, + isomorphicEncode, + isomorphicDecode, + urlIsLocal, + urlHasHttpsScheme, + urlIsHttpHttpsScheme, + readAllBytes + }; } }); -// node_modules/@actions/io/lib/io.js -var require_io = __commonJS({ - "node_modules/@actions/io/lib/io.js"(exports) { +// node_modules/undici/lib/fetch/symbols.js +var require_symbols2 = __commonJS({ + "node_modules/undici/lib/fetch/symbols.js"(exports, module) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - Object.defineProperty(o2, k22, { enumerable: true, get: function() { - return m3[k2]; - } }); - } : function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - o2[k22] = m3[k2]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { - Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); - } : function(o2, v2) { - o2["default"] = v2; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k2 in mod) - if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) - __createBinding(result, mod, k2); + module.exports = { + kUrl: Symbol("url"), + kHeaders: Symbol("headers"), + kSignal: Symbol("signal"), + kState: Symbol("state"), + kGuard: Symbol("guard"), + kRealm: Symbol("realm") + }; + } +}); + +// node_modules/undici/lib/fetch/webidl.js +var require_webidl = __commonJS({ + "node_modules/undici/lib/fetch/webidl.js"(exports, module) { + "use strict"; + var { types } = __require("util"); + var { hasOwn, toUSVString } = require_util2(); + var webidl = {}; + webidl.converters = {}; + webidl.util = {}; + webidl.errors = {}; + webidl.errors.exception = function(message) { + return new TypeError(`${message.header}: ${message.message}`); + }; + webidl.errors.conversionFailed = function(context3) { + const plural = context3.types.length === 1 ? "" : " one of"; + const message = `${context3.argument} could not be converted to${plural}: ${context3.types.join(", ")}.`; + return webidl.errors.exception({ + header: context3.prefix, + message + }); + }; + webidl.errors.invalidArgument = function(context3) { + return webidl.errors.exception({ + header: context3.prefix, + message: `"${context3.value}" is an invalid ${context3.type}.` + }); + }; + webidl.brandCheck = function(V2, I2, opts = void 0) { + if (opts?.strict !== false && !(V2 instanceof I2)) { + throw new TypeError("Illegal invocation"); + } else { + return V2?.[Symbol.toStringTag] === I2.prototype[Symbol.toStringTag]; } - __setModuleDefault(result, mod); - return result; }; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve2) { - resolve2(value); + webidl.argumentLengthCheck = function({ length }, min, ctx) { + if (length < min) { + throw webidl.errors.exception({ + message: `${min} argument${min !== 1 ? "s" : ""} required, but${length ? " only" : ""} ${length} found.`, + ...ctx }); } - return new (P2 || (P2 = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e2) { - reject(e2); - } + }; + webidl.illegalConstructor = function() { + throw webidl.errors.exception({ + header: "TypeError", + message: "Illegal constructor" + }); + }; + webidl.util.Type = function(V2) { + switch (typeof V2) { + case "undefined": + return "Undefined"; + case "boolean": + return "Boolean"; + case "string": + return "String"; + case "symbol": + return "Symbol"; + case "number": + return "Number"; + case "bigint": + return "BigInt"; + case "function": + case "object": { + if (V2 === null) { + return "Null"; + } + return "Object"; + } + } + }; + webidl.util.ConvertToInt = function(V2, bitLength, signedness, opts = {}) { + let upperBound; + let lowerBound; + if (bitLength === 64) { + upperBound = Math.pow(2, 53) - 1; + if (signedness === "unsigned") { + lowerBound = 0; + } else { + lowerBound = Math.pow(-2, 53) + 1; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e2) { - reject(e2); - } + } else if (signedness === "unsigned") { + lowerBound = 0; + upperBound = Math.pow(2, bitLength) - 1; + } else { + lowerBound = Math.pow(-2, bitLength) - 1; + upperBound = Math.pow(2, bitLength - 1) - 1; + } + let x2 = Number(V2); + if (x2 === 0) { + x2 = 0; + } + if (opts.enforceRange === true) { + if (Number.isNaN(x2) || x2 === Number.POSITIVE_INFINITY || x2 === Number.NEGATIVE_INFINITY) { + throw webidl.errors.exception({ + header: "Integer conversion", + message: `Could not convert ${V2} to an integer.` + }); } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + x2 = webidl.util.IntegerPart(x2); + if (x2 < lowerBound || x2 > upperBound) { + throw webidl.errors.exception({ + header: "Integer conversion", + message: `Value must be between ${lowerBound}-${upperBound}, got ${x2}.` + }); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + return x2; + } + if (!Number.isNaN(x2) && opts.clamp === true) { + x2 = Math.min(Math.max(x2, lowerBound), upperBound); + if (Math.floor(x2) % 2 === 0) { + x2 = Math.floor(x2); + } else { + x2 = Math.ceil(x2); + } + return x2; + } + if (Number.isNaN(x2) || x2 === 0 && Object.is(0, x2) || x2 === Number.POSITIVE_INFINITY || x2 === Number.NEGATIVE_INFINITY) { + return 0; + } + x2 = webidl.util.IntegerPart(x2); + x2 = x2 % Math.pow(2, bitLength); + if (signedness === "signed" && x2 >= Math.pow(2, bitLength) - 1) { + return x2 - Math.pow(2, bitLength); + } + return x2; }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; - var assert_1 = __require("assert"); - var path15 = __importStar(__require("path")); - var ioUtil = __importStar(require_io_util()); - function cp(source, dest, options = {}) { - return __awaiter(this, void 0, void 0, function* () { - const { force, recursive, copySourceDirectory } = readCopyOptions(options); - const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; - if (destStat && destStat.isFile() && !force) { - return; + webidl.util.IntegerPart = function(n2) { + const r2 = Math.floor(Math.abs(n2)); + if (n2 < 0) { + return -1 * r2; + } + return r2; + }; + webidl.sequenceConverter = function(converter) { + return (V2) => { + if (webidl.util.Type(V2) !== "Object") { + throw webidl.errors.exception({ + header: "Sequence", + message: `Value of type ${webidl.util.Type(V2)} is not an Object.` + }); } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path15.join(dest, path15.basename(source)) : dest; - if (!(yield ioUtil.exists(source))) { - throw new Error(`no such file or directory: ${source}`); + const method = V2?.[Symbol.iterator]?.(); + const seq = []; + if (method === void 0 || typeof method.next !== "function") { + throw webidl.errors.exception({ + header: "Sequence", + message: "Object is not an iterator." + }); } - const sourceStat = yield ioUtil.stat(source); - if (sourceStat.isDirectory()) { - if (!recursive) { - throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); - } else { - yield cpDirRecursive(source, newDest, 0, force); - } - } else { - if (path15.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); + while (true) { + const { done, value } = method.next(); + if (done) { + break; } - yield copyFile(source, newDest, force); + seq.push(converter(value)); } - }); - } - exports.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter(this, void 0, void 0, function* () { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path15.join(dest, path15.basename(source)); - destExists = yield ioUtil.exists(dest); - } - if (destExists) { - if (options.force == null || options.force) { - yield rmRF2(dest); - } else { - throw new Error("Destination already exists"); - } + return seq; + }; + }; + webidl.recordConverter = function(keyConverter, valueConverter) { + return (O2) => { + if (webidl.util.Type(O2) !== "Object") { + throw webidl.errors.exception({ + header: "Record", + message: `Value of type ${webidl.util.Type(O2)} is not an Object.` + }); + } + const result = {}; + if (!types.isProxy(O2)) { + const keys2 = Object.keys(O2); + for (const key of keys2) { + const typedKey = keyConverter(key); + const typedValue = valueConverter(O2[key]); + result[typedKey] = typedValue; } + return result; } - yield mkdirP(path15.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - exports.mv = mv; - function rmRF2(inputPath) { - return __awaiter(this, void 0, void 0, function* () { - if (ioUtil.IS_WINDOWS) { - if (/[*"<>|]/.test(inputPath)) { - throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + const keys = Reflect.ownKeys(O2); + for (const key of keys) { + const desc = Reflect.getOwnPropertyDescriptor(O2, key); + if (desc?.enumerable) { + const typedKey = keyConverter(key); + const typedValue = valueConverter(O2[key]); + result[typedKey] = typedValue; } } - try { - yield ioUtil.rm(inputPath, { - force: true, - maxRetries: 3, - recursive: true, - retryDelay: 300 + return result; + }; + }; + webidl.interfaceConverter = function(i2) { + return (V2, opts = {}) => { + if (opts.strict !== false && !(V2 instanceof i2)) { + throw webidl.errors.exception({ + header: i2.name, + message: `Expected ${V2} to be an instance of ${i2.name}.` }); - } catch (err) { - throw new Error(`File was unable to be removed ${err}`); } - }); - } - exports.rmRF = rmRF2; - function mkdirP(fsPath) { - return __awaiter(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - exports.mkdirP = mkdirP; - function which(tool, check) { - return __awaiter(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); + return V2; + }; + }; + webidl.dictionaryConverter = function(converters) { + return (dictionary) => { + const type3 = webidl.util.Type(dictionary); + const dict = {}; + if (type3 === "Null" || type3 === "Undefined") { + return dict; + } else if (type3 !== "Object") { + throw webidl.errors.exception({ + header: "Dictionary", + message: `Expected ${dictionary} to be one of: Null, Undefined, Object.` + }); } - if (check) { - const result = yield which(tool, false); - if (!result) { - if (ioUtil.IS_WINDOWS) { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); - } else { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); + for (const options of converters) { + const { key, defaultValue, required, converter } = options; + if (required === true) { + if (!hasOwn(dictionary, key)) { + throw webidl.errors.exception({ + header: "Dictionary", + message: `Missing required key "${key}".` + }); } } - return result; + let value = dictionary[key]; + const hasDefault = hasOwn(options, "defaultValue"); + if (hasDefault && value !== null) { + value = value ?? defaultValue; + } + if (required || hasDefault || value !== void 0) { + value = converter(value); + if (options.allowedValues && !options.allowedValues.includes(value)) { + throw webidl.errors.exception({ + header: "Dictionary", + message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(", ")}.` + }); + } + dict[key] = value; + } } - const matches = yield findInPath(tool); - if (matches && matches.length > 0) { - return matches[0]; + return dict; + }; + }; + webidl.nullableConverter = function(converter) { + return (V2) => { + if (V2 === null) { + return V2; } + return converter(V2); + }; + }; + webidl.converters.DOMString = function(V2, opts = {}) { + if (V2 === null && opts.legacyNullToEmptyString) { return ""; - }); - } - exports.which = which; - function findInPath(tool) { - return __awaiter(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); + } + if (typeof V2 === "symbol") { + throw new TypeError("Could not convert argument of type symbol to string."); + } + return String(V2); + }; + webidl.converters.ByteString = function(V2) { + const x2 = webidl.converters.DOMString(V2); + for (let index = 0; index < x2.length; index++) { + const charCode = x2.charCodeAt(index); + if (charCode > 255) { + throw new TypeError( + `Cannot convert argument to a ByteString because the character at index ${index} has a value of ${charCode} which is greater than 255.` + ); } - const extensions = []; - if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path15.delimiter)) { - if (extension) { - extensions.push(extension); - } - } + } + return x2; + }; + webidl.converters.USVString = toUSVString; + webidl.converters.boolean = function(V2) { + const x2 = Boolean(V2); + return x2; + }; + webidl.converters.any = function(V2) { + return V2; + }; + webidl.converters["long long"] = function(V2) { + const x2 = webidl.util.ConvertToInt(V2, 64, "signed"); + return x2; + }; + webidl.converters["unsigned long long"] = function(V2) { + const x2 = webidl.util.ConvertToInt(V2, 64, "unsigned"); + return x2; + }; + webidl.converters["unsigned long"] = function(V2) { + const x2 = webidl.util.ConvertToInt(V2, 32, "unsigned"); + return x2; + }; + webidl.converters["unsigned short"] = function(V2, opts) { + const x2 = webidl.util.ConvertToInt(V2, 16, "unsigned", opts); + return x2; + }; + webidl.converters.ArrayBuffer = function(V2, opts = {}) { + if (webidl.util.Type(V2) !== "Object" || !types.isAnyArrayBuffer(V2)) { + throw webidl.errors.conversionFailed({ + prefix: `${V2}`, + argument: `${V2}`, + types: ["ArrayBuffer"] + }); + } + if (opts.allowShared === false && types.isSharedArrayBuffer(V2)) { + throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "SharedArrayBuffer is not allowed." + }); + } + return V2; + }; + webidl.converters.TypedArray = function(V2, T2, opts = {}) { + if (webidl.util.Type(V2) !== "Object" || !types.isTypedArray(V2) || V2.constructor.name !== T2.name) { + throw webidl.errors.conversionFailed({ + prefix: `${T2.name}`, + argument: `${V2}`, + types: [T2.name] + }); + } + if (opts.allowShared === false && types.isSharedArrayBuffer(V2.buffer)) { + throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "SharedArrayBuffer is not allowed." + }); + } + return V2; + }; + webidl.converters.DataView = function(V2, opts = {}) { + if (webidl.util.Type(V2) !== "Object" || !types.isDataView(V2)) { + throw webidl.errors.exception({ + header: "DataView", + message: "Object is not a DataView." + }); + } + if (opts.allowShared === false && types.isSharedArrayBuffer(V2.buffer)) { + throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "SharedArrayBuffer is not allowed." + }); + } + return V2; + }; + webidl.converters.BufferSource = function(V2, opts = {}) { + if (types.isAnyArrayBuffer(V2)) { + return webidl.converters.ArrayBuffer(V2, opts); + } + if (types.isTypedArray(V2)) { + return webidl.converters.TypedArray(V2, V2.constructor); + } + if (types.isDataView(V2)) { + return webidl.converters.DataView(V2, opts); + } + throw new TypeError(`Could not convert ${V2} to a BufferSource.`); + }; + webidl.converters["sequence"] = webidl.sequenceConverter( + webidl.converters.ByteString + ); + webidl.converters["sequence>"] = webidl.sequenceConverter( + webidl.converters["sequence"] + ); + webidl.converters["record"] = webidl.recordConverter( + webidl.converters.ByteString, + webidl.converters.ByteString + ); + module.exports = { + webidl + }; + } +}); + +// node_modules/undici/lib/fetch/dataURL.js +var require_dataURL = __commonJS({ + "node_modules/undici/lib/fetch/dataURL.js"(exports, module) { + var assert = __require("assert"); + var { atob: atob2 } = __require("buffer"); + var { isomorphicDecode } = require_util2(); + var encoder = new TextEncoder(); + var HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/; + var HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/; + var HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/; + function dataURLProcessor(dataURL) { + assert(dataURL.protocol === "data:"); + let input = URLSerializer(dataURL, true); + input = input.slice(5); + const position = { position: 0 }; + let mimeType = collectASequenceOfCodePointsFast( + ",", + input, + position + ); + const mimeTypeLength = mimeType.length; + mimeType = removeASCIIWhitespace(mimeType, true, true); + if (position.position >= input.length) { + return "failure"; + } + position.position++; + const encodedBody = input.slice(mimeTypeLength + 1); + let body2 = stringPercentDecode(encodedBody); + if (/;(\u0020){0,}base64$/i.test(mimeType)) { + const stringBody = isomorphicDecode(body2); + body2 = forgivingBase64(stringBody); + if (body2 === "failure") { + return "failure"; + } + mimeType = mimeType.slice(0, -6); + mimeType = mimeType.replace(/(\u0020)+$/, ""); + mimeType = mimeType.slice(0, -1); + } + if (mimeType.startsWith(";")) { + mimeType = "text/plain" + mimeType; + } + let mimeTypeRecord = parseMIMEType(mimeType); + if (mimeTypeRecord === "failure") { + mimeTypeRecord = parseMIMEType("text/plain;charset=US-ASCII"); + } + return { mimeType: mimeTypeRecord, body: body2 }; + } + function URLSerializer(url2, excludeFragment = false) { + const href = url2.href; + if (!excludeFragment) { + return href; + } + const hash = href.lastIndexOf("#"); + if (hash === -1) { + return href; + } + return href.slice(0, hash); + } + function collectASequenceOfCodePoints(condition, input, position) { + let result = ""; + while (position.position < input.length && condition(input[position.position])) { + result += input[position.position]; + position.position++; + } + return result; + } + function collectASequenceOfCodePointsFast(char, input, position) { + const idx = input.indexOf(char, position.position); + const start = position.position; + if (idx === -1) { + position.position = input.length; + return input.slice(start); + } + position.position = idx; + return input.slice(start, position.position); + } + function stringPercentDecode(input) { + const bytes = encoder.encode(input); + return percentDecode(bytes); + } + function percentDecode(input) { + const output = []; + for (let i2 = 0; i2 < input.length; i2++) { + const byte = input[i2]; + if (byte !== 37) { + output.push(byte); + } else if (byte === 37 && !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i2 + 1], input[i2 + 2]))) { + output.push(37); + } else { + const nextTwoBytes = String.fromCharCode(input[i2 + 1], input[i2 + 2]); + const bytePoint = Number.parseInt(nextTwoBytes, 16); + output.push(bytePoint); + i2 += 2; } - if (ioUtil.isRooted(tool)) { - const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); - if (filePath) { - return [filePath]; + } + return Uint8Array.from(output); + } + function parseMIMEType(input) { + input = removeHTTPWhitespace(input, true, true); + const position = { position: 0 }; + const type3 = collectASequenceOfCodePointsFast( + "/", + input, + position + ); + if (type3.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type3)) { + return "failure"; + } + if (position.position > input.length) { + return "failure"; + } + position.position++; + let subtype = collectASequenceOfCodePointsFast( + ";", + input, + position + ); + subtype = removeHTTPWhitespace(subtype, false, true); + if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) { + return "failure"; + } + const typeLowercase = type3.toLowerCase(); + const subtypeLowercase = subtype.toLowerCase(); + const mimeType = { + type: typeLowercase, + subtype: subtypeLowercase, + /** @type {Map} */ + parameters: /* @__PURE__ */ new Map(), + // https://mimesniff.spec.whatwg.org/#mime-type-essence + essence: `${typeLowercase}/${subtypeLowercase}` + }; + while (position.position < input.length) { + position.position++; + collectASequenceOfCodePoints( + // https://fetch.spec.whatwg.org/#http-whitespace + (char) => HTTP_WHITESPACE_REGEX.test(char), + input, + position + ); + let parameterName = collectASequenceOfCodePoints( + (char) => char !== ";" && char !== "=", + input, + position + ); + parameterName = parameterName.toLowerCase(); + if (position.position < input.length) { + if (input[position.position] === ";") { + continue; } - return []; + position.position++; } - if (tool.includes(path15.sep)) { - return []; + if (position.position > input.length) { + break; } - const directories = []; - if (process.env.PATH) { - for (const p2 of process.env.PATH.split(path15.delimiter)) { - if (p2) { - directories.push(p2); - } + let parameterValue = null; + if (input[position.position] === '"') { + parameterValue = collectAnHTTPQuotedString(input, position, true); + collectASequenceOfCodePointsFast( + ";", + input, + position + ); + } else { + parameterValue = collectASequenceOfCodePointsFast( + ";", + input, + position + ); + parameterValue = removeHTTPWhitespace(parameterValue, false, true); + if (parameterValue.length === 0) { + continue; } } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path15.join(directory, tool), extensions); - if (filePath) { - matches.push(filePath); - } + if (parameterName.length !== 0 && HTTP_TOKEN_CODEPOINTS.test(parameterName) && (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) && !mimeType.parameters.has(parameterName)) { + mimeType.parameters.set(parameterName, parameterValue); } - return matches; - }); + } + return mimeType; } - exports.findInPath = findInPath; - function readCopyOptions(options) { - const force = options.force == null ? true : options.force; - const recursive = Boolean(options.recursive); - const copySourceDirectory = options.copySourceDirectory == null ? true : Boolean(options.copySourceDirectory); - return { force, recursive, copySourceDirectory }; + function forgivingBase64(data) { + data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, ""); + if (data.length % 4 === 0) { + data = data.replace(/=?=$/, ""); + } + if (data.length % 4 === 1) { + return "failure"; + } + if (/[^+/0-9A-Za-z]/.test(data)) { + return "failure"; + } + const binary = atob2(data); + const bytes = new Uint8Array(binary.length); + for (let byte = 0; byte < binary.length; byte++) { + bytes[byte] = binary.charCodeAt(byte); + } + return bytes; } - function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter(this, void 0, void 0, function* () { - if (currentDepth >= 255) - return; - currentDepth++; - yield mkdirP(destDir); - const files = yield ioUtil.readdir(sourceDir); - for (const fileName of files) { - const srcFile = `${sourceDir}/${fileName}`; - const destFile = `${destDir}/${fileName}`; - const srcFileStat = yield ioUtil.lstat(srcFile); - if (srcFileStat.isDirectory()) { - yield cpDirRecursive(srcFile, destFile, currentDepth, force); - } else { - yield copyFile(srcFile, destFile, force); - } + function collectAnHTTPQuotedString(input, position, extractValue) { + const positionStart = position.position; + let value = ""; + assert(input[position.position] === '"'); + position.position++; + while (true) { + value += collectASequenceOfCodePoints( + (char) => char !== '"' && char !== "\\", + input, + position + ); + if (position.position >= input.length) { + break; } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter(this, void 0, void 0, function* () { - if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { - try { - yield ioUtil.lstat(destFile); - yield ioUtil.unlink(destFile); - } catch (e2) { - if (e2.code === "EPERM") { - yield ioUtil.chmod(destFile, "0666"); - yield ioUtil.unlink(destFile); - } + const quoteOrBackslash = input[position.position]; + position.position++; + if (quoteOrBackslash === "\\") { + if (position.position >= input.length) { + value += "\\"; + break; } - const symlinkFull = yield ioUtil.readlink(srcFile); - yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? "junction" : null); - } else if (!(yield ioUtil.exists(destFile)) || force) { - yield ioUtil.copyFile(srcFile, destFile); + value += input[position.position]; + position.position++; + } else { + assert(quoteOrBackslash === '"'); + break; } - }); + } + if (extractValue) { + return value; + } + return input.slice(positionStart, position.position); + } + function serializeAMimeType(mimeType) { + assert(mimeType !== "failure"); + const { parameters, essence } = mimeType; + let serialization = essence; + for (let [name2, value] of parameters.entries()) { + serialization += ";"; + serialization += name2; + serialization += "="; + if (!HTTP_TOKEN_CODEPOINTS.test(value)) { + value = value.replace(/(\\|")/g, "\\$1"); + value = '"' + value; + value += '"'; + } + serialization += value; + } + return serialization; + } + function isHTTPWhiteSpace(char) { + return char === "\r" || char === "\n" || char === " " || char === " "; + } + function removeHTTPWhitespace(str, leading = true, trailing = true) { + let lead = 0; + let trail = str.length - 1; + if (leading) { + for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++) + ; + } + if (trailing) { + for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--) + ; + } + return str.slice(lead, trail + 1); + } + function isASCIIWhitespace(char) { + return char === "\r" || char === "\n" || char === " " || char === "\f" || char === " "; + } + function removeASCIIWhitespace(str, leading = true, trailing = true) { + let lead = 0; + let trail = str.length - 1; + if (leading) { + for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++) + ; + } + if (trailing) { + for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--) + ; + } + return str.slice(lead, trail + 1); } + module.exports = { + dataURLProcessor, + URLSerializer, + collectASequenceOfCodePoints, + collectASequenceOfCodePointsFast, + stringPercentDecode, + parseMIMEType, + collectAnHTTPQuotedString, + serializeAMimeType + }; } }); -// node_modules/@actions/exec/lib/toolrunner.js -var require_toolrunner = __commonJS({ - "node_modules/@actions/exec/lib/toolrunner.js"(exports) { +// node_modules/undici/lib/fetch/file.js +var require_file = __commonJS({ + "node_modules/undici/lib/fetch/file.js"(exports, module) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - Object.defineProperty(o2, k22, { enumerable: true, get: function() { - return m3[k2]; - } }); - } : function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - o2[k22] = m3[k2]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { - Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); - } : function(o2, v2) { - o2["default"] = v2; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k2 in mod) - if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) - __createBinding(result, mod, k2); + var { Blob: Blob4, File: NativeFile } = __require("buffer"); + var { types } = __require("util"); + var { kState } = require_symbols2(); + var { isBlobLike } = require_util2(); + var { webidl } = require_webidl(); + var { parseMIMEType, serializeAMimeType } = require_dataURL(); + var { kEnumerableProperty } = require_util(); + var File = class _File extends Blob4 { + constructor(fileBits, fileName, options = {}) { + webidl.argumentLengthCheck(arguments, 2, { header: "File constructor" }); + fileBits = webidl.converters["sequence"](fileBits); + fileName = webidl.converters.USVString(fileName); + options = webidl.converters.FilePropertyBag(options); + const n2 = fileName; + let t2 = options.type; + let d2; + substep: { + if (t2) { + t2 = parseMIMEType(t2); + if (t2 === "failure") { + t2 = ""; + break substep; + } + t2 = serializeAMimeType(t2).toLowerCase(); + } + d2 = options.lastModified; + } + super(processBlobParts(fileBits, options), { type: t2 }); + this[kState] = { + name: n2, + lastModified: d2, + type: t2 + }; } - __setModuleDefault(result, mod); - return result; - }; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve2) { - resolve2(value); - }); + get name() { + webidl.brandCheck(this, _File); + return this[kState].name; + } + get lastModified() { + webidl.brandCheck(this, _File); + return this[kState].lastModified; + } + get type() { + webidl.brandCheck(this, _File); + return this[kState].type; + } + }; + var FileLike = class _FileLike { + constructor(blobLike, fileName, options = {}) { + const n2 = fileName; + const t2 = options.type; + const d2 = options.lastModified ?? Date.now(); + this[kState] = { + blobLike, + name: n2, + type: t2, + lastModified: d2 + }; + } + stream(...args) { + webidl.brandCheck(this, _FileLike); + return this[kState].blobLike.stream(...args); + } + arrayBuffer(...args) { + webidl.brandCheck(this, _FileLike); + return this[kState].blobLike.arrayBuffer(...args); + } + slice(...args) { + webidl.brandCheck(this, _FileLike); + return this[kState].blobLike.slice(...args); + } + text(...args) { + webidl.brandCheck(this, _FileLike); + return this[kState].blobLike.text(...args); + } + get size() { + webidl.brandCheck(this, _FileLike); + return this[kState].blobLike.size; + } + get type() { + webidl.brandCheck(this, _FileLike); + return this[kState].blobLike.type; + } + get name() { + webidl.brandCheck(this, _FileLike); + return this[kState].name; + } + get lastModified() { + webidl.brandCheck(this, _FileLike); + return this[kState].lastModified; + } + get [Symbol.toStringTag]() { + return "File"; } - return new (P2 || (P2 = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e2) { - reject(e2); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e2) { - reject(e2); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.argStringToArray = exports.ToolRunner = void 0; - var os3 = __importStar(__require("os")); - var events = __importStar(__require("events")); - var child = __importStar(__require("child_process")); - var path15 = __importStar(__require("path")); - var io2 = __importStar(require_io()); - var ioUtil = __importStar(require_io_util()); - var timers_1 = __require("timers"); - var IS_WINDOWS = process.platform === "win32"; - var ToolRunner = class extends events.EventEmitter { - constructor(toolPath, args, options) { - super(); - if (!toolPath) { - throw new Error("Parameter 'toolPath' cannot be null or empty."); + Object.defineProperties(File.prototype, { + [Symbol.toStringTag]: { + value: "File", + configurable: true + }, + name: kEnumerableProperty, + lastModified: kEnumerableProperty + }); + webidl.converters.Blob = webidl.interfaceConverter(Blob4); + webidl.converters.BlobPart = function(V2, opts) { + if (webidl.util.Type(V2) === "Object") { + if (isBlobLike(V2)) { + return webidl.converters.Blob(V2, { strict: false }); } - this.toolPath = toolPath; - this.args = args || []; - this.options = options || {}; - } - _debug(message) { - if (this.options.listeners && this.options.listeners.debug) { - this.options.listeners.debug(message); + if (ArrayBuffer.isView(V2) || types.isAnyArrayBuffer(V2)) { + return webidl.converters.BufferSource(V2, opts); } } - _getCommandString(options, noPrefix) { - const toolPath = this._getSpawnFileName(); - const args = this._getSpawnArgs(options); - let cmd = noPrefix ? "" : "[command]"; - if (IS_WINDOWS) { - if (this._isCmdFile()) { - cmd += toolPath; - for (const a2 of args) { - cmd += ` ${a2}`; - } - } else if (options.windowsVerbatimArguments) { - cmd += `"${toolPath}"`; - for (const a2 of args) { - cmd += ` ${a2}`; - } - } else { - cmd += this._windowsQuoteCmdArg(toolPath); - for (const a2 of args) { - cmd += ` ${this._windowsQuoteCmdArg(a2)}`; - } + return webidl.converters.USVString(V2, opts); + }; + webidl.converters["sequence"] = webidl.sequenceConverter( + webidl.converters.BlobPart + ); + webidl.converters.FilePropertyBag = webidl.dictionaryConverter([ + { + key: "lastModified", + converter: webidl.converters["long long"], + get defaultValue() { + return Date.now(); + } + }, + { + key: "type", + converter: webidl.converters.DOMString, + defaultValue: "" + }, + { + key: "endings", + converter: (value) => { + value = webidl.converters.DOMString(value); + value = value.toLowerCase(); + if (value !== "native") { + value = "transparent"; } - } else { - cmd += toolPath; - for (const a2 of args) { - cmd += ` ${a2}`; + return value; + }, + defaultValue: "transparent" + } + ]); + function processBlobParts(parts, options) { + const bytes = []; + for (const element of parts) { + if (typeof element === "string") { + let s2 = element; + if (options.endings === "native") { + s2 = convertLineEndingsNative(s2); + } + bytes.push(new TextEncoder().encode(s2)); + } else if (types.isAnyArrayBuffer(element) || types.isTypedArray(element)) { + if (!element.buffer) { + bytes.push(new Uint8Array(element)); + } else { + bytes.push( + new Uint8Array(element.buffer, element.byteOffset, element.byteLength) + ); } + } else if (isBlobLike(element)) { + bytes.push(element); } - return cmd; } - _processLineBuffer(data, strBuffer, onLine) { - try { - let s2 = strBuffer + data.toString(); - let n2 = s2.indexOf(os3.EOL); - while (n2 > -1) { - const line = s2.substring(0, n2); - onLine(line); - s2 = s2.substring(n2 + os3.EOL.length); - n2 = s2.indexOf(os3.EOL); - } - return s2; - } catch (err) { - this._debug(`error processing line. Failed with error ${err}`); - return ""; + return bytes; + } + function convertLineEndingsNative(s2) { + let nativeLineEnding = "\n"; + if (process.platform === "win32") { + nativeLineEnding = "\r\n"; + } + return s2.replace(/\r?\n/g, nativeLineEnding); + } + function isFileLike(object) { + return NativeFile && object instanceof NativeFile || object instanceof File || object && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && object[Symbol.toStringTag] === "File"; + } + module.exports = { File, FileLike, isFileLike }; + } +}); + +// node_modules/undici/lib/fetch/formdata.js +var require_formdata = __commonJS({ + "node_modules/undici/lib/fetch/formdata.js"(exports, module) { + "use strict"; + var { isBlobLike, toUSVString, makeIterator } = require_util2(); + var { kState } = require_symbols2(); + var { File: UndiciFile, FileLike, isFileLike } = require_file(); + var { webidl } = require_webidl(); + var { Blob: Blob4, File: NativeFile } = __require("buffer"); + var File = NativeFile ?? UndiciFile; + var FormData2 = class _FormData { + constructor(form) { + if (form !== void 0) { + throw webidl.errors.conversionFailed({ + prefix: "FormData constructor", + argument: "Argument 1", + types: ["undefined"] + }); } + this[kState] = []; } - _getSpawnFileName() { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - return process.env["COMSPEC"] || "cmd.exe"; - } + append(name2, value, filename = void 0) { + webidl.brandCheck(this, _FormData); + webidl.argumentLengthCheck(arguments, 2, { header: "FormData.append" }); + if (arguments.length === 3 && !isBlobLike(value)) { + throw new TypeError( + "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'" + ); } - return this.toolPath; + name2 = webidl.converters.USVString(name2); + value = isBlobLike(value) ? webidl.converters.Blob(value, { strict: false }) : webidl.converters.USVString(value); + filename = arguments.length === 3 ? webidl.converters.USVString(filename) : void 0; + const entry = makeEntry(name2, value, filename); + this[kState].push(entry); } - _getSpawnArgs(options) { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; - for (const a2 of this.args) { - argline += " "; - argline += options.windowsVerbatimArguments ? a2 : this._windowsQuoteCmdArg(a2); - } - argline += '"'; - return [argline]; - } + delete(name2) { + webidl.brandCheck(this, _FormData); + webidl.argumentLengthCheck(arguments, 1, { header: "FormData.delete" }); + name2 = webidl.converters.USVString(name2); + this[kState] = this[kState].filter((entry) => entry.name !== name2); + } + get(name2) { + webidl.brandCheck(this, _FormData); + webidl.argumentLengthCheck(arguments, 1, { header: "FormData.get" }); + name2 = webidl.converters.USVString(name2); + const idx = this[kState].findIndex((entry) => entry.name === name2); + if (idx === -1) { + return null; } - return this.args; + return this[kState][idx].value; } - _endsWith(str, end) { - return str.endsWith(end); + getAll(name2) { + webidl.brandCheck(this, _FormData); + webidl.argumentLengthCheck(arguments, 1, { header: "FormData.getAll" }); + name2 = webidl.converters.USVString(name2); + return this[kState].filter((entry) => entry.name === name2).map((entry) => entry.value); } - _isCmdFile() { - const upperToolPath = this.toolPath.toUpperCase(); - return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); + has(name2) { + webidl.brandCheck(this, _FormData); + webidl.argumentLengthCheck(arguments, 1, { header: "FormData.has" }); + name2 = webidl.converters.USVString(name2); + return this[kState].findIndex((entry) => entry.name === name2) !== -1; + } + set(name2, value, filename = void 0) { + webidl.brandCheck(this, _FormData); + webidl.argumentLengthCheck(arguments, 2, { header: "FormData.set" }); + if (arguments.length === 3 && !isBlobLike(value)) { + throw new TypeError( + "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'" + ); + } + name2 = webidl.converters.USVString(name2); + value = isBlobLike(value) ? webidl.converters.Blob(value, { strict: false }) : webidl.converters.USVString(value); + filename = arguments.length === 3 ? toUSVString(filename) : void 0; + const entry = makeEntry(name2, value, filename); + const idx = this[kState].findIndex((entry2) => entry2.name === name2); + if (idx !== -1) { + this[kState] = [ + ...this[kState].slice(0, idx), + entry, + ...this[kState].slice(idx + 1).filter((entry2) => entry2.name !== name2) + ]; + } else { + this[kState].push(entry); + } } - _windowsQuoteCmdArg(arg) { - if (!this._isCmdFile()) { - return this._uvQuoteCmdArg(arg); + entries() { + webidl.brandCheck(this, _FormData); + return makeIterator( + () => this[kState].map((pair) => [pair.name, pair.value]), + "FormData", + "key+value" + ); + } + keys() { + webidl.brandCheck(this, _FormData); + return makeIterator( + () => this[kState].map((pair) => [pair.name, pair.value]), + "FormData", + "key" + ); + } + values() { + webidl.brandCheck(this, _FormData); + return makeIterator( + () => this[kState].map((pair) => [pair.name, pair.value]), + "FormData", + "value" + ); + } + /** + * @param {(value: string, key: string, self: FormData) => void} callbackFn + * @param {unknown} thisArg + */ + forEach(callbackFn, thisArg = globalThis) { + webidl.brandCheck(this, _FormData); + webidl.argumentLengthCheck(arguments, 1, { header: "FormData.forEach" }); + if (typeof callbackFn !== "function") { + throw new TypeError( + "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'." + ); } - if (!arg) { - return '""'; + for (const [key, value] of this) { + callbackFn.apply(thisArg, [value, key, this]); } - const cmdSpecialChars = [ - " ", - " ", - "&", - "(", - ")", - "[", - "]", - "{", - "}", - "^", - "=", - ";", - "!", - "'", - "+", - ",", - "`", - "~", - "|", - "<", - ">", - '"' - ]; - let needsQuotes = false; - for (const char of arg) { - if (cmdSpecialChars.some((x2) => x2 === char)) { - needsQuotes = true; - break; - } + } + }; + FormData2.prototype[Symbol.iterator] = FormData2.prototype.entries; + Object.defineProperties(FormData2.prototype, { + [Symbol.toStringTag]: { + value: "FormData", + configurable: true + } + }); + function makeEntry(name2, value, filename) { + name2 = Buffer.from(name2).toString("utf8"); + if (typeof value === "string") { + value = Buffer.from(value).toString("utf8"); + } else { + if (!isFileLike(value)) { + value = value instanceof Blob4 ? new File([value], "blob", { type: value.type }) : new FileLike(value, "blob", { type: value.type }); } - if (!needsQuotes) { - return arg; + if (filename !== void 0) { + const options = { + type: value.type, + lastModified: value.lastModified + }; + value = NativeFile && value instanceof NativeFile || value instanceof UndiciFile ? new File([value], filename, options) : new FileLike(value, filename, options); } - let reverse = '"'; - let quoteHit = true; - for (let i2 = arg.length; i2 > 0; i2--) { - reverse += arg[i2 - 1]; - if (quoteHit && arg[i2 - 1] === "\\") { - reverse += "\\"; - } else if (arg[i2 - 1] === '"') { - quoteHit = true; - reverse += '"'; + } + return { name: name2, value }; + } + module.exports = { FormData: FormData2 }; + } +}); + +// node_modules/undici/lib/fetch/body.js +var require_body = __commonJS({ + "node_modules/undici/lib/fetch/body.js"(exports, module) { + "use strict"; + var Busboy = require_main(); + var util3 = require_util(); + var { + ReadableStreamFrom, + isBlobLike, + isReadableStreamLike, + readableStreamClose, + createDeferredPromise, + fullyReadBody + } = require_util2(); + var { FormData: FormData2 } = require_formdata(); + var { kState } = require_symbols2(); + var { webidl } = require_webidl(); + var { DOMException: DOMException2, structuredClone } = require_constants(); + var { Blob: Blob4, File: NativeFile } = __require("buffer"); + var { kBodyUsed } = require_symbols(); + var assert = __require("assert"); + var { isErrored } = require_util(); + var { isUint8Array, isArrayBuffer } = __require("util/types"); + var { File: UndiciFile } = require_file(); + var { parseMIMEType, serializeAMimeType } = require_dataURL(); + var ReadableStream = globalThis.ReadableStream; + var File = NativeFile ?? UndiciFile; + function extractBody(object, keepalive = false) { + if (!ReadableStream) { + ReadableStream = __require("stream/web").ReadableStream; + } + let stream = null; + if (object instanceof ReadableStream) { + stream = object; + } else if (isBlobLike(object)) { + stream = object.stream(); + } else { + stream = new ReadableStream({ + async pull(controller) { + controller.enqueue( + typeof source === "string" ? new TextEncoder().encode(source) : source + ); + queueMicrotask(() => readableStreamClose(controller)); + }, + start() { + }, + type: void 0 + }); + } + assert(isReadableStreamLike(stream)); + let action5 = null; + let source = null; + let length = null; + let type3 = null; + if (typeof object === "string") { + source = object; + type3 = "text/plain;charset=UTF-8"; + } else if (object instanceof URLSearchParams) { + source = object.toString(); + type3 = "application/x-www-form-urlencoded;charset=UTF-8"; + } else if (isArrayBuffer(object)) { + source = new Uint8Array(object.slice()); + } else if (ArrayBuffer.isView(object)) { + source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)); + } else if (util3.isFormDataLike(object)) { + const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, "0")}`; + const prefix2 = `--${boundary}\r +Content-Disposition: form-data`; + /*! formdata-polyfill. MIT License. Jimmy Wärting */ + const escape2 = (str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"); + const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, "\r\n"); + const enc = new TextEncoder(); + const blobParts = []; + const rn2 = new Uint8Array([13, 10]); + length = 0; + let hasUnknownSizeValue = false; + for (const [name2, value] of object) { + if (typeof value === "string") { + const chunk2 = enc.encode(prefix2 + `; name="${escape2(normalizeLinefeeds(name2))}"\r +\r +${normalizeLinefeeds(value)}\r +`); + blobParts.push(chunk2); + length += chunk2.byteLength; } else { - quoteHit = false; + const chunk2 = enc.encode(`${prefix2}; name="${escape2(normalizeLinefeeds(name2))}"` + (value.name ? `; filename="${escape2(value.name)}"` : "") + `\r +Content-Type: ${value.type || "application/octet-stream"}\r +\r +`); + blobParts.push(chunk2, value, rn2); + if (typeof value.size === "number") { + length += chunk2.byteLength + value.size + rn2.byteLength; + } else { + hasUnknownSizeValue = true; + } } } - reverse += '"'; - return reverse.split("").reverse().join(""); - } - _uvQuoteCmdArg(arg) { - if (!arg) { - return '""'; - } - if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { - return arg; - } - if (!arg.includes('"') && !arg.includes("\\")) { - return `"${arg}"`; + const chunk = enc.encode(`--${boundary}--`); + blobParts.push(chunk); + length += chunk.byteLength; + if (hasUnknownSizeValue) { + length = null; } - let reverse = '"'; - let quoteHit = true; - for (let i2 = arg.length; i2 > 0; i2--) { - reverse += arg[i2 - 1]; - if (quoteHit && arg[i2 - 1] === "\\") { - reverse += "\\"; - } else if (arg[i2 - 1] === '"') { - quoteHit = true; - reverse += "\\"; - } else { - quoteHit = false; + source = object; + action5 = async function* () { + for (const part of blobParts) { + if (part.stream) { + yield* part.stream(); + } else { + yield part; + } } + }; + type3 = "multipart/form-data; boundary=" + boundary; + } else if (isBlobLike(object)) { + source = object; + length = object.size; + if (object.type) { + type3 = object.type; + } + } else if (typeof object[Symbol.asyncIterator] === "function") { + if (keepalive) { + throw new TypeError("keepalive"); + } + if (util3.isDisturbed(object) || object.locked) { + throw new TypeError( + "Response body object should not be disturbed or locked" + ); } - reverse += '"'; - return reverse.split("").reverse().join(""); + stream = object instanceof ReadableStream ? object : ReadableStreamFrom(object); } - _cloneExecOptions(options) { - options = options || {}; - const result = { - cwd: options.cwd || process.cwd(), - env: options.env || process.env, - silent: options.silent || false, - windowsVerbatimArguments: options.windowsVerbatimArguments || false, - failOnStdErr: options.failOnStdErr || false, - ignoreReturnCode: options.ignoreReturnCode || false, - delay: options.delay || 1e4 - }; - result.outStream = options.outStream || process.stdout; - result.errStream = options.errStream || process.stderr; - return result; + if (typeof source === "string" || util3.isBuffer(source)) { + length = Buffer.byteLength(source); } - _getSpawnOptions(options, toolPath) { - options = options || {}; - const result = {}; - result.cwd = options.cwd; - result.env = options.env; - result["windowsVerbatimArguments"] = options.windowsVerbatimArguments || this._isCmdFile(); - if (options.windowsVerbatimArguments) { - result.argv0 = `"${toolPath}"`; - } - return result; + if (action5 != null) { + let iterator; + stream = new ReadableStream({ + async start() { + iterator = action5(object)[Symbol.asyncIterator](); + }, + async pull(controller) { + const { value, done } = await iterator.next(); + if (done) { + queueMicrotask(() => { + controller.close(); + }); + } else { + if (!isErrored(stream)) { + controller.enqueue(new Uint8Array(value)); + } + } + return controller.desiredSize > 0; + }, + async cancel(reason) { + await iterator.return(); + }, + type: void 0 + }); } - /** - * Exec a tool. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param tool path to tool to exec - * @param options optional exec options. See ExecOptions - * @returns number - */ - exec() { - return __awaiter(this, void 0, void 0, function* () { - if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path15.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + const body2 = { stream, source, length }; + return [body2, type3]; + } + function safelyExtractBody(object, keepalive = false) { + if (!ReadableStream) { + ReadableStream = __require("stream/web").ReadableStream; + } + if (object instanceof ReadableStream) { + assert(!util3.isDisturbed(object), "The body has already been consumed."); + assert(!object.locked, "The stream is locked."); + } + return extractBody(object, keepalive); + } + function cloneBody(body2) { + const [out1, out2] = body2.stream.tee(); + const out2Clone = structuredClone(out2, { transfer: [out2] }); + const [, finalClone] = out2Clone.tee(); + body2.stream = out1; + return { + stream: finalClone, + length: body2.length, + source: body2.source + }; + } + async function* consumeBody2(body2) { + if (body2) { + if (isUint8Array(body2)) { + yield body2; + } else { + const stream = body2.stream; + if (util3.isDisturbed(stream)) { + throw new TypeError("The body has already been consumed."); } - this.toolPath = yield io2.which(this.toolPath, true); - return new Promise((resolve2, reject) => __awaiter(this, void 0, void 0, function* () { - this._debug(`exec tool: ${this.toolPath}`); - this._debug("arguments:"); - for (const arg of this.args) { - this._debug(` ${arg}`); - } - const optionsNonNull = this._cloneExecOptions(this.options); - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os3.EOL); + if (stream.locked) { + throw new TypeError("The stream is locked."); + } + stream[kBodyUsed] = true; + yield* stream; + } + } + } + function throwIfAborted(state) { + if (state.aborted) { + throw new DOMException2("The operation was aborted.", "AbortError"); + } + } + function bodyMixinMethods(instance) { + const methods = { + blob() { + return specConsumeBody(this, (bytes) => { + let mimeType = bodyMimeType(this); + if (mimeType === "failure") { + mimeType = ""; + } else if (mimeType) { + mimeType = serializeAMimeType(mimeType); + } + return new Blob4([bytes], { type: mimeType }); + }, instance); + }, + arrayBuffer() { + return specConsumeBody(this, (bytes) => { + return new Uint8Array(bytes).buffer; + }, instance); + }, + text() { + return specConsumeBody(this, utf8DecodeBytes, instance); + }, + json() { + return specConsumeBody(this, parseJSONFromBytes, instance); + }, + async formData() { + webidl.brandCheck(this, instance); + throwIfAborted(this[kState]); + const contentType2 = this.headers.get("Content-Type"); + if (/multipart\/form-data/.test(contentType2)) { + const headers = {}; + for (const [key, value] of this.headers) + headers[key.toLowerCase()] = value; + const responseFormData = new FormData2(); + let busboy; + try { + busboy = new Busboy({ + headers, + preservePath: true + }); + } catch (err) { + throw new DOMException2(`${err}`, "AbortError"); } - const state = new ExecState(optionsNonNull, this.toolPath); - state.on("debug", (message) => { - this._debug(message); + busboy.on("field", (name2, value) => { + responseFormData.append(name2, value); }); - if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { - return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); - } - const fileName = this._getSpawnFileName(); - const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); - let stdbuffer = ""; - if (cp.stdout) { - cp.stdout.on("data", (data) => { - if (this.options.listeners && this.options.listeners.stdout) { - this.options.listeners.stdout(data); - } - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(data); - } - stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { - if (this.options.listeners && this.options.listeners.stdline) { - this.options.listeners.stdline(line); - } + busboy.on("file", (name2, value, filename, encoding, mimeType) => { + const chunks = []; + if (encoding === "base64" || encoding.toLowerCase() === "base64") { + let base64chunk = ""; + value.on("data", (chunk) => { + base64chunk += chunk.toString().replace(/[\r\n]/gm, ""); + const end = base64chunk.length - base64chunk.length % 4; + chunks.push(Buffer.from(base64chunk.slice(0, end), "base64")); + base64chunk = base64chunk.slice(end); }); - }); - } - let errbuffer = ""; - if (cp.stderr) { - cp.stderr.on("data", (data) => { - state.processStderr = true; - if (this.options.listeners && this.options.listeners.stderr) { - this.options.listeners.stderr(data); - } - if (!optionsNonNull.silent && optionsNonNull.errStream && optionsNonNull.outStream) { - const s2 = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; - s2.write(data); - } - errbuffer = this._processLineBuffer(data, errbuffer, (line) => { - if (this.options.listeners && this.options.listeners.errline) { - this.options.listeners.errline(line); - } + value.on("end", () => { + chunks.push(Buffer.from(base64chunk, "base64")); + responseFormData.append(name2, new File(chunks, filename, { type: mimeType })); }); - }); - } - cp.on("error", (err) => { - state.processError = err.message; - state.processExited = true; - state.processClosed = true; - state.CheckComplete(); - }); - cp.on("exit", (code) => { - state.processExitCode = code; - state.processExited = true; - this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); - state.CheckComplete(); - }); - cp.on("close", (code) => { - state.processExitCode = code; - state.processExited = true; - state.processClosed = true; - this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); - state.CheckComplete(); - }); - state.on("done", (error, exitCode) => { - if (stdbuffer.length > 0) { - this.emit("stdline", stdbuffer); - } - if (errbuffer.length > 0) { - this.emit("errline", errbuffer); - } - cp.removeAllListeners(); - if (error) { - reject(error); } else { - resolve2(exitCode); + value.on("data", (chunk) => { + chunks.push(chunk); + }); + value.on("end", () => { + responseFormData.append(name2, new File(chunks, filename, { type: mimeType })); + }); } }); - if (this.options.input) { - if (!cp.stdin) { - throw new Error("child process missing stdin"); + const busboyResolve = new Promise((resolve2, reject) => { + busboy.on("finish", resolve2); + busboy.on("error", (err) => reject(new TypeError(err))); + }); + if (this.body !== null) + for await (const chunk of consumeBody2(this[kState].body)) + busboy.write(chunk); + busboy.end(); + await busboyResolve; + return responseFormData; + } else if (/application\/x-www-form-urlencoded/.test(contentType2)) { + let entries; + try { + let text = ""; + const textDecoder = new TextDecoder("utf-8", { ignoreBOM: true }); + for await (const chunk of consumeBody2(this[kState].body)) { + if (!isUint8Array(chunk)) { + throw new TypeError("Expected Uint8Array chunk"); + } + text += textDecoder.decode(chunk, { stream: true }); } - cp.stdin.end(this.options.input); + text += textDecoder.decode(); + entries = new URLSearchParams(text); + } catch (err) { + throw Object.assign(new TypeError(), { cause: err }); } - })); - }); - } - }; - exports.ToolRunner = ToolRunner; - function argStringToArray(argString) { - const args = []; - let inQuotes = false; - let escaped = false; - let arg = ""; - function append(c2) { - if (escaped && c2 !== '"') { - arg += "\\"; - } - arg += c2; - escaped = false; - } - for (let i2 = 0; i2 < argString.length; i2++) { - const c2 = argString.charAt(i2); - if (c2 === '"') { - if (!escaped) { - inQuotes = !inQuotes; + const formData = new FormData2(); + for (const [name2, value] of entries) { + formData.append(name2, value); + } + return formData; } else { - append(c2); + await Promise.resolve(); + throwIfAborted(this[kState]); + throw webidl.errors.exception({ + header: `${instance.name}.formData`, + message: "Could not parse content as FormData." + }); } - continue; } - if (c2 === "\\" && escaped) { - append(c2); - continue; + }; + return methods; + } + function mixinBody(prototype) { + Object.assign(prototype.prototype, bodyMixinMethods(prototype)); + } + async function specConsumeBody(object, convertBytesToJSValue, instance) { + webidl.brandCheck(object, instance); + throwIfAborted(object[kState]); + if (bodyUnusable(object[kState].body)) { + throw new TypeError("Body is unusable"); + } + const promise = createDeferredPromise(); + const errorSteps = (error) => promise.reject(error); + const successSteps = (data) => { + try { + promise.resolve(convertBytesToJSValue(data)); + } catch (e2) { + errorSteps(e2); } - if (c2 === "\\" && inQuotes) { - escaped = true; - continue; + }; + if (object[kState].body == null) { + successSteps(new Uint8Array()); + return promise.promise; + } + await fullyReadBody(object[kState].body, successSteps, errorSteps); + return promise.promise; + } + function bodyUnusable(body2) { + return body2 != null && (body2.stream.locked || util3.isDisturbed(body2.stream)); + } + function utf8DecodeBytes(buffer) { + if (buffer.length === 0) { + return ""; + } + if (buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191) { + buffer = buffer.subarray(3); + } + const output = new TextDecoder().decode(buffer); + return output; + } + function parseJSONFromBytes(bytes) { + return JSON.parse(utf8DecodeBytes(bytes)); + } + function bodyMimeType(object) { + const { headersList } = object[kState]; + const contentType2 = headersList.get("content-type"); + if (contentType2 === null) { + return "failure"; + } + return parseMIMEType(contentType2); + } + module.exports = { + extractBody, + safelyExtractBody, + cloneBody, + mixinBody + }; + } +}); + +// node_modules/undici/lib/core/request.js +var require_request = __commonJS({ + "node_modules/undici/lib/core/request.js"(exports, module) { + "use strict"; + var { + InvalidArgumentError, + NotSupportedError + } = require_errors(); + var assert = __require("assert"); + var { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = require_symbols(); + var util3 = require_util(); + var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; + var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; + var invalidPathRegex = /[^\u0021-\u00ff]/; + var kHandler = Symbol("handler"); + var channels = {}; + var extractBody; + try { + const diagnosticsChannel = __require("diagnostics_channel"); + channels.create = diagnosticsChannel.channel("undici:request:create"); + channels.bodySent = diagnosticsChannel.channel("undici:request:bodySent"); + channels.headers = diagnosticsChannel.channel("undici:request:headers"); + channels.trailers = diagnosticsChannel.channel("undici:request:trailers"); + channels.error = diagnosticsChannel.channel("undici:request:error"); + } catch { + channels.create = { hasSubscribers: false }; + channels.bodySent = { hasSubscribers: false }; + channels.headers = { hasSubscribers: false }; + channels.trailers = { hasSubscribers: false }; + channels.error = { hasSubscribers: false }; + } + var Request2 = class _Request { + constructor(origin, { + path: path14, + method, + body: body2, + headers, + query, + idempotent, + blocking, + upgrade, + headersTimeout, + bodyTimeout, + reset, + throwOnError, + expectContinue + }, handler) { + if (typeof path14 !== "string") { + throw new InvalidArgumentError("path must be a string"); + } else if (path14[0] !== "/" && !(path14.startsWith("http://") || path14.startsWith("https://")) && method !== "CONNECT") { + throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); + } else if (invalidPathRegex.exec(path14) !== null) { + throw new InvalidArgumentError("invalid request path"); + } + if (typeof method !== "string") { + throw new InvalidArgumentError("method must be a string"); + } else if (tokenRegExp.exec(method) === null) { + throw new InvalidArgumentError("invalid request method"); + } + if (upgrade && typeof upgrade !== "string") { + throw new InvalidArgumentError("upgrade must be a string"); + } + if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) { + throw new InvalidArgumentError("invalid headersTimeout"); + } + if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) { + throw new InvalidArgumentError("invalid bodyTimeout"); + } + if (reset != null && typeof reset !== "boolean") { + throw new InvalidArgumentError("invalid reset"); + } + if (expectContinue != null && typeof expectContinue !== "boolean") { + throw new InvalidArgumentError("invalid expectContinue"); + } + this.headersTimeout = headersTimeout; + this.bodyTimeout = bodyTimeout; + this.throwOnError = throwOnError === true; + this.method = method; + if (body2 == null) { + this.body = null; + } else if (util3.isStream(body2)) { + this.body = body2; + } else if (util3.isBuffer(body2)) { + this.body = body2.byteLength ? body2 : null; + } else if (ArrayBuffer.isView(body2)) { + this.body = body2.buffer.byteLength ? Buffer.from(body2.buffer, body2.byteOffset, body2.byteLength) : null; + } else if (body2 instanceof ArrayBuffer) { + this.body = body2.byteLength ? Buffer.from(body2) : null; + } else if (typeof body2 === "string") { + this.body = body2.length ? Buffer.from(body2) : null; + } else if (util3.isFormDataLike(body2) || util3.isIterable(body2) || util3.isBlobLike(body2)) { + this.body = body2; + } else { + throw new InvalidArgumentError("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable"); + } + this.completed = false; + this.aborted = false; + this.upgrade = upgrade || null; + this.path = query ? util3.buildURL(path14, query) : path14; + this.origin = origin; + this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; + this.blocking = blocking == null ? false : blocking; + this.reset = reset == null ? null : reset; + this.host = null; + this.contentLength = null; + this.contentType = null; + this.headers = ""; + this.expectContinue = expectContinue != null ? expectContinue : false; + if (Array.isArray(headers)) { + if (headers.length % 2 !== 0) { + throw new InvalidArgumentError("headers array must be even"); + } + for (let i2 = 0; i2 < headers.length; i2 += 2) { + processHeader(this, headers[i2], headers[i2 + 1]); + } + } else if (headers && typeof headers === "object") { + const keys = Object.keys(headers); + for (let i2 = 0; i2 < keys.length; i2++) { + const key = keys[i2]; + processHeader(this, key, headers[key]); + } + } else if (headers != null) { + throw new InvalidArgumentError("headers must be an object or an array"); + } + if (util3.isFormDataLike(this.body)) { + if (util3.nodeMajor < 16 || util3.nodeMajor === 16 && util3.nodeMinor < 8) { + throw new InvalidArgumentError("Form-Data bodies are only supported in node v16.8 and newer."); + } + if (!extractBody) { + extractBody = require_body().extractBody; + } + const [bodyStream, contentType2] = extractBody(body2); + if (this.contentType == null) { + this.contentType = contentType2; + this.headers += `content-type: ${contentType2}\r +`; + } + this.body = bodyStream.stream; + this.contentLength = bodyStream.length; + } else if (util3.isBlobLike(body2) && this.contentType == null && body2.type) { + this.contentType = body2.type; + this.headers += `content-type: ${body2.type}\r +`; } - if (c2 === " " && !inQuotes) { - if (arg.length > 0) { - args.push(arg); - arg = ""; + util3.validateHandler(handler, method, upgrade); + this.servername = util3.getServerName(this.host); + this[kHandler] = handler; + if (channels.create.hasSubscribers) { + channels.create.publish({ request: this }); + } + } + onBodySent(chunk) { + if (this[kHandler].onBodySent) { + try { + this[kHandler].onBodySent(chunk); + } catch (err) { + this.onError(err); } - continue; } - append(c2); } - if (arg.length > 0) { - args.push(arg.trim()); + onRequestSent() { + if (channels.bodySent.hasSubscribers) { + channels.bodySent.publish({ request: this }); + } } - return args; - } - exports.argStringToArray = argStringToArray; - var ExecState = class _ExecState extends events.EventEmitter { - constructor(options, toolPath) { - super(); - this.processClosed = false; - this.processError = ""; - this.processExitCode = 0; - this.processExited = false; - this.processStderr = false; - this.delay = 1e4; - this.done = false; - this.timeout = null; - if (!toolPath) { - throw new Error("toolPath must not be empty"); + onConnect(abort) { + assert(!this.aborted); + assert(!this.completed); + return this[kHandler].onConnect(abort); + } + onHeaders(statusCode, headers, resume, statusText) { + assert(!this.aborted); + assert(!this.completed); + if (channels.headers.hasSubscribers) { + channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }); } - this.options = options; - this.toolPath = toolPath; - if (options.delay) { - this.delay = options.delay; + return this[kHandler].onHeaders(statusCode, headers, resume, statusText); + } + onData(chunk) { + assert(!this.aborted); + assert(!this.completed); + return this[kHandler].onData(chunk); + } + onUpgrade(statusCode, headers, socket) { + assert(!this.aborted); + assert(!this.completed); + return this[kHandler].onUpgrade(statusCode, headers, socket); + } + onComplete(trailers) { + assert(!this.aborted); + this.completed = true; + if (channels.trailers.hasSubscribers) { + channels.trailers.publish({ request: this, trailers }); } + return this[kHandler].onComplete(trailers); } - CheckComplete() { - if (this.done) { - return; + onError(error) { + if (channels.error.hasSubscribers) { + channels.error.publish({ request: this, error }); } - if (this.processClosed) { - this._setResult(); - } else if (this.processExited) { - this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); + if (this.aborted) { + return; } + this.aborted = true; + return this[kHandler].onError(error); } - _debug(message) { - this.emit("debug", message); + // TODO: adjust to support H2 + addHeader(key, value) { + processHeader(this, key, value); + return this; } - _setResult() { - let error; - if (this.processExited) { - if (this.processError) { - error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); - } else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { - error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); - } else if (this.processStderr && this.options.failOnStdErr) { - error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + static [kHTTP1BuildRequest](origin, opts, handler) { + return new _Request(origin, opts, handler); + } + static [kHTTP2BuildRequest](origin, opts, handler) { + const headers = opts.headers; + opts = { ...opts, headers: null }; + const request = new _Request(origin, opts, handler); + request.headers = {}; + if (Array.isArray(headers)) { + if (headers.length % 2 !== 0) { + throw new InvalidArgumentError("headers array must be even"); + } + for (let i2 = 0; i2 < headers.length; i2 += 2) { + processHeader(request, headers[i2], headers[i2 + 1], true); } + } else if (headers && typeof headers === "object") { + const keys = Object.keys(headers); + for (let i2 = 0; i2 < keys.length; i2++) { + const key = keys[i2]; + processHeader(request, key, headers[key], true); + } + } else if (headers != null) { + throw new InvalidArgumentError("headers must be an object or an array"); } - if (this.timeout) { - clearTimeout(this.timeout); - this.timeout = null; + return request; + } + static [kHTTP2CopyHeaders](raw) { + const rawHeaders = raw.split("\r\n"); + const headers = {}; + for (const header of rawHeaders) { + const [key, value] = header.split(": "); + if (value == null || value.length === 0) + continue; + if (headers[key]) + headers[key] += `,${value}`; + else + headers[key] = value; } - this.done = true; - this.emit("done", error, this.processExitCode); + return headers; } - static HandleTimeout(state) { - if (state.done) { - return; + }; + function processHeaderValue(key, val, skipAppend) { + if (val && typeof val === "object") { + throw new InvalidArgumentError(`invalid ${key} header`); + } + val = val != null ? `${val}` : ""; + if (headerCharRegex.exec(val) !== null) { + throw new InvalidArgumentError(`invalid ${key} header`); + } + return skipAppend ? val : `${key}: ${val}\r +`; + } + function processHeader(request, key, val, skipAppend = false) { + if (val && (typeof val === "object" && !Array.isArray(val))) { + throw new InvalidArgumentError(`invalid ${key} header`); + } else if (val === void 0) { + return; + } + if (request.host === null && key.length === 4 && key.toLowerCase() === "host") { + if (headerCharRegex.exec(val) !== null) { + throw new InvalidArgumentError(`invalid ${key} header`); } - if (!state.processClosed && state.processExited) { - const message = `The STDIO streams did not close within ${state.delay / 1e3} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; - state._debug(message); + request.host = val; + } else if (request.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { + request.contentLength = parseInt(val, 10); + if (!Number.isFinite(request.contentLength)) { + throw new InvalidArgumentError("invalid content-length header"); + } + } else if (request.contentType === null && key.length === 12 && key.toLowerCase() === "content-type") { + request.contentType = val; + if (skipAppend) + request.headers[key] = processHeaderValue(key, val, skipAppend); + else + request.headers += processHeaderValue(key, val); + } else if (key.length === 17 && key.toLowerCase() === "transfer-encoding") { + throw new InvalidArgumentError("invalid transfer-encoding header"); + } else if (key.length === 10 && key.toLowerCase() === "connection") { + const value = typeof val === "string" ? val.toLowerCase() : null; + if (value !== "close" && value !== "keep-alive") { + throw new InvalidArgumentError("invalid connection header"); + } else if (value === "close") { + request.reset = true; + } + } else if (key.length === 10 && key.toLowerCase() === "keep-alive") { + throw new InvalidArgumentError("invalid keep-alive header"); + } else if (key.length === 7 && key.toLowerCase() === "upgrade") { + throw new InvalidArgumentError("invalid upgrade header"); + } else if (key.length === 6 && key.toLowerCase() === "expect") { + throw new NotSupportedError("expect header not supported"); + } else if (tokenRegExp.exec(key) === null) { + throw new InvalidArgumentError("invalid header key"); + } else { + if (Array.isArray(val)) { + for (let i2 = 0; i2 < val.length; i2++) { + if (skipAppend) { + if (request.headers[key]) + request.headers[key] += `,${processHeaderValue(key, val[i2], skipAppend)}`; + else + request.headers[key] = processHeaderValue(key, val[i2], skipAppend); + } else { + request.headers += processHeaderValue(key, val[i2]); + } + } + } else { + if (skipAppend) + request.headers[key] = processHeaderValue(key, val, skipAppend); + else + request.headers += processHeaderValue(key, val); } - state._setResult(); } - }; + } + module.exports = Request2; } }); -// node_modules/@actions/exec/lib/exec.js -var require_exec = __commonJS({ - "node_modules/@actions/exec/lib/exec.js"(exports) { +// node_modules/undici/lib/dispatcher.js +var require_dispatcher = __commonJS({ + "node_modules/undici/lib/dispatcher.js"(exports, module) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - Object.defineProperty(o2, k22, { enumerable: true, get: function() { - return m3[k2]; - } }); - } : function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - o2[k22] = m3[k2]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { - Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); - } : function(o2, v2) { - o2["default"] = v2; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k2 in mod) - if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) - __createBinding(result, mod, k2); + var EventEmitter3 = __require("events"); + var Dispatcher = class extends EventEmitter3 { + dispatch() { + throw new Error("not implemented"); + } + close() { + throw new Error("not implemented"); + } + destroy() { + throw new Error("not implemented"); } - __setModuleDefault(result, mod); - return result; }; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve2) { - resolve2(value); + module.exports = Dispatcher; + } +}); + +// node_modules/undici/lib/dispatcher-base.js +var require_dispatcher_base = __commonJS({ + "node_modules/undici/lib/dispatcher-base.js"(exports, module) { + "use strict"; + var Dispatcher = require_dispatcher(); + var { + ClientDestroyedError, + ClientClosedError, + InvalidArgumentError + } = require_errors(); + var { kDestroy, kClose, kDispatch, kInterceptors } = require_symbols(); + var kDestroyed = Symbol("destroyed"); + var kClosed = Symbol("closed"); + var kOnDestroyed = Symbol("onDestroyed"); + var kOnClosed = Symbol("onClosed"); + var kInterceptedDispatch = Symbol("Intercepted Dispatch"); + var DispatcherBase = class extends Dispatcher { + constructor() { + super(); + this[kDestroyed] = false; + this[kOnDestroyed] = null; + this[kClosed] = false; + this[kOnClosed] = []; + } + get destroyed() { + return this[kDestroyed]; + } + get closed() { + return this[kClosed]; + } + get interceptors() { + return this[kInterceptors]; + } + set interceptors(newInterceptors) { + if (newInterceptors) { + for (let i2 = newInterceptors.length - 1; i2 >= 0; i2--) { + const interceptor = this[kInterceptors][i2]; + if (typeof interceptor !== "function") { + throw new InvalidArgumentError("interceptor must be an function"); + } + } + } + this[kInterceptors] = newInterceptors; + } + close(callback) { + if (callback === void 0) { + return new Promise((resolve2, reject) => { + this.close((err, data) => { + return err ? reject(err) : resolve2(data); + }); + }); + } + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); + } + if (this[kDestroyed]) { + queueMicrotask(() => callback(new ClientDestroyedError(), null)); + return; + } + if (this[kClosed]) { + if (this[kOnClosed]) { + this[kOnClosed].push(callback); + } else { + queueMicrotask(() => callback(null, null)); + } + return; + } + this[kClosed] = true; + this[kOnClosed].push(callback); + const onClosed = () => { + const callbacks = this[kOnClosed]; + this[kOnClosed] = null; + for (let i2 = 0; i2 < callbacks.length; i2++) { + callbacks[i2](null, null); + } + }; + this[kClose]().then(() => this.destroy()).then(() => { + queueMicrotask(onClosed); }); } - return new (P2 || (P2 = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e2) { - reject(e2); + destroy(err, callback) { + if (typeof err === "function") { + callback = err; + err = null; + } + if (callback === void 0) { + return new Promise((resolve2, reject) => { + this.destroy(err, (err2, data) => { + return err2 ? ( + /* istanbul ignore next: should never error */ + reject(err2) + ) : resolve2(data); + }); + }); + } + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); + } + if (this[kDestroyed]) { + if (this[kOnDestroyed]) { + this[kOnDestroyed].push(callback); + } else { + queueMicrotask(() => callback(null, null)); } + return; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e2) { - reject(e2); + if (!err) { + err = new ClientDestroyedError(); + } + this[kDestroyed] = true; + this[kOnDestroyed] = this[kOnDestroyed] || []; + this[kOnDestroyed].push(callback); + const onDestroyed = () => { + const callbacks = this[kOnDestroyed]; + this[kOnDestroyed] = null; + for (let i2 = 0; i2 < callbacks.length; i2++) { + callbacks[i2](null, null); } + }; + this[kDestroy](err).then(() => { + queueMicrotask(onDestroyed); + }); + } + [kInterceptedDispatch](opts, handler) { + if (!this[kInterceptors] || this[kInterceptors].length === 0) { + this[kInterceptedDispatch] = this[kDispatch]; + return this[kDispatch](opts, handler); } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + let dispatch = this[kDispatch].bind(this); + for (let i2 = this[kInterceptors].length - 1; i2 >= 0; i2--) { + dispatch = this[kInterceptors][i2](dispatch); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + this[kInterceptedDispatch] = dispatch; + return dispatch(opts, handler); + } + dispatch(opts, handler) { + if (!handler || typeof handler !== "object") { + throw new InvalidArgumentError("handler must be an object"); + } + try { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("opts must be an object."); + } + if (this[kDestroyed] || this[kOnDestroyed]) { + throw new ClientDestroyedError(); + } + if (this[kClosed]) { + throw new ClientClosedError(); + } + return this[kInterceptedDispatch](opts, handler); + } catch (err) { + if (typeof handler.onError !== "function") { + throw new InvalidArgumentError("invalid onError method"); + } + handler.onError(err); + return false; + } + } }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getExecOutput = exports.exec = void 0; - var string_decoder_1 = __require("string_decoder"); - var tr2 = __importStar(require_toolrunner()); - function exec2(commandLine, args, options) { - return __awaiter(this, void 0, void 0, function* () { - const commandArgs = tr2.argStringToArray(commandLine); - if (commandArgs.length === 0) { - throw new Error(`Parameter 'commandLine' cannot be null or empty.`); + module.exports = DispatcherBase; + } +}); + +// node_modules/undici/lib/core/connect.js +var require_connect = __commonJS({ + "node_modules/undici/lib/core/connect.js"(exports, module) { + "use strict"; + var net = __require("net"); + var assert = __require("assert"); + var util3 = require_util(); + var { InvalidArgumentError, ConnectTimeoutError } = require_errors(); + var tls; + var SessionCache; + if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) { + SessionCache = class WeakSessionCache { + constructor(maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions; + this._sessionCache = /* @__PURE__ */ new Map(); + this._sessionRegistry = new global.FinalizationRegistry((key) => { + if (this._sessionCache.size < this._maxCachedSessions) { + return; + } + const ref = this._sessionCache.get(key); + if (ref !== void 0 && ref.deref() === void 0) { + this._sessionCache.delete(key); + } + }); } - const toolPath = commandArgs[0]; - args = commandArgs.slice(1).concat(args || []); - const runner = new tr2.ToolRunner(toolPath, args, options); - return runner.exec(); - }); + get(sessionKey) { + const ref = this._sessionCache.get(sessionKey); + return ref ? ref.deref() : null; + } + set(sessionKey, session) { + if (this._maxCachedSessions === 0) { + return; + } + this._sessionCache.set(sessionKey, new WeakRef(session)); + this._sessionRegistry.register(session, sessionKey); + } + }; + } else { + SessionCache = class SimpleSessionCache { + constructor(maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions; + this._sessionCache = /* @__PURE__ */ new Map(); + } + get(sessionKey) { + return this._sessionCache.get(sessionKey); + } + set(sessionKey, session) { + if (this._maxCachedSessions === 0) { + return; + } + if (this._sessionCache.size >= this._maxCachedSessions) { + const { value: oldestKey } = this._sessionCache.keys().next(); + this._sessionCache.delete(oldestKey); + } + this._sessionCache.set(sessionKey, session); + } + }; } - exports.exec = exec2; - function getExecOutput2(commandLine, args, options) { - var _a2, _b; - return __awaiter(this, void 0, void 0, function* () { - let stdout = ""; - let stderr = ""; - const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); - const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); - const originalStdoutListener = (_a2 = options === null || options === void 0 ? void 0 : options.listeners) === null || _a2 === void 0 ? void 0 : _a2.stdout; - const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; - const stdErrListener = (data) => { - stderr += stderrDecoder.write(data); - if (originalStdErrListener) { - originalStdErrListener(data); + function buildConnector({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) { + if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { + throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero"); + } + const options = { path: socketPath, ...opts }; + const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions); + timeout = timeout == null ? 1e4 : timeout; + allowH2 = allowH2 != null ? allowH2 : false; + return function connect({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { + let socket; + if (protocol === "https:") { + if (!tls) { + tls = __require("tls"); + } + servername = servername || options.servername || util3.getServerName(host) || null; + const sessionKey = servername || hostname; + const session = sessionCache.get(sessionKey) || null; + assert(sessionKey); + socket = tls.connect({ + highWaterMark: 16384, + // TLS in node can't have bigger HWM anyway... + ...options, + servername, + session, + localAddress, + // TODO(HTTP/2): Add support for h2c + ALPNProtocols: allowH2 ? ["http/1.1", "h2"] : ["http/1.1"], + socket: httpSocket, + // upgrade socket connection + port: port || 443, + host: hostname + }); + socket.on("session", function(session2) { + sessionCache.set(sessionKey, session2); + }); + } else { + assert(!httpSocket, "httpSocket can only be sent on TLS update"); + socket = net.connect({ + highWaterMark: 64 * 1024, + // Same as nodejs fs streams. + ...options, + localAddress, + port: port || 80, + host: hostname + }); + } + if (options.keepAlive == null || options.keepAlive) { + const keepAliveInitialDelay = options.keepAliveInitialDelay === void 0 ? 6e4 : options.keepAliveInitialDelay; + socket.setKeepAlive(true, keepAliveInitialDelay); + } + const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout); + socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() { + cancelTimeout(); + if (callback) { + const cb = callback; + callback = null; + cb(null, this); + } + }).on("error", function(err) { + cancelTimeout(); + if (callback) { + const cb = callback; + callback = null; + cb(err); } + }); + return socket; + }; + } + function setupTimeout(onConnectTimeout2, timeout) { + if (!timeout) { + return () => { }; - const stdOutListener = (data) => { - stdout += stdoutDecoder.write(data); - if (originalStdoutListener) { - originalStdoutListener(data); + } + let s1 = null; + let s2 = null; + const timeoutId = setTimeout(() => { + s1 = setImmediate(() => { + if (process.platform === "win32") { + s2 = setImmediate(() => onConnectTimeout2()); + } else { + onConnectTimeout2(); } - }; - const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { - exitCode, - stdout, - stderr - }; + }); + }, timeout); + return () => { + clearTimeout(timeoutId); + clearImmediate(s1); + clearImmediate(s2); + }; + } + function onConnectTimeout(socket) { + util3.destroy(socket, new ConnectTimeoutError()); + } + module.exports = buildConnector; + } +}); + +// node_modules/undici/lib/llhttp/utils.js +var require_utils2 = __commonJS({ + "node_modules/undici/lib/llhttp/utils.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.enumToMap = void 0; + function enumToMap(obj) { + const res = {}; + Object.keys(obj).forEach((key) => { + const value = obj[key]; + if (typeof value === "number") { + res[key] = value; + } }); + return res; } - exports.getExecOutput = getExecOutput2; + exports.enumToMap = enumToMap; } }); -// node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper = __commonJS({ - "node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports) { +// node_modules/undici/lib/llhttp/constants.js +var require_constants2 = __commonJS({ + "node_modules/undici/lib/llhttp/constants.js"(exports) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - Object.defineProperty(o2, k22, { enumerable: true, get: function() { - return m3[k2]; - } }); - } : function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - o2[k22] = m3[k2]; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; + var utils_1 = require_utils2(); + var ERROR; + (function(ERROR2) { + ERROR2[ERROR2["OK"] = 0] = "OK"; + ERROR2[ERROR2["INTERNAL"] = 1] = "INTERNAL"; + ERROR2[ERROR2["STRICT"] = 2] = "STRICT"; + ERROR2[ERROR2["LF_EXPECTED"] = 3] = "LF_EXPECTED"; + ERROR2[ERROR2["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; + ERROR2[ERROR2["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; + ERROR2[ERROR2["INVALID_METHOD"] = 6] = "INVALID_METHOD"; + ERROR2[ERROR2["INVALID_URL"] = 7] = "INVALID_URL"; + ERROR2[ERROR2["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; + ERROR2[ERROR2["INVALID_VERSION"] = 9] = "INVALID_VERSION"; + ERROR2[ERROR2["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; + ERROR2[ERROR2["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; + ERROR2[ERROR2["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; + ERROR2[ERROR2["INVALID_STATUS"] = 13] = "INVALID_STATUS"; + ERROR2[ERROR2["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; + ERROR2[ERROR2["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; + ERROR2[ERROR2["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; + ERROR2[ERROR2["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; + ERROR2[ERROR2["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; + ERROR2[ERROR2["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; + ERROR2[ERROR2["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; + ERROR2[ERROR2["PAUSED"] = 21] = "PAUSED"; + ERROR2[ERROR2["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; + ERROR2[ERROR2["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; + ERROR2[ERROR2["USER"] = 24] = "USER"; + })(ERROR = exports.ERROR || (exports.ERROR = {})); + var TYPE2; + (function(TYPE3) { + TYPE3[TYPE3["BOTH"] = 0] = "BOTH"; + TYPE3[TYPE3["REQUEST"] = 1] = "REQUEST"; + TYPE3[TYPE3["RESPONSE"] = 2] = "RESPONSE"; + })(TYPE2 = exports.TYPE || (exports.TYPE = {})); + var FLAGS; + (function(FLAGS2) { + FLAGS2[FLAGS2["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE"; + FLAGS2[FLAGS2["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE"; + FLAGS2[FLAGS2["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE"; + FLAGS2[FLAGS2["CHUNKED"] = 8] = "CHUNKED"; + FLAGS2[FLAGS2["UPGRADE"] = 16] = "UPGRADE"; + FLAGS2[FLAGS2["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH"; + FLAGS2[FLAGS2["SKIPBODY"] = 64] = "SKIPBODY"; + FLAGS2[FLAGS2["TRAILING"] = 128] = "TRAILING"; + FLAGS2[FLAGS2["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING"; + })(FLAGS = exports.FLAGS || (exports.FLAGS = {})); + var LENIENT_FLAGS; + (function(LENIENT_FLAGS2) { + LENIENT_FLAGS2[LENIENT_FLAGS2["HEADERS"] = 1] = "HEADERS"; + LENIENT_FLAGS2[LENIENT_FLAGS2["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH"; + LENIENT_FLAGS2[LENIENT_FLAGS2["KEEP_ALIVE"] = 4] = "KEEP_ALIVE"; + })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {})); + var METHODS; + (function(METHODS2) { + METHODS2[METHODS2["DELETE"] = 0] = "DELETE"; + METHODS2[METHODS2["GET"] = 1] = "GET"; + METHODS2[METHODS2["HEAD"] = 2] = "HEAD"; + METHODS2[METHODS2["POST"] = 3] = "POST"; + METHODS2[METHODS2["PUT"] = 4] = "PUT"; + METHODS2[METHODS2["CONNECT"] = 5] = "CONNECT"; + METHODS2[METHODS2["OPTIONS"] = 6] = "OPTIONS"; + METHODS2[METHODS2["TRACE"] = 7] = "TRACE"; + METHODS2[METHODS2["COPY"] = 8] = "COPY"; + METHODS2[METHODS2["LOCK"] = 9] = "LOCK"; + METHODS2[METHODS2["MKCOL"] = 10] = "MKCOL"; + METHODS2[METHODS2["MOVE"] = 11] = "MOVE"; + METHODS2[METHODS2["PROPFIND"] = 12] = "PROPFIND"; + METHODS2[METHODS2["PROPPATCH"] = 13] = "PROPPATCH"; + METHODS2[METHODS2["SEARCH"] = 14] = "SEARCH"; + METHODS2[METHODS2["UNLOCK"] = 15] = "UNLOCK"; + METHODS2[METHODS2["BIND"] = 16] = "BIND"; + METHODS2[METHODS2["REBIND"] = 17] = "REBIND"; + METHODS2[METHODS2["UNBIND"] = 18] = "UNBIND"; + METHODS2[METHODS2["ACL"] = 19] = "ACL"; + METHODS2[METHODS2["REPORT"] = 20] = "REPORT"; + METHODS2[METHODS2["MKACTIVITY"] = 21] = "MKACTIVITY"; + METHODS2[METHODS2["CHECKOUT"] = 22] = "CHECKOUT"; + METHODS2[METHODS2["MERGE"] = 23] = "MERGE"; + METHODS2[METHODS2["M-SEARCH"] = 24] = "M-SEARCH"; + METHODS2[METHODS2["NOTIFY"] = 25] = "NOTIFY"; + METHODS2[METHODS2["SUBSCRIBE"] = 26] = "SUBSCRIBE"; + METHODS2[METHODS2["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; + METHODS2[METHODS2["PATCH"] = 28] = "PATCH"; + METHODS2[METHODS2["PURGE"] = 29] = "PURGE"; + METHODS2[METHODS2["MKCALENDAR"] = 30] = "MKCALENDAR"; + METHODS2[METHODS2["LINK"] = 31] = "LINK"; + METHODS2[METHODS2["UNLINK"] = 32] = "UNLINK"; + METHODS2[METHODS2["SOURCE"] = 33] = "SOURCE"; + METHODS2[METHODS2["PRI"] = 34] = "PRI"; + METHODS2[METHODS2["DESCRIBE"] = 35] = "DESCRIBE"; + METHODS2[METHODS2["ANNOUNCE"] = 36] = "ANNOUNCE"; + METHODS2[METHODS2["SETUP"] = 37] = "SETUP"; + METHODS2[METHODS2["PLAY"] = 38] = "PLAY"; + METHODS2[METHODS2["PAUSE"] = 39] = "PAUSE"; + METHODS2[METHODS2["TEARDOWN"] = 40] = "TEARDOWN"; + METHODS2[METHODS2["GET_PARAMETER"] = 41] = "GET_PARAMETER"; + METHODS2[METHODS2["SET_PARAMETER"] = 42] = "SET_PARAMETER"; + METHODS2[METHODS2["REDIRECT"] = 43] = "REDIRECT"; + METHODS2[METHODS2["RECORD"] = 44] = "RECORD"; + METHODS2[METHODS2["FLUSH"] = 45] = "FLUSH"; + })(METHODS = exports.METHODS || (exports.METHODS = {})); + exports.METHODS_HTTP = [ + METHODS.DELETE, + METHODS.GET, + METHODS.HEAD, + METHODS.POST, + METHODS.PUT, + METHODS.CONNECT, + METHODS.OPTIONS, + METHODS.TRACE, + METHODS.COPY, + METHODS.LOCK, + METHODS.MKCOL, + METHODS.MOVE, + METHODS.PROPFIND, + METHODS.PROPPATCH, + METHODS.SEARCH, + METHODS.UNLOCK, + METHODS.BIND, + METHODS.REBIND, + METHODS.UNBIND, + METHODS.ACL, + METHODS.REPORT, + METHODS.MKACTIVITY, + METHODS.CHECKOUT, + METHODS.MERGE, + METHODS["M-SEARCH"], + METHODS.NOTIFY, + METHODS.SUBSCRIBE, + METHODS.UNSUBSCRIBE, + METHODS.PATCH, + METHODS.PURGE, + METHODS.MKCALENDAR, + METHODS.LINK, + METHODS.UNLINK, + METHODS.PRI, + // TODO(indutny): should we allow it with HTTP? + METHODS.SOURCE + ]; + exports.METHODS_ICE = [ + METHODS.SOURCE + ]; + exports.METHODS_RTSP = [ + METHODS.OPTIONS, + METHODS.DESCRIBE, + METHODS.ANNOUNCE, + METHODS.SETUP, + METHODS.PLAY, + METHODS.PAUSE, + METHODS.TEARDOWN, + METHODS.GET_PARAMETER, + METHODS.SET_PARAMETER, + METHODS.REDIRECT, + METHODS.RECORD, + METHODS.FLUSH, + // For AirPlay + METHODS.GET, + METHODS.POST + ]; + exports.METHOD_MAP = utils_1.enumToMap(METHODS); + exports.H_METHOD_MAP = {}; + Object.keys(exports.METHOD_MAP).forEach((key) => { + if (/^H/.test(key)) { + exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key]; + } }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { - Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); - } : function(o2, v2) { - o2["default"] = v2; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k2 in mod) - if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) - __createBinding(result, mod, k2); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getOptions = void 0; - var core2 = __importStar(require_core()); - function getOptions(copy) { - const result = { - followSymbolicLinks: true, - implicitDescendants: true, - omitBrokenSymbolicLinks: true - }; - if (copy) { - if (typeof copy.followSymbolicLinks === "boolean") { - result.followSymbolicLinks = copy.followSymbolicLinks; - core2.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core2.debug(`implicitDescendants '${result.implicitDescendants}'`); - } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core2.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); - } + var FINISH; + (function(FINISH2) { + FINISH2[FINISH2["SAFE"] = 0] = "SAFE"; + FINISH2[FINISH2["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; + FINISH2[FINISH2["UNSAFE"] = 2] = "UNSAFE"; + })(FINISH = exports.FINISH || (exports.FINISH = {})); + exports.ALPHA = []; + for (let i2 = "A".charCodeAt(0); i2 <= "Z".charCodeAt(0); i2++) { + exports.ALPHA.push(String.fromCharCode(i2)); + exports.ALPHA.push(String.fromCharCode(i2 + 32)); + } + exports.NUM_MAP = { + 0: 0, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + 9: 9 + }; + exports.HEX_MAP = { + 0: 0, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + 9: 9, + A: 10, + B: 11, + C: 12, + D: 13, + E: 14, + F: 15, + a: 10, + b: 11, + c: 12, + d: 13, + e: 14, + f: 15 + }; + exports.NUM = [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9" + ]; + exports.ALPHANUM = exports.ALPHA.concat(exports.NUM); + exports.MARK = ["-", "_", ".", "!", "~", "*", "'", "(", ")"]; + exports.USERINFO_CHARS = exports.ALPHANUM.concat(exports.MARK).concat(["%", ";", ":", "&", "=", "+", "$", ","]); + exports.STRICT_URL_CHAR = [ + "!", + '"', + "$", + "%", + "&", + "'", + "(", + ")", + "*", + "+", + ",", + "-", + ".", + "/", + ":", + ";", + "<", + "=", + ">", + "@", + "[", + "\\", + "]", + "^", + "_", + "`", + "{", + "|", + "}", + "~" + ].concat(exports.ALPHANUM); + exports.URL_CHAR = exports.STRICT_URL_CHAR.concat([" ", "\f"]); + for (let i2 = 128; i2 <= 255; i2++) { + exports.URL_CHAR.push(i2); + } + exports.HEX = exports.NUM.concat(["a", "b", "c", "d", "e", "f", "A", "B", "C", "D", "E", "F"]); + exports.STRICT_TOKEN = [ + "!", + "#", + "$", + "%", + "&", + "'", + "*", + "+", + "-", + ".", + "^", + "_", + "`", + "|", + "~" + ].concat(exports.ALPHANUM); + exports.TOKEN = exports.STRICT_TOKEN.concat([" "]); + exports.HEADER_CHARS = [" "]; + for (let i2 = 32; i2 <= 255; i2++) { + if (i2 !== 127) { + exports.HEADER_CHARS.push(i2); } - return result; } - exports.getOptions = getOptions; + exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c2) => c2 !== 44); + exports.MAJOR = exports.NUM_MAP; + exports.MINOR = exports.MAJOR; + var HEADER_STATE; + (function(HEADER_STATE2) { + HEADER_STATE2[HEADER_STATE2["GENERAL"] = 0] = "GENERAL"; + HEADER_STATE2[HEADER_STATE2["CONNECTION"] = 1] = "CONNECTION"; + HEADER_STATE2[HEADER_STATE2["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; + HEADER_STATE2[HEADER_STATE2["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; + HEADER_STATE2[HEADER_STATE2["UPGRADE"] = 4] = "UPGRADE"; + HEADER_STATE2[HEADER_STATE2["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; + HEADER_STATE2[HEADER_STATE2["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; + HEADER_STATE2[HEADER_STATE2["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; + HEADER_STATE2[HEADER_STATE2["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; + })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {})); + exports.SPECIAL_HEADERS = { + "connection": HEADER_STATE.CONNECTION, + "content-length": HEADER_STATE.CONTENT_LENGTH, + "proxy-connection": HEADER_STATE.CONNECTION, + "transfer-encoding": HEADER_STATE.TRANSFER_ENCODING, + "upgrade": HEADER_STATE.UPGRADE + }; } }); -// node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper = __commonJS({ - "node_modules/@actions/glob/lib/internal-path-helper.js"(exports) { +// node_modules/undici/lib/handler/RedirectHandler.js +var require_RedirectHandler = __commonJS({ + "node_modules/undici/lib/handler/RedirectHandler.js"(exports, module) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - Object.defineProperty(o2, k22, { enumerable: true, get: function() { - return m3[k2]; - } }); - } : function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - o2[k22] = m3[k2]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { - Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); - } : function(o2, v2) { - o2["default"] = v2; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k2 in mod) - if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) - __createBinding(result, mod, k2); + var util3 = require_util(); + var { kBodyUsed } = require_symbols(); + var assert = __require("assert"); + var { InvalidArgumentError } = require_errors(); + var EE = __require("events"); + var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; + var kBody = Symbol("body"); + var BodyAsyncIterable = class { + constructor(body2) { + this[kBody] = body2; + this[kBodyUsed] = false; + } + async *[Symbol.asyncIterator]() { + assert(!this[kBodyUsed], "disturbed"); + this[kBodyUsed] = true; + yield* this[kBody]; + } + }; + var RedirectHandler = class { + constructor(dispatch, maxRedirections, opts, handler) { + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { + throw new InvalidArgumentError("maxRedirections must be a positive number"); + } + util3.validateHandler(handler, opts.method, opts.upgrade); + this.dispatch = dispatch; + this.location = null; + this.abort = null; + this.opts = { ...opts, maxRedirections: 0 }; + this.maxRedirections = maxRedirections; + this.handler = handler; + this.history = []; + if (util3.isStream(this.opts.body)) { + if (util3.bodyLength(this.opts.body) === 0) { + this.opts.body.on("data", function() { + assert(false); + }); + } + if (typeof this.opts.body.readableDidRead !== "boolean") { + this.opts.body[kBodyUsed] = false; + EE.prototype.on.call(this.opts.body, "data", function() { + this[kBodyUsed] = true; + }); + } + } else if (this.opts.body && typeof this.opts.body.pipeTo === "function") { + this.opts.body = new BodyAsyncIterable(this.opts.body); + } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util3.isIterable(this.opts.body)) { + this.opts.body = new BodyAsyncIterable(this.opts.body); + } } - __setModuleDefault(result, mod); - return result; - }; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.safeTrimTrailingSeparator = exports.normalizeSeparators = exports.hasRoot = exports.hasAbsoluteRoot = exports.ensureAbsoluteRoot = exports.dirname = void 0; - var path15 = __importStar(__require("path")); - var assert_1 = __importDefault(__require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname(p2) { - p2 = safeTrimTrailingSeparator(p2); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p2)) { - return p2; + onConnect(abort) { + this.abort = abort; + this.handler.onConnect(abort, { history: this.history }); } - let result = path15.dirname(p2); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); + onUpgrade(statusCode, headers, socket) { + this.handler.onUpgrade(statusCode, headers, socket); } - return result; - } - exports.dirname = dirname; - function ensureAbsoluteRoot(root, itemPath) { - assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); - assert_1.default(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`); - if (hasAbsoluteRoot(itemPath)) { - return itemPath; + onError(error) { + this.handler.onError(error); } - if (IS_WINDOWS) { - if (itemPath.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)) { - let cwd = process.cwd(); - assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); - if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) { - if (itemPath.length === 2) { - return `${itemPath[0]}:\\${cwd.substr(3)}`; - } else { - if (!cwd.endsWith("\\")) { - cwd += "\\"; - } - return `${itemPath[0]}:\\${cwd.substr(3)}${itemPath.substr(2)}`; - } - } else { - return `${itemPath[0]}:\\${itemPath.substr(2)}`; - } - } else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) { - const cwd = process.cwd(); - assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); - return `${cwd[0]}:\\${itemPath.substr(1)}`; + onHeaders(statusCode, headers, resume, statusText) { + this.location = this.history.length >= this.maxRedirections || util3.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); + if (this.opts.origin) { + this.history.push(new URL(this.opts.path, this.opts.origin)); + } + if (!this.location) { + return this.handler.onHeaders(statusCode, headers, resume, statusText); + } + const { origin, pathname, search } = util3.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); + const path14 = search ? `${pathname}${search}` : pathname; + this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); + this.opts.path = path14; + this.opts.origin = origin; + this.opts.maxRedirections = 0; + this.opts.query = null; + if (statusCode === 303 && this.opts.method !== "HEAD") { + this.opts.method = "GET"; + this.opts.body = null; } } - assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { - } else { - root += path15.sep; - } - return root + itemPath; - } - exports.ensureAbsoluteRoot = ensureAbsoluteRoot; - function hasAbsoluteRoot(itemPath) { - assert_1.default(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`); - itemPath = normalizeSeparators(itemPath); - if (IS_WINDOWS) { - return itemPath.startsWith("\\\\") || /^[A-Z]:\\/i.test(itemPath); - } - return itemPath.startsWith("/"); - } - exports.hasAbsoluteRoot = hasAbsoluteRoot; - function hasRoot(itemPath) { - assert_1.default(itemPath, `isRooted parameter 'itemPath' must not be empty`); - itemPath = normalizeSeparators(itemPath); - if (IS_WINDOWS) { - return itemPath.startsWith("\\") || /^[A-Z]:/i.test(itemPath); + onData(chunk) { + if (this.location) { + } else { + return this.handler.onData(chunk); + } } - return itemPath.startsWith("/"); - } - exports.hasRoot = hasRoot; - function normalizeSeparators(p2) { - p2 = p2 || ""; - if (IS_WINDOWS) { - p2 = p2.replace(/\//g, "\\"); - const isUnc = /^\\\\+[^\\]/.test(p2); - return (isUnc ? "\\" : "") + p2.replace(/\\\\+/g, "\\"); + onComplete(trailers) { + if (this.location) { + this.location = null; + this.abort = null; + this.dispatch(this.opts, this); + } else { + this.handler.onComplete(trailers); + } } - return p2.replace(/\/\/+/g, "/"); - } - exports.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p2) { - if (!p2) { - return ""; + onBodySent(chunk) { + if (this.handler.onBodySent) { + this.handler.onBodySent(chunk); + } } - p2 = normalizeSeparators(p2); - if (!p2.endsWith(path15.sep)) { - return p2; + }; + function parseLocation(statusCode, headers) { + if (redirectableStatusCodes.indexOf(statusCode) === -1) { + return null; } - if (p2 === path15.sep) { - return p2; + for (let i2 = 0; i2 < headers.length; i2 += 2) { + if (headers[i2].toString().toLowerCase() === "location") { + return headers[i2 + 1]; + } } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p2)) { - return p2; + } + function shouldRemoveHeader(header, removeContent, unknownOrigin) { + return header.length === 4 && header.toString().toLowerCase() === "host" || removeContent && header.toString().toLowerCase().indexOf("content-") === 0 || unknownOrigin && header.length === 13 && header.toString().toLowerCase() === "authorization" || unknownOrigin && header.length === 6 && header.toString().toLowerCase() === "cookie"; + } + function cleanRequestHeaders(headers, removeContent, unknownOrigin) { + const ret = []; + if (Array.isArray(headers)) { + for (let i2 = 0; i2 < headers.length; i2 += 2) { + if (!shouldRemoveHeader(headers[i2], removeContent, unknownOrigin)) { + ret.push(headers[i2], headers[i2 + 1]); + } + } + } else if (headers && typeof headers === "object") { + for (const key of Object.keys(headers)) { + if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) { + ret.push(key, headers[key]); + } + } + } else { + assert(headers == null, "headers must be an object or an array"); } - return p2.substr(0, p2.length - 1); + return ret; } - exports.safeTrimTrailingSeparator = safeTrimTrailingSeparator; + module.exports = RedirectHandler; } }); -// node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind = __commonJS({ - "node_modules/@actions/glob/lib/internal-match-kind.js"(exports) { +// node_modules/undici/lib/interceptor/redirectInterceptor.js +var require_redirectInterceptor = __commonJS({ + "node_modules/undici/lib/interceptor/redirectInterceptor.js"(exports, module) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MatchKind = void 0; - var MatchKind; - (function(MatchKind2) { - MatchKind2[MatchKind2["None"] = 0] = "None"; - MatchKind2[MatchKind2["Directory"] = 1] = "Directory"; - MatchKind2[MatchKind2["File"] = 2] = "File"; - MatchKind2[MatchKind2["All"] = 3] = "All"; - })(MatchKind = exports.MatchKind || (exports.MatchKind = {})); + var RedirectHandler = require_RedirectHandler(); + function createRedirectInterceptor({ maxRedirections: defaultMaxRedirections }) { + return (dispatch) => { + return function Intercept(opts, handler) { + const { maxRedirections = defaultMaxRedirections } = opts; + if (!maxRedirections) { + return dispatch(opts, handler); + } + const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler); + opts = { ...opts, maxRedirections: 0 }; + return dispatch(opts, redirectHandler); + }; + }; + } + module.exports = createRedirectInterceptor; } }); -// node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper = __commonJS({ - "node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - Object.defineProperty(o2, k22, { enumerable: true, get: function() { - return m3[k2]; - } }); - } : function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - o2[k22] = m3[k2]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { - Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); - } : function(o2, v2) { - o2["default"] = v2; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k2 in mod) - if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) - __createBinding(result, mod, k2); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.partialMatch = exports.match = exports.getSearchPaths = void 0; - var pathHelper = __importStar(require_internal_path_helper()); - var internal_match_kind_1 = require_internal_match_kind(); - var IS_WINDOWS = process.platform === "win32"; - function getSearchPaths(patterns) { - patterns = patterns.filter((x2) => !x2.negate); - const searchPathMap = {}; - for (const pattern of patterns) { - const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; - searchPathMap[key] = "candidate"; - } - const result = []; - for (const pattern of patterns) { - const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; - if (searchPathMap[key] === "included") { - continue; - } - let foundAncestor = false; - let tempKey = key; - let parent = pathHelper.dirname(tempKey); - while (parent !== tempKey) { - if (searchPathMap[parent]) { - foundAncestor = true; - break; - } - tempKey = parent; - parent = pathHelper.dirname(tempKey); - } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; - } - } - return result; - } - exports.getSearchPaths = getSearchPaths; - function match(patterns, itemPath) { - let result = internal_match_kind_1.MatchKind.None; - for (const pattern of patterns) { - if (pattern.negate) { - result &= ~pattern.match(itemPath); - } else { - result |= pattern.match(itemPath); - } - } - return result; - } - exports.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x2) => !x2.negate && x2.partialMatch(itemPath)); - } - exports.partialMatch = partialMatch; +// node_modules/undici/lib/llhttp/llhttp-wasm.js +var require_llhttp_wasm = __commonJS({ + "node_modules/undici/lib/llhttp/llhttp-wasm.js"(exports, module) { + module.exports = "AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dHBfcmVzZXQAFA5sbGh0dHBfZXhlY3V0ZQAVFGxsaHR0cF9zZXR0aW5nc19pbml0ABYNbGxodHRwX2ZpbmlzaAAXDGxsaHR0cF9wYXVzZQAYDWxsaHR0cF9yZXN1bWUAGRtsbGh0dHBfcmVzdW1lX2FmdGVyX3VwZ3JhZGUAGhBsbGh0dHBfZ2V0X2Vycm5vABsXbGxodHRwX2dldF9lcnJvcl9yZWFzb24AHBdsbGh0dHBfc2V0X2Vycm9yX3JlYXNvbgAdFGxsaHR0cF9nZXRfZXJyb3JfcG9zAB4RbGxodHRwX2Vycm5vX25hbWUAHxJsbGh0dHBfbWV0aG9kX25hbWUAIBJs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ADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgACgCHCIQQX9qDt0B2gEB2QECAwQFBgcICQoLDA0O2AEPENcBERLWARMUFRYXGBkaG+AB3wEcHR7VAR8gISIjJCXUASYnKCkqKyzTAdIBLS7RAdABLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVG2wFHSElKzwHOAUvNAUzMAU1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+f4ABgQGCAYMBhAGFAYYBhwGIAYkBigGLAYwBjQGOAY8BkAGRAZIBkwGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwHLAcoBuAHJAbkByAG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAQDcAQtBACEQDMYBC0EOIRAMxQELQQ0hEAzEAQtBDyEQDMMBC0EQIRAMwgELQRMhEAzBAQtBFCEQDMABC0EVIRAMvwELQRYhEAy+AQtBFyEQDL0BC0EYIRAMvAELQRkhEAy7AQtBGiEQDLoBC0EbIRAMuQELQRwhEAy4AQtBCCEQDLcBC0EdIRAMtgELQSAhEAy1AQtBHyEQDLQBC0EHIRAMswELQSEhEAyyAQtBIiEQDLEBC0EeIRAMsAELQSMhEAyvAQtBEiEQDK4BC0ERIRAMrQELQSQhEAysAQtBJSEQDKsBC0EmIRAMqgELQSchEAypAQtBwwEhEAyoAQtBKSEQDKcBC0ErIRAMpgELQSwhEAylAQtBLSEQDKQBC0EuIRAMowELQS8hEAyiAQtBxAEhEAyhAQtBMCEQDKABC0E0IRAMnwELQQwhEAyeAQtBMSEQDJ0BC0EyIRAMnAELQTMhEAybAQtBOSEQDJoBC0E1IRAMmQELQcUBIRAMmAELQQshEAyXAQtBOiEQDJYBC0E2IRAMlQELQQohEAyUAQtBNyEQDJMBC0E4IRAMkgELQTwhEAyRAQtBOyEQDJABC0E9IRAMjwELQQkhEAyOAQtBKCEQDI0BC0E+IRAMjAELQT8hEAyLAQtBwAAhEAyKAQtBwQAhEAyJAQtBwgAhEAyIAQtBwwAhEAyHAQtBxAAhEAyGAQtBxQAhEAyFAQtBxgAhEAyEAQtBKiEQDIMBC0HHACEQDIIBC0HIACEQDIEBC0HJACEQDIABC0HKACEQDH8LQcsAIRAMfgtBzQAhEAx9C0HMACEQDHwLQc4AIRAMewtBzwAhEAx6C0HQACEQDHkLQdEAIRAMeAtB0gAhEAx3C0HTACEQDHYLQdQAIRAMdQtB1gAhEAx0C0HVACEQDHMLQQYhEAxyC0HXACEQDHELQQUhEAxwC0HYACEQDG8LQQQhEAxuC0HZACEQDG0LQdoAIRAMbAtB2wAhEAxrC0HcACEQDGoLQQMhEAxpC0HdACEQDGgLQd4AIRAMZwtB3wAhEAxmC0HhACEQDGULQeAAIRAMZAtB4gAhEAxjC0HjACEQDGILQQIhEAxhC0HkACEQDGALQeUAIRAMXwtB5gAhEAxeC0HnACEQDF0LQegAIRAMXAtB6QAhEAxbC0HqACEQDFoLQesAIRAMWQtB7AAhEAxYC0HtACEQDFcLQe4AIRAMVgtB7wAhEAxVC0HwACEQDFQLQfEAIRAMUwtB8gAhEAxSC0HzACEQDFELQfQAIRAMUAtB9QAhEAxPC0H2ACEQDE4LQfcAIRAMTQtB+AAhEAxMC0H5ACEQDEsLQfoAIRAMSgtB+wAhEAxJC0H8ACEQDEgLQf0AIRAMRwtB/gAhEAxGC0H/ACEQDEULQYABIRAMRAtBgQEhEAxDC0GCASEQDEILQYMBIRAMQQtBhAEhEAxAC0GFASEQDD8LQYYBIRAMPgtBhwEhEAw9C0GIASEQDDwLQYkBIRAMOwtBigEhEAw6C0GLASEQDDkLQYwBIRAMOAtBjQEhEAw3C0GOASEQDDYLQY8BIRAMNQtBkAEhEAw0C0GRASEQDDMLQZIBIRAMMgtBkwEhEAwxC0GUASEQDDALQZUBIRAMLwtBlgEhEAwuC0GXASEQDC0LQZgBIRAMLAtBmQEhEAwrC0GaASEQDCoLQZsBIRAMKQtBnAEhEAwoC0GdASEQDCcLQZ4BIRAMJgtBnwEhEAwlC0GgASEQDCQLQaEBIRAMIwtBogEhEAwiC0GjASEQDCELQaQBIRAMIAtBpQEhEAwfC0GmASEQDB4LQacBIRAMHQtBqAEhEAwcC0GpASEQDBsLQaoBIRAMGgtBqwEhEAwZC0GsASEQDBgLQa0BIRAMFwtBrgEhEAwWC0EBIRAMFQtBrwEhEAwUC0GwASEQDBMLQbEBIRAMEgtBswEhEAwRC0GyASEQDBALQbQBIRAMDwtBtQEhEAwOC0G2ASEQDA0LQbcBIRAMDAtBuAEhEAwLC0G5ASEQDAoLQboBIRAMCQtBuwEhEAwIC0HGASEQDAcLQbwBIRAMBgtBvQEhEAwFC0G+ASEQDAQLQb8BIRAMAwtBwAEhEAwCC0HCASEQDAELQcEBIRALA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAC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FCAAIBA2AgxBACEQDLIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAU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YWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21ldGhvZF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lYCBjYWxsYmFjayBlcnJvcgBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNlcnZlcgBJbnZhbGlkIGhlYWRlciB2YWx1ZSBjaGFyAEludmFsaWQgaGVhZGVyIGZpZWxkIGNoYXIAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl92ZXJzaW9uAEludmFsaWQgbWlub3IgdmVyc2lvbgBJbnZhbGlkIG1ham9yIHZlcnNpb24ARXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgdmVyc2lvbgBFeHBlY3RlZCBDUkxGIGFmdGVyIHZlcnNpb24ASW52YWxpZCBIVFRQIHZlcnNpb24ASW52YWxpZCBoZWFkZXIgdG9rZW4AU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl91cmwASW52YWxpZCBjaGFyYWN0ZXJzIGluIHVybABVbmV4cGVjdGVkIHN0YXJ0IGNoYXIgaW4gdXJsAERvdWJsZSBAIGluIHVybABFbXB0eSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXJhY3RlciBpbiBDb250ZW50LUxlbmd0aABEdXBsaWNhdGUgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyIGluIHVybCBwYXRoAENvbnRlbnQtTGVuZ3RoIGNhbid0IGJlIHByZXNlbnQgd2l0aCBUcmFuc2Zlci1FbmNvZGluZwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBzaXplAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25faGVhZGVyX3ZhbHVlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgdmFsdWUATWlzc2luZyBleHBlY3RlZCBMRiBhZnRlciBoZWFkZXIgdmFsdWUASW52YWxpZCBgVHJhbnNmZXItRW5jb2RpbmdgIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fbmFtZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIG5hbWUAUGF1c2Ugb24gQ09OTkVDVC9VcGdyYWRlAFBhdXNlIG9uIFBSSS9VcGdyYWRlAEV4cGVjdGVkIEhUVFAvMiBDb25uZWN0aW9uIFByZWZhY2UAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9tZXRob2QARXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgbWV0aG9kAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25faGVhZGVyX2ZpZWxkAFBhdXNlZABJbnZhbGlkIHdvcmQgZW5jb3VudGVyZWQASW52YWxpZCBtZXRob2QgZW5jb3VudGVyZWQAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzY2hlbWEAUmVxdWVzdCBoYXMgaW52YWxpZCBgVHJhbnNmZXItRW5jb2RpbmdgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX0NIVU5LX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX05BTUVfQ09NUExFVEUASFBFX0NCX01FU1NBR0VfQ09NUExFVEUASFBFX0NCX01FVEhPRF9DT01QTEVURQBIUEVfQ0JfSEVBREVSX0ZJRUxEX0NPTVBMRVRFAERFTEVURQBIUEVfSU5WQUxJRF9FT0ZfU1RBVEUASU5WQUxJRF9TU0xfQ0VSVElGSUNBVEUAUEFVU0UATk9fUkVTUE9OU0UAVU5TVVBQT1JURURfTUVESUFfVFlQRQBHT05FAE5PVF9BQ0NFUFRBQkxFAFNFUlZJQ0VfVU5BVkFJTEFCTEUAUkFOR0VfTk9UX1NBVElTRklBQkxFAE9SSUdJTl9JU19VTlJFQUNIQUJMRQBSRVNQT05TRV9JU19TVEFMRQBQVVJHRQBNRVJHRQBSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFAFJFUVVFU1RfSEVBREVSX1RPT19MQVJHRQBQQVlMT0FEX1RPT19MQVJHRQBJTlNVRkZJQ0lFTlRfU1RPUkFHRQBIUEVfUEFVU0VEX1VQR1JBREUASFBFX1BBVVNFRF9IMl9VUEdSQURFAFNPVVJDRQBBTk5PVU5DRQBUUkFDRQBIUEVfVU5FWFBFQ1RFRF9TUEFDRQBERVNDUklCRQBVTlNVQlNDUklCRQBSRUNPUkQASFBFX0lOVkFMSURfTUVUSE9EAE5PVF9GT1VORABQUk9QRklORABVTkJJTkQAUkVCSU5EAFVOQVVUSE9SSVpFRABNRVRIT0RfTk9UX0FMTE9XRUQASFRUUF9WRVJTSU9OX05PVF9TVVBQT1JURUQAQUxSRUFEWV9SRVBPUlRFRABBQ0NFUFRFRABOT1RfSU1QTEVNRU5URUQATE9PUF9ERVRFQ1RFRABIUEVfQ1JfRVhQRUNURUQASFBFX0xGX0VYUEVDVEVEAENSRUFURUQASU1fVVNFRABIUEVfUEFVU0VEAFRJTUVPVVRfT0NDVVJFRABQQVlNRU5UX1JFUVVJUkVEAFBSRUNPTkRJVElPTl9SRVFVSVJFRABQUk9YWV9BVVRIRU5USUNBVElPTl9SRVFVSVJFRABORVRXT1JLX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAExFTkdUSF9SRVFVSVJFRABTU0xfQ0VSVElGSUNBVEVfUkVRVUlSRUQAVVBHUkFERV9SRVFVSVJFRABQQUdFX0VYUElSRUQAUFJFQ09ORElUSU9OX0ZBSUxFRABFWFBFQ1RBVElPTl9GQUlMRUQAUkVWQUxJREFUSU9OX0ZBSUxFRABTU0xfSEFORFNIQUtFX0ZBSUxFRABMT0NLRUQAVFJBTlNGT1JNQVRJT05fQVBQTElFRABOT1RfTU9ESUZJRUQATk9UX0VYVEVOREVEAEJBTkRXSURUSF9MSU1JVF9FWENFRURFRABTSVRFX0lTX09WRVJMT0FERUQASEVBRABFeHBlY3RlZCBIVFRQLwAAXhMAACYTAAAwEAAA8BcAAJ0TAAAVEgAAORcAAPASAAAKEAAAdRIAAK0SAACCEwAATxQAAH8QAACgFQAAIxQAAIkSAACLFAAATRUAANQRAADPFAAAEBgAAMkWAADcFgAAwREAAOAXAAC7FAAAdBQAAHwVAADlFAAACBcAAB8QAABlFQAAoxQAACgVAAACFQAAmRUAACwQAACLGQAATw8AANQOAABqEAAAzhAAAAIXAACJDgAAbhMAABwTAABmFAAAVhcAAMETAADNEwAAbBMAAGgXAABmFwAAXxcAACITAADODwAAaQ4AANgOAABjFgAAyxMAAKoOAAAoFwAAJhcAAMUTAABdFgAA6BEAAGcTAABlEwAA8hYAAHMTAAAdFwAA+RYAAPMRAADPDgAAzhUAAAwSAACzEQAApREAAGEQAAAyFwAAuxMAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIDAgICAgIAAAICAAICAAICAgICAgICAgIABAAAAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAACAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbG9zZWVlcC1hbGl2ZQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAQEBAQEAAAEBAAEBAAEBAQEBAQEBAQEAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AAAAAAAAAAAAAAAAAAAByYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AAAAAAAAAAAAAAAABAgABAwAAAAAAAAAAAAAAAAAAAAAAAAQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQIAAQMAAAAAAAAAAAAAAAAAAAAAAAAEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAQAAAgAAAAAAAAAAAAAAAAAAAAAAAAMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAIAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABOT1VOQ0VFQ0tPVVRORUNURVRFQ1JJQkVMVVNIRVRFQURTRUFSQ0hSR0VDVElWSVRZTEVOREFSVkVPVElGWVBUSU9OU0NIU0VBWVNUQVRDSEdFT1JESVJFQ1RPUlRSQ0hQQVJBTUVURVJVUkNFQlNDUklCRUFSRE9XTkFDRUlORE5LQ0tVQlNDUklCRUhUVFAvQURUUC8="; } }); -// node_modules/concat-map/index.js -var require_concat_map = __commonJS({ - "node_modules/concat-map/index.js"(exports, module) { - module.exports = function(xs, fn2) { - var res = []; - for (var i2 = 0; i2 < xs.length; i2++) { - var x2 = fn2(xs[i2], i2); - if (isArray(x2)) - res.push.apply(res, x2); - else - res.push(x2); - } - return res; - }; - var isArray = Array.isArray || function(xs) { - return Object.prototype.toString.call(xs) === "[object Array]"; - }; +// node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +var require_llhttp_simd_wasm = __commonJS({ + "node_modules/undici/lib/llhttp/llhttp_simd-wasm.js"(exports, module) { + module.exports = "AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dHBfcmVzZXQAFA5sbGh0dHBfZXhlY3V0ZQAVFGxsaHR0cF9zZXR0aW5nc19pbml0ABYNbGxodHRwX2ZpbmlzaAAXDGxsaHR0cF9wYXVzZQAYDWxsaHR0cF9yZXN1bWUAGRtsbGh0dHBfcmVzdW1lX2FmdGVyX3VwZ3JhZGUAGhBsbGh0dHBfZ2V0X2Vycm5vABsXbGxodHRwX2dldF9lcnJvcl9yZWFzb24AHBdsbGh0dHBfc2V0X2Vycm9yX3JlYXNvbgAdFGxsaHR0cF9nZXRfZXJyb3JfcG9zAB4RbGxodHRwX2Vycm5vX25hbWUAHxJsbGh0dHBfbWV0aG9kX25hbWUAIBJs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IAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQHZAQIDBAUGBwgJCgsMDQ7YAQ8Q1wEREtYBExQVFhcYGRob4AHfARwdHtUBHyAhIiMkJdQBJicoKSorLNMB0gEtLtEB0AEvMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUbbAUdISUrPAc4BS80BTMwBTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEB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QAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAOxwEAAQID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YWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsb3NlZWVwLWFsaXZlAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgAAAAAAAAAAAAAAAAAAAHJhbnNmZXItZW5jb2RpbmdwZ3JhZGUNCg0KDQpTTQ0KDQpUVFAvQ0UvVFNQLwAAAAAAAAAAAAAAAAECAAEDAAAAAAAAAAAAAAAAAAAAAAAABAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAABAgABAwAAAAAAAAAAAAAAAAAAAAAAAAQBAQUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAABAAACAAAAAAAAAAAAAAAAAAAAAAAAAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAgAAAAACAAAAAAAAAAAAAAAAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=="; } }); -// node_modules/balanced-match/index.js -var require_balanced_match = __commonJS({ - "node_modules/balanced-match/index.js"(exports, module) { +// node_modules/undici/lib/client.js +var require_client = __commonJS({ + "node_modules/undici/lib/client.js"(exports, module) { "use strict"; - module.exports = balanced; - function balanced(a2, b2, str) { - if (a2 instanceof RegExp) - a2 = maybeMatch(a2, str); - if (b2 instanceof RegExp) - b2 = maybeMatch(b2, str); - var r2 = range2(a2, b2, str); - return r2 && { - start: r2[0], - end: r2[1], - pre: str.slice(0, r2[0]), - body: str.slice(r2[0] + a2.length, r2[1]), - post: str.slice(r2[1] + b2.length) - }; + var assert = __require("assert"); + var net = __require("net"); + var http4 = __require("http"); + var { pipeline } = __require("stream"); + var util3 = require_util(); + var timers = require_timers(); + var Request2 = require_request(); + var DispatcherBase = require_dispatcher_base(); + var { + RequestContentLengthMismatchError, + ResponseContentLengthMismatchError, + InvalidArgumentError, + RequestAbortedError, + HeadersTimeoutError, + HeadersOverflowError, + SocketError, + InformationalError, + BodyTimeoutError, + HTTPParserError, + ResponseExceededMaxSizeError, + ClientDestroyedError + } = require_errors(); + var buildConnector = require_connect(); + var { + kUrl, + kReset, + kServerName, + kClient, + kBusy, + kParser, + kConnect, + kBlocking, + kResuming, + kRunning, + kPending, + kSize, + kWriting, + kQueue, + kConnected, + kConnecting, + kNeedDrain, + kNoRef, + kKeepAliveDefaultTimeout, + kHostHeader, + kPendingIdx, + kRunningIdx, + kError, + kPipelining, + kSocket, + kKeepAliveTimeoutValue, + kMaxHeadersSize, + kKeepAliveMaxTimeout, + kKeepAliveTimeoutThreshold, + kHeadersTimeout, + kBodyTimeout, + kStrictContentLength, + kConnector, + kMaxRedirections, + kMaxRequests, + kCounter, + kClose, + kDestroy, + kDispatch, + kInterceptors, + kLocalAddress, + kMaxResponseSize, + kHTTPConnVersion, + // HTTP2 + kHost, + kHTTP2Session, + kHTTP2SessionState, + kHTTP2BuildRequest, + kHTTP2CopyHeaders, + kHTTP1BuildRequest + } = require_symbols(); + var http22; + try { + http22 = __require("http2"); + } catch { + http22 = { constants: {} }; } - function maybeMatch(reg, str) { - var m3 = str.match(reg); - return m3 ? m3[0] : null; + var { + constants: { + HTTP2_HEADER_AUTHORITY, + HTTP2_HEADER_METHOD, + HTTP2_HEADER_PATH, + HTTP2_HEADER_SCHEME, + HTTP2_HEADER_CONTENT_LENGTH, + HTTP2_HEADER_EXPECT, + HTTP2_HEADER_STATUS + } + } = http22; + var h2ExperimentalWarned = false; + var FastBuffer = Buffer[Symbol.species]; + var kClosedResolve = Symbol("kClosedResolve"); + var channels = {}; + try { + const diagnosticsChannel = __require("diagnostics_channel"); + channels.sendHeaders = diagnosticsChannel.channel("undici:client:sendHeaders"); + channels.beforeConnect = diagnosticsChannel.channel("undici:client:beforeConnect"); + channels.connectError = diagnosticsChannel.channel("undici:client:connectError"); + channels.connected = diagnosticsChannel.channel("undici:client:connected"); + } catch { + channels.sendHeaders = { hasSubscribers: false }; + channels.beforeConnect = { hasSubscribers: false }; + channels.connectError = { hasSubscribers: false }; + channels.connected = { hasSubscribers: false }; } - balanced.range = range2; - function range2(a2, b2, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a2); - var bi = str.indexOf(b2, ai + 1); - var i2 = ai; - if (ai >= 0 && bi > 0) { - if (a2 === b2) { - return [ai, bi]; + var Client = class extends DispatcherBase { + /** + * + * @param {string|URL} url + * @param {import('../types/client').Client.Options} options + */ + constructor(url2, { + interceptors, + maxHeaderSize, + headersTimeout, + socketTimeout, + requestTimeout, + connectTimeout, + bodyTimeout, + idleTimeout, + keepAlive, + keepAliveTimeout, + maxKeepAliveTimeout, + keepAliveMaxTimeout, + keepAliveTimeoutThreshold, + socketPath, + pipelining, + tls, + strictContentLength, + maxCachedSessions, + maxRedirections, + connect: connect2, + maxRequestsPerClient, + localAddress, + maxResponseSize, + autoSelectFamily, + autoSelectFamilyAttemptTimeout, + // h2 + allowH2, + maxConcurrentStreams + } = {}) { + super(); + if (keepAlive !== void 0) { + throw new InvalidArgumentError("unsupported keepAlive, use pipelining=0 instead"); } - begs = []; - left = str.length; - while (i2 >= 0 && !result) { - if (i2 == ai) { - begs.push(i2); - ai = str.indexOf(a2, i2 + 1); - } else if (begs.length == 1) { - result = [begs.pop(), bi]; + if (socketTimeout !== void 0) { + throw new InvalidArgumentError("unsupported socketTimeout, use headersTimeout & bodyTimeout instead"); + } + if (requestTimeout !== void 0) { + throw new InvalidArgumentError("unsupported requestTimeout, use headersTimeout & bodyTimeout instead"); + } + if (idleTimeout !== void 0) { + throw new InvalidArgumentError("unsupported idleTimeout, use keepAliveTimeout instead"); + } + if (maxKeepAliveTimeout !== void 0) { + throw new InvalidArgumentError("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead"); + } + if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) { + throw new InvalidArgumentError("invalid maxHeaderSize"); + } + if (socketPath != null && typeof socketPath !== "string") { + throw new InvalidArgumentError("invalid socketPath"); + } + if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) { + throw new InvalidArgumentError("invalid connectTimeout"); + } + if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) { + throw new InvalidArgumentError("invalid keepAliveTimeout"); + } + if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) { + throw new InvalidArgumentError("invalid keepAliveMaxTimeout"); + } + if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) { + throw new InvalidArgumentError("invalid keepAliveTimeoutThreshold"); + } + if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) { + throw new InvalidArgumentError("headersTimeout must be a positive integer or zero"); + } + if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) { + throw new InvalidArgumentError("bodyTimeout must be a positive integer or zero"); + } + if (connect2 != null && typeof connect2 !== "function" && typeof connect2 !== "object") { + throw new InvalidArgumentError("connect must be a function or an object"); + } + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { + throw new InvalidArgumentError("maxRedirections must be a positive number"); + } + if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) { + throw new InvalidArgumentError("maxRequestsPerClient must be a positive number"); + } + if (localAddress != null && (typeof localAddress !== "string" || net.isIP(localAddress) === 0)) { + throw new InvalidArgumentError("localAddress must be valid string IP address"); + } + if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) { + throw new InvalidArgumentError("maxResponseSize must be a positive number"); + } + if (autoSelectFamilyAttemptTimeout != null && (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)) { + throw new InvalidArgumentError("autoSelectFamilyAttemptTimeout must be a positive number"); + } + if (allowH2 != null && typeof allowH2 !== "boolean") { + throw new InvalidArgumentError("allowH2 must be a valid boolean value"); + } + if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== "number" || maxConcurrentStreams < 1)) { + throw new InvalidArgumentError("maxConcurrentStreams must be a possitive integer, greater than 0"); + } + if (typeof connect2 !== "function") { + connect2 = buildConnector({ + ...tls, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout, + ...util3.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, + ...connect2 + }); + } + this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) ? interceptors.Client : [createRedirectInterceptor({ maxRedirections })]; + this[kUrl] = util3.parseOrigin(url2); + this[kConnector] = connect2; + this[kSocket] = null; + this[kPipelining] = pipelining != null ? pipelining : 1; + this[kMaxHeadersSize] = maxHeaderSize || http4.maxHeaderSize; + this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout; + this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 6e5 : keepAliveMaxTimeout; + this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold; + this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]; + this[kServerName] = null; + this[kLocalAddress] = localAddress != null ? localAddress : null; + this[kResuming] = 0; + this[kNeedDrain] = 0; + this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ""}\r +`; + this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 3e5; + this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 3e5; + this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength; + this[kMaxRedirections] = maxRedirections; + this[kMaxRequests] = maxRequestsPerClient; + this[kClosedResolve] = null; + this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1; + this[kHTTPConnVersion] = "h1"; + this[kHTTP2Session] = null; + this[kHTTP2SessionState] = !allowH2 ? null : { + // streams: null, // Fixed queue of streams - For future support of `push` + openStreams: 0, + // Keep track of them to decide wether or not unref the session + maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 + // Max peerConcurrentStreams for a Node h2 server + }; + this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ""}`; + this[kQueue] = []; + this[kRunningIdx] = 0; + this[kPendingIdx] = 0; + } + get pipelining() { + return this[kPipelining]; + } + set pipelining(value) { + this[kPipelining] = value; + resume(this, true); + } + get [kPending]() { + return this[kQueue].length - this[kPendingIdx]; + } + get [kRunning]() { + return this[kPendingIdx] - this[kRunningIdx]; + } + get [kSize]() { + return this[kQueue].length - this[kRunningIdx]; + } + get [kConnected]() { + return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed; + } + get [kBusy]() { + const socket = this[kSocket]; + return socket && (socket[kReset] || socket[kWriting] || socket[kBlocking]) || this[kSize] >= (this[kPipelining] || 1) || this[kPending] > 0; + } + /* istanbul ignore: only used for test */ + [kConnect](cb) { + connect(this); + this.once("connect", cb); + } + [kDispatch](opts, handler) { + const origin = opts.origin || this[kUrl].origin; + const request = this[kHTTPConnVersion] === "h2" ? Request2[kHTTP2BuildRequest](origin, opts, handler) : Request2[kHTTP1BuildRequest](origin, opts, handler); + this[kQueue].push(request); + if (this[kResuming]) { + } else if (util3.bodyLength(request.body) == null && util3.isIterable(request.body)) { + this[kResuming] = 1; + process.nextTick(resume, this); + } else { + resume(this, true); + } + if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) { + this[kNeedDrain] = 2; + } + return this[kNeedDrain] < 2; + } + async [kClose]() { + return new Promise((resolve2) => { + if (!this[kSize]) { + resolve2(null); } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; + this[kClosedResolve] = resolve2; + } + }); + } + async [kDestroy](err) { + return new Promise((resolve2) => { + const requests = this[kQueue].splice(this[kPendingIdx]); + for (let i2 = 0; i2 < requests.length; i2++) { + const request = requests[i2]; + errorRequest(this, request, err); + } + const callback = () => { + if (this[kClosedResolve]) { + this[kClosedResolve](); + this[kClosedResolve] = null; } - bi = str.indexOf(b2, i2 + 1); + resolve2(); + }; + if (this[kHTTP2Session] != null) { + util3.destroy(this[kHTTP2Session], err); + this[kHTTP2Session] = null; + this[kHTTP2SessionState] = null; } - i2 = ai < bi && ai >= 0 ? ai : bi; - } - if (begs.length) { - result = [left, right]; - } + if (!this[kSocket]) { + queueMicrotask(callback); + } else { + util3.destroy(this[kSocket].on("close", callback), err); + } + resume(this); + }); } - return result; + }; + function onHttp2SessionError(err) { + assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + this[kSocket][kError] = err; + onError(this[kClient], err); } - } -}); - -// node_modules/brace-expansion/index.js -var require_brace_expansion = __commonJS({ - "node_modules/brace-expansion/index.js"(exports, module) { - var concatMap = require_concat_map(); - var balanced = require_balanced_match(); - module.exports = expandTop; - var escSlash = "\0SLASH" + Math.random() + "\0"; - var escOpen = "\0OPEN" + Math.random() + "\0"; - var escClose = "\0CLOSE" + Math.random() + "\0"; - var escComma = "\0COMMA" + Math.random() + "\0"; - var escPeriod = "\0PERIOD" + Math.random() + "\0"; - function numeric(str) { - return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); + function onHttp2FrameError(type3, code, id) { + const err = new InformationalError(`HTTP/2: "frameError" received - type ${type3}, code ${code}`); + if (id === 0) { + this[kSocket][kError] = err; + onError(this[kClient], err); + } } - function escapeBraces(str) { - return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); + function onHttp2SessionEnd() { + util3.destroy(this, new SocketError("other side closed")); + util3.destroy(this[kSocket], new SocketError("other side closed")); } - function unescapeBraces(str) { - return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); + function onHTTP2GoAway(code) { + const client = this[kClient]; + const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`); + client[kSocket] = null; + client[kHTTP2Session] = null; + if (client.destroyed) { + assert(this[kPending] === 0); + const requests = client[kQueue].splice(client[kRunningIdx]); + for (let i2 = 0; i2 < requests.length; i2++) { + const request = requests[i2]; + errorRequest(this, request, err); + } + } else if (client[kRunning] > 0) { + const request = client[kQueue][client[kRunningIdx]]; + client[kQueue][client[kRunningIdx]++] = null; + errorRequest(client, request, err); + } + client[kPendingIdx] = client[kRunningIdx]; + assert(client[kRunning] === 0); + client.emit( + "disconnect", + client[kUrl], + [client], + err + ); + resume(client); } - function parseCommaParts(str) { - if (!str) - return [""]; - var parts = []; - var m3 = balanced("{", "}", str); - if (!m3) - return str.split(","); - var pre = m3.pre; - var body2 = m3.body; - var post2 = m3.post; - var p2 = pre.split(","); - p2[p2.length - 1] += "{" + body2 + "}"; - var postParts = parseCommaParts(post2); - if (post2.length) { - p2[p2.length - 1] += postParts.shift(); - p2.push.apply(p2, postParts); + var constants = require_constants2(); + var createRedirectInterceptor = require_redirectInterceptor(); + var EMPTY_BUF = Buffer.alloc(0); + async function lazyllhttp() { + const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm() : void 0; + let mod; + try { + mod = await WebAssembly.compile(Buffer.from(require_llhttp_simd_wasm(), "base64")); + } catch (e2) { + mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || require_llhttp_wasm(), "base64")); } - parts.push.apply(parts, p2); - return parts; + return await WebAssembly.instantiate(mod, { + env: { + /* eslint-disable camelcase */ + wasm_on_url: (p2, at2, len) => { + return 0; + }, + wasm_on_status: (p2, at2, len) => { + assert.strictEqual(currentParser.ptr, p2); + const start = at2 - currentBufferPtr + currentBufferRef.byteOffset; + return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; + }, + wasm_on_message_begin: (p2) => { + assert.strictEqual(currentParser.ptr, p2); + return currentParser.onMessageBegin() || 0; + }, + wasm_on_header_field: (p2, at2, len) => { + assert.strictEqual(currentParser.ptr, p2); + const start = at2 - currentBufferPtr + currentBufferRef.byteOffset; + return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; + }, + wasm_on_header_value: (p2, at2, len) => { + assert.strictEqual(currentParser.ptr, p2); + const start = at2 - currentBufferPtr + currentBufferRef.byteOffset; + return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; + }, + wasm_on_headers_complete: (p2, statusCode, upgrade, shouldKeepAlive) => { + assert.strictEqual(currentParser.ptr, p2); + return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0; + }, + wasm_on_body: (p2, at2, len) => { + assert.strictEqual(currentParser.ptr, p2); + const start = at2 - currentBufferPtr + currentBufferRef.byteOffset; + return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; + }, + wasm_on_message_complete: (p2) => { + assert.strictEqual(currentParser.ptr, p2); + return currentParser.onMessageComplete() || 0; + } + /* eslint-enable camelcase */ + } + }); } - function expandTop(str) { - if (!str) - return []; - if (str.substr(0, 2) === "{}") { - str = "\\{\\}" + str.substr(2); + var llhttpInstance = null; + var llhttpPromise = lazyllhttp(); + llhttpPromise.catch(); + var currentParser = null; + var currentBufferRef = null; + var currentBufferSize = 0; + var currentBufferPtr = null; + var TIMEOUT_HEADERS = 1; + var TIMEOUT_BODY = 2; + var TIMEOUT_IDLE = 3; + var Parser2 = class { + constructor(client, socket, { exports: exports2 }) { + assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); + this.llhttp = exports2; + this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE); + this.client = client; + this.socket = socket; + this.timeout = null; + this.timeoutValue = null; + this.timeoutType = null; + this.statusCode = null; + this.statusText = ""; + this.upgrade = false; + this.headers = []; + this.headersSize = 0; + this.headersMaxSize = client[kMaxHeadersSize]; + this.shouldKeepAlive = false; + this.paused = false; + this.resume = this.resume.bind(this); + this.bytesRead = 0; + this.keepAlive = ""; + this.contentLength = ""; + this.connection = ""; + this.maxResponseSize = client[kMaxResponseSize]; + } + setTimeout(value, type3) { + this.timeoutType = type3; + if (value !== this.timeoutValue) { + timers.clearTimeout(this.timeout); + if (value) { + this.timeout = timers.setTimeout(onParserTimeout, value, this); + if (this.timeout.unref) { + this.timeout.unref(); + } + } else { + this.timeout = null; + } + this.timeoutValue = value; + } else if (this.timeout) { + if (this.timeout.refresh) { + this.timeout.refresh(); + } + } } - return expand(escapeBraces(str), true).map(unescapeBraces); - } - function embrace(str) { - return "{" + str + "}"; - } - function isPadded(el) { - return /^-?0\d/.test(el); - } - function lte(i2, y2) { - return i2 <= y2; - } - function gte(i2, y2) { - return i2 >= y2; - } - function expand(str, isTop) { - var expansions = []; - var m3 = balanced("{", "}", str); - if (!m3 || /\$$/.test(m3.pre)) - return [str]; - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m3.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m3.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m3.body.indexOf(",") >= 0; - if (!isSequence && !isOptions) { - if (m3.post.match(/,.*\}/)) { - str = m3.pre + "{" + m3.body + escClose + m3.post; - return expand(str); + resume() { + if (this.socket.destroyed || !this.paused) { + return; } - return [str]; + assert(this.ptr != null); + assert(currentParser == null); + this.llhttp.llhttp_resume(this.ptr); + assert(this.timeoutType === TIMEOUT_BODY); + if (this.timeout) { + if (this.timeout.refresh) { + this.timeout.refresh(); + } + } + this.paused = false; + this.execute(this.socket.read() || EMPTY_BUF); + this.readMore(); } - var n2; - if (isSequence) { - n2 = m3.body.split(/\.\./); - } else { - n2 = parseCommaParts(m3.body); - if (n2.length === 1) { - n2 = expand(n2[0], false).map(embrace); - if (n2.length === 1) { - var post2 = m3.post.length ? expand(m3.post, false) : [""]; - return post2.map(function(p2) { - return m3.pre + n2[0] + p2; - }); + readMore() { + while (!this.paused && this.ptr) { + const chunk = this.socket.read(); + if (chunk === null) { + break; } + this.execute(chunk); } } - var pre = m3.pre; - var post2 = m3.post.length ? expand(m3.post, false) : [""]; - var N2; - if (isSequence) { - var x2 = numeric(n2[0]); - var y2 = numeric(n2[1]); - var width = Math.max(n2[0].length, n2[1].length); - var incr = n2.length == 3 ? Math.abs(numeric(n2[2])) : 1; - var test = lte; - var reverse = y2 < x2; - if (reverse) { - incr *= -1; - test = gte; + execute(data) { + assert(this.ptr != null); + assert(currentParser == null); + assert(!this.paused); + const { socket, llhttp } = this; + if (data.length > currentBufferSize) { + if (currentBufferPtr) { + llhttp.free(currentBufferPtr); + } + currentBufferSize = Math.ceil(data.length / 4096) * 4096; + currentBufferPtr = llhttp.malloc(currentBufferSize); } - var pad = n2.some(isPadded); - N2 = []; - for (var i2 = x2; test(i2, y2); i2 += incr) { - var c2; - if (isAlphaSequence) { - c2 = String.fromCharCode(i2); - if (c2 === "\\") - c2 = ""; - } else { - c2 = String(i2); - if (pad) { - var need = width - c2.length; - if (need > 0) { - var z2 = new Array(need + 1).join("0"); - if (i2 < 0) - c2 = "-" + z2 + c2.slice(1); - else - c2 = z2 + c2; - } + new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data); + try { + let ret; + try { + currentBufferRef = data; + currentParser = this; + ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length); + } catch (err) { + throw err; + } finally { + currentParser = null; + currentBufferRef = null; + } + const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr; + if (ret === constants.ERROR.PAUSED_UPGRADE) { + this.onUpgrade(data.slice(offset)); + } else if (ret === constants.ERROR.PAUSED) { + this.paused = true; + socket.unshift(data.slice(offset)); + } else if (ret !== constants.ERROR.OK) { + const ptr = llhttp.llhttp_get_error_reason(this.ptr); + let message = ""; + if (ptr) { + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0); + message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")"; + } + throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)); + } + } catch (err) { + util3.destroy(socket, err); + } + } + destroy() { + assert(this.ptr != null); + assert(currentParser == null); + this.llhttp.llhttp_free(this.ptr); + this.ptr = null; + timers.clearTimeout(this.timeout); + this.timeout = null; + this.timeoutValue = null; + this.timeoutType = null; + this.paused = false; + } + onStatus(buf) { + this.statusText = buf.toString(); + } + onMessageBegin() { + const { socket, client } = this; + if (socket.destroyed) { + return -1; + } + const request = client[kQueue][client[kRunningIdx]]; + if (!request) { + return -1; + } + } + onHeaderField(buf) { + const len = this.headers.length; + if ((len & 1) === 0) { + this.headers.push(buf); + } else { + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]); + } + this.trackHeader(buf.length); + } + onHeaderValue(buf) { + let len = this.headers.length; + if ((len & 1) === 1) { + this.headers.push(buf); + len += 1; + } else { + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]); + } + const key = this.headers[len - 2]; + if (key.length === 10 && key.toString().toLowerCase() === "keep-alive") { + this.keepAlive += buf.toString(); + } else if (key.length === 10 && key.toString().toLowerCase() === "connection") { + this.connection += buf.toString(); + } else if (key.length === 14 && key.toString().toLowerCase() === "content-length") { + this.contentLength += buf.toString(); + } + this.trackHeader(buf.length); + } + trackHeader(len) { + this.headersSize += len; + if (this.headersSize >= this.headersMaxSize) { + util3.destroy(this.socket, new HeadersOverflowError()); + } + } + onUpgrade(head) { + const { upgrade, client, socket, headers, statusCode } = this; + assert(upgrade); + const request = client[kQueue][client[kRunningIdx]]; + assert(request); + assert(!socket.destroyed); + assert(socket === client[kSocket]); + assert(!this.paused); + assert(request.upgrade || request.method === "CONNECT"); + this.statusCode = null; + this.statusText = ""; + this.shouldKeepAlive = null; + assert(this.headers.length % 2 === 0); + this.headers = []; + this.headersSize = 0; + socket.unshift(head); + socket[kParser].destroy(); + socket[kParser] = null; + socket[kClient] = null; + socket[kError] = null; + socket.removeListener("error", onSocketError).removeListener("readable", onSocketReadable).removeListener("end", onSocketEnd).removeListener("close", onSocketClose); + client[kSocket] = null; + client[kQueue][client[kRunningIdx]++] = null; + client.emit("disconnect", client[kUrl], [client], new InformationalError("upgrade")); + try { + request.onUpgrade(statusCode, headers, socket); + } catch (err) { + util3.destroy(socket, err); + } + resume(client); + } + onHeadersComplete(statusCode, upgrade, shouldKeepAlive) { + const { client, socket, headers, statusText } = this; + if (socket.destroyed) { + return -1; + } + const request = client[kQueue][client[kRunningIdx]]; + if (!request) { + return -1; + } + assert(!this.upgrade); + assert(this.statusCode < 200); + if (statusCode === 100) { + util3.destroy(socket, new SocketError("bad response", util3.getSocketInfo(socket))); + return -1; + } + if (upgrade && !request.upgrade) { + util3.destroy(socket, new SocketError("bad upgrade", util3.getSocketInfo(socket))); + return -1; + } + assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS); + this.statusCode = statusCode; + this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD. + request.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive"; + if (this.statusCode >= 200) { + const bodyTimeout = request.bodyTimeout != null ? request.bodyTimeout : client[kBodyTimeout]; + this.setTimeout(bodyTimeout, TIMEOUT_BODY); + } else if (this.timeout) { + if (this.timeout.refresh) { + this.timeout.refresh(); + } + } + if (request.method === "CONNECT") { + assert(client[kRunning] === 1); + this.upgrade = true; + return 2; + } + if (upgrade) { + assert(client[kRunning] === 1); + this.upgrade = true; + return 2; + } + assert(this.headers.length % 2 === 0); + this.headers = []; + this.headersSize = 0; + if (this.shouldKeepAlive && client[kPipelining]) { + const keepAliveTimeout = this.keepAlive ? util3.parseKeepAliveTimeout(this.keepAlive) : null; + if (keepAliveTimeout != null) { + const timeout = Math.min( + keepAliveTimeout - client[kKeepAliveTimeoutThreshold], + client[kKeepAliveMaxTimeout] + ); + if (timeout <= 0) { + socket[kReset] = true; + } else { + client[kKeepAliveTimeoutValue] = timeout; } + } else { + client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]; } - N2.push(c2); + } else { + socket[kReset] = true; } - } else { - N2 = concatMap(n2, function(el) { - return expand(el, false); - }); + let pause; + try { + pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false; + } catch (err) { + util3.destroy(socket, err); + return -1; + } + if (request.method === "HEAD") { + return 1; + } + if (statusCode < 200) { + return 1; + } + if (socket[kBlocking]) { + socket[kBlocking] = false; + resume(client); + } + return pause ? constants.ERROR.PAUSED : 0; } - for (var j2 = 0; j2 < N2.length; j2++) { - for (var k2 = 0; k2 < post2.length; k2++) { - var expansion = pre + N2[j2] + post2[k2]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); + onBody(buf) { + const { client, socket, statusCode, maxResponseSize } = this; + if (socket.destroyed) { + return -1; + } + const request = client[kQueue][client[kRunningIdx]]; + assert(request); + assert.strictEqual(this.timeoutType, TIMEOUT_BODY); + if (this.timeout) { + if (this.timeout.refresh) { + this.timeout.refresh(); + } + } + assert(statusCode >= 200); + if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { + util3.destroy(socket, new ResponseExceededMaxSizeError()); + return -1; + } + this.bytesRead += buf.length; + try { + if (request.onData(buf) === false) { + return constants.ERROR.PAUSED; + } + } catch (err) { + util3.destroy(socket, err); + return -1; } } - return expansions; - } - } -}); - -// node_modules/minimatch/minimatch.js -var require_minimatch = __commonJS({ - "node_modules/minimatch/minimatch.js"(exports, module) { - module.exports = minimatch; - minimatch.Minimatch = Minimatch; - var path15 = function() { - try { - return __require("path"); - } catch (e2) { + onMessageComplete() { + const { client, socket, statusCode, upgrade, headers, contentLength: contentLength2, bytesRead, shouldKeepAlive } = this; + if (socket.destroyed && (!statusCode || shouldKeepAlive)) { + return -1; + } + if (upgrade) { + return; + } + const request = client[kQueue][client[kRunningIdx]]; + assert(request); + assert(statusCode >= 100); + this.statusCode = null; + this.statusText = ""; + this.bytesRead = 0; + this.contentLength = ""; + this.keepAlive = ""; + this.connection = ""; + assert(this.headers.length % 2 === 0); + this.headers = []; + this.headersSize = 0; + if (statusCode < 200) { + return; + } + if (request.method !== "HEAD" && contentLength2 && bytesRead !== parseInt(contentLength2, 10)) { + util3.destroy(socket, new ResponseContentLengthMismatchError()); + return -1; + } + try { + request.onComplete(headers); + } catch (err) { + errorRequest(client, request, err); + } + client[kQueue][client[kRunningIdx]++] = null; + if (socket[kWriting]) { + assert.strictEqual(client[kRunning], 0); + util3.destroy(socket, new InformationalError("reset")); + return constants.ERROR.PAUSED; + } else if (!shouldKeepAlive) { + util3.destroy(socket, new InformationalError("reset")); + return constants.ERROR.PAUSED; + } else if (socket[kReset] && client[kRunning] === 0) { + util3.destroy(socket, new InformationalError("reset")); + return constants.ERROR.PAUSED; + } else if (client[kPipelining] === 1) { + setImmediate(resume, client); + } else { + resume(client); + } } - }() || { - sep: "/" - }; - minimatch.sep = path15.sep; - var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; - var expand = require_brace_expansion(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } }; - var qmark = "[^/]"; - var star = qmark + "*?"; - var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; - var reSpecials = charSet("().*{}+?[]^$\\!"); - function charSet(s2) { - return s2.split("").reduce(function(set2, c2) { - set2[c2] = true; - return set2; - }, {}); + function onParserTimeout(parser) { + const { socket, timeoutType, client } = parser; + if (timeoutType === TIMEOUT_HEADERS) { + if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { + assert(!parser.paused, "cannot be paused while waiting for headers"); + util3.destroy(socket, new HeadersTimeoutError()); + } + } else if (timeoutType === TIMEOUT_BODY) { + if (!parser.paused) { + util3.destroy(socket, new BodyTimeoutError()); + } + } else if (timeoutType === TIMEOUT_IDLE) { + assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); + util3.destroy(socket, new InformationalError("socket idle timeout")); + } } - var slashSplit = /\/+/; - minimatch.filter = filter; - function filter(pattern, options) { - options = options || {}; - return function(p2, i2, list3) { - return minimatch(p2, pattern, options); - }; + function onSocketReadable() { + const { [kParser]: parser } = this; + parser.readMore(); } - function ext(a2, b2) { - b2 = b2 || {}; - var t2 = {}; - Object.keys(a2).forEach(function(k2) { - t2[k2] = a2[k2]; - }); - Object.keys(b2).forEach(function(k2) { - t2[k2] = b2[k2]; - }); - return t2; + function onSocketError(err) { + const { [kClient]: client, [kParser]: parser } = this; + assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + if (client[kHTTPConnVersion] !== "h2") { + if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { + parser.onMessageComplete(); + return; + } + } + this[kError] = err; + onError(this[kClient], err); } - minimatch.defaults = function(def) { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch; + function onError(client, err) { + if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") { + assert(client[kPendingIdx] === client[kRunningIdx]); + const requests = client[kQueue].splice(client[kRunningIdx]); + for (let i2 = 0; i2 < requests.length; i2++) { + const request = requests[i2]; + errorRequest(client, request, err); + } + assert(client[kSize] === 0); } - var orig = minimatch; - var m3 = function minimatch2(p2, pattern, options) { - return orig(p2, pattern, ext(def, options)); - }; - m3.Minimatch = function Minimatch2(pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)); - }; - m3.Minimatch.defaults = function defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - }; - m3.filter = function filter2(pattern, options) { - return orig.filter(pattern, ext(def, options)); - }; - m3.defaults = function defaults(options) { - return orig.defaults(ext(def, options)); - }; - m3.makeRe = function makeRe2(pattern, options) { - return orig.makeRe(pattern, ext(def, options)); - }; - m3.braceExpand = function braceExpand2(pattern, options) { - return orig.braceExpand(pattern, ext(def, options)); - }; - m3.match = function(list3, pattern, options) { - return orig.match(list3, pattern, ext(def, options)); - }; - return m3; - }; - Minimatch.defaults = function(def) { - return minimatch.defaults(def).Minimatch; - }; - function minimatch(p2, pattern, options) { - assertValidPattern(pattern); - if (!options) - options = {}; - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; + } + function onSocketEnd() { + const { [kParser]: parser, [kClient]: client } = this; + if (client[kHTTPConnVersion] !== "h2") { + if (parser.statusCode && !parser.shouldKeepAlive) { + parser.onMessageComplete(); + return; + } } - return new Minimatch(pattern, options).match(p2); + util3.destroy(this, new SocketError("other side closed", util3.getSocketInfo(this))); } - function Minimatch(pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options); + function onSocketClose() { + const { [kClient]: client, [kParser]: parser } = this; + if (client[kHTTPConnVersion] === "h1" && parser) { + if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { + parser.onMessageComplete(); + } + this[kParser].destroy(); + this[kParser] = null; + } + const err = this[kError] || new SocketError("closed", util3.getSocketInfo(this)); + client[kSocket] = null; + if (client.destroyed) { + assert(client[kPending] === 0); + const requests = client[kQueue].splice(client[kRunningIdx]); + for (let i2 = 0; i2 < requests.length; i2++) { + const request = requests[i2]; + errorRequest(client, request, err); + } + } else if (client[kRunning] > 0 && err.code !== "UND_ERR_INFO") { + const request = client[kQueue][client[kRunningIdx]]; + client[kQueue][client[kRunningIdx]++] = null; + errorRequest(client, request, err); + } + client[kPendingIdx] = client[kRunningIdx]; + assert(client[kRunning] === 0); + client.emit("disconnect", client[kUrl], [client], err); + resume(client); + } + async function connect(client) { + assert(!client[kConnecting]); + assert(!client[kSocket]); + let { host, hostname, protocol, port } = client[kUrl]; + if (hostname[0] === "[") { + const idx = hostname.indexOf("]"); + assert(idx !== -1); + const ip = hostname.substr(1, idx - 1); + assert(net.isIP(ip)); + hostname = ip; + } + client[kConnecting] = true; + if (channels.beforeConnect.hasSubscribers) { + channels.beforeConnect.publish({ + connectParams: { + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector] + }); } - assertValidPattern(pattern); - if (!options) - options = {}; - pattern = pattern.trim(); - if (!options.allowWindowsEscape && path15.sep !== "/") { - pattern = pattern.split(path15.sep).join("/"); + try { + const socket = await new Promise((resolve2, reject) => { + client[kConnector]({ + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, (err, socket2) => { + if (err) { + reject(err); + } else { + resolve2(socket2); + } + }); + }); + if (client.destroyed) { + util3.destroy(socket.on("error", () => { + }), new ClientDestroyedError()); + return; + } + client[kConnecting] = false; + assert(socket); + const isH2 = socket.alpnProtocol === "h2"; + if (isH2) { + if (!h2ExperimentalWarned) { + h2ExperimentalWarned = true; + process.emitWarning("H2 support is experimental, expect them to change at any time.", { + code: "UNDICI-H2" + }); + } + const session = http22.connect(client[kUrl], { + createConnection: () => socket, + peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams + }); + client[kHTTPConnVersion] = "h2"; + session[kClient] = client; + session[kSocket] = socket; + session.on("error", onHttp2SessionError); + session.on("frameError", onHttp2FrameError); + session.on("end", onHttp2SessionEnd); + session.on("goaway", onHTTP2GoAway); + session.on("close", onSocketClose); + session.unref(); + client[kHTTP2Session] = session; + socket[kHTTP2Session] = session; + } else { + if (!llhttpInstance) { + llhttpInstance = await llhttpPromise; + llhttpPromise = null; + } + socket[kNoRef] = false; + socket[kWriting] = false; + socket[kReset] = false; + socket[kBlocking] = false; + socket[kParser] = new Parser2(client, socket, llhttpInstance); + } + socket[kCounter] = 0; + socket[kMaxRequests] = client[kMaxRequests]; + socket[kClient] = client; + socket[kError] = null; + socket.on("error", onSocketError).on("readable", onSocketReadable).on("end", onSocketEnd).on("close", onSocketClose); + client[kSocket] = socket; + if (channels.connected.hasSubscribers) { + channels.connected.publish({ + connectParams: { + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector], + socket + }); + } + client.emit("connect", client[kUrl], [client]); + } catch (err) { + if (client.destroyed) { + return; + } + client[kConnecting] = false; + if (channels.connectError.hasSubscribers) { + channels.connectError.publish({ + connectParams: { + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector], + error: err + }); + } + if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { + assert(client[kRunning] === 0); + while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { + const request = client[kQueue][client[kPendingIdx]++]; + errorRequest(client, request, err); + } + } else { + onError(client, err); + } + client.emit("connectionError", client[kUrl], [client], err); } - this.options = options; - this.set = []; - this.pattern = pattern; - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); + resume(client); } - Minimatch.prototype.debug = function() { - }; - Minimatch.prototype.make = make; - function make() { - var pattern = this.pattern; - var options = this.options; - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true; + function emitDrain(client) { + client[kNeedDrain] = 0; + client.emit("drain", client[kUrl], [client]); + } + function resume(client, sync) { + if (client[kResuming] === 2) { return; } - if (!pattern) { - this.empty = true; - return; + client[kResuming] = 2; + _resume(client, sync); + client[kResuming] = 0; + if (client[kRunningIdx] > 256) { + client[kQueue].splice(0, client[kRunningIdx]); + client[kPendingIdx] -= client[kRunningIdx]; + client[kRunningIdx] = 0; } - this.parseNegate(); - var set2 = this.globSet = this.braceExpand(); - if (options.debug) - this.debug = function debug3() { - console.error.apply(console, arguments); - }; - this.debug(this.pattern, set2); - set2 = this.globParts = set2.map(function(s2) { - return s2.split(slashSplit); - }); - this.debug(this.pattern, set2); - set2 = set2.map(function(s2, si, set3) { - return s2.map(this.parse, this); - }, this); - this.debug(this.pattern, set2); - set2 = set2.filter(function(s2) { - return s2.indexOf(false) === -1; - }); - this.debug(this.pattern, set2); - this.set = set2; } - Minimatch.prototype.parseNegate = parseNegate; - function parseNegate() { - var pattern = this.pattern; - var negate = false; - var options = this.options; - var negateOffset = 0; - if (options.nonegate) + function _resume(client, sync) { + while (true) { + if (client.destroyed) { + assert(client[kPending] === 0); + return; + } + if (client[kClosedResolve] && !client[kSize]) { + client[kClosedResolve](); + client[kClosedResolve] = null; + return; + } + const socket = client[kSocket]; + if (socket && !socket.destroyed && socket.alpnProtocol !== "h2") { + if (client[kSize] === 0) { + if (!socket[kNoRef] && socket.unref) { + socket.unref(); + socket[kNoRef] = true; + } + } else if (socket[kNoRef] && socket.ref) { + socket.ref(); + socket[kNoRef] = false; + } + if (client[kSize] === 0) { + if (socket[kParser].timeoutType !== TIMEOUT_IDLE) { + socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE); + } + } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) { + if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { + const request2 = client[kQueue][client[kRunningIdx]]; + const headersTimeout = request2.headersTimeout != null ? request2.headersTimeout : client[kHeadersTimeout]; + socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS); + } + } + } + if (client[kBusy]) { + client[kNeedDrain] = 2; + } else if (client[kNeedDrain] === 2) { + if (sync) { + client[kNeedDrain] = 1; + process.nextTick(emitDrain, client); + } else { + emitDrain(client); + } + continue; + } + if (client[kPending] === 0) { + return; + } + if (client[kRunning] >= (client[kPipelining] || 1)) { + return; + } + const request = client[kQueue][client[kPendingIdx]]; + if (client[kUrl].protocol === "https:" && client[kServerName] !== request.servername) { + if (client[kRunning] > 0) { + return; + } + client[kServerName] = request.servername; + if (socket && socket.servername !== request.servername) { + util3.destroy(socket, new InformationalError("servername changed")); + return; + } + } + if (client[kConnecting]) { + return; + } + if (!socket && !client[kHTTP2Session]) { + connect(client); + return; + } + if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) { + return; + } + if (client[kRunning] > 0 && !request.idempotent) { + return; + } + if (client[kRunning] > 0 && (request.upgrade || request.method === "CONNECT")) { + return; + } + if (util3.isStream(request.body) && util3.bodyLength(request.body) === 0) { + request.body.on( + "data", + /* istanbul ignore next */ + function() { + assert(false); + } + ).on("error", function(err) { + errorRequest(client, request, err); + }).on("end", function() { + util3.destroy(this); + }); + request.body = null; + } + if (client[kRunning] > 0 && (util3.isStream(request.body) || util3.isAsyncIterable(request.body))) { + return; + } + if (!request.aborted && write(client, request)) { + client[kPendingIdx]++; + } else { + client[kQueue].splice(client[kPendingIdx], 1); + } + } + } + function write(client, request) { + if (client[kHTTPConnVersion] === "h2") { + writeH2(client, client[kHTTP2Session], request); return; - for (var i2 = 0, l2 = pattern.length; i2 < l2 && pattern.charAt(i2) === "!"; i2++) { - negate = !negate; - negateOffset++; } - if (negateOffset) - this.pattern = pattern.substr(negateOffset); - this.negate = negate; + const { body: body2, method, path: path14, host, upgrade, headers, blocking, reset } = request; + const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; + if (body2 && typeof body2.read === "function") { + body2.read(0); + } + let contentLength2 = util3.bodyLength(body2); + if (contentLength2 === null) { + contentLength2 = request.contentLength; + } + if (contentLength2 === 0 && !expectsPayload) { + contentLength2 = null; + } + if (request.contentLength !== null && request.contentLength !== contentLength2) { + if (client[kStrictContentLength]) { + errorRequest(client, request, new RequestContentLengthMismatchError()); + return false; + } + process.emitWarning(new RequestContentLengthMismatchError()); + } + const socket = client[kSocket]; + try { + request.onConnect((err) => { + if (request.aborted || request.completed) { + return; + } + errorRequest(client, request, err || new RequestAbortedError()); + util3.destroy(socket, new InformationalError("aborted")); + }); + } catch (err) { + errorRequest(client, request, err); + } + if (request.aborted) { + return false; + } + if (method === "HEAD") { + socket[kReset] = true; + } + if (upgrade || method === "CONNECT") { + socket[kReset] = true; + } + if (reset != null) { + socket[kReset] = reset; + } + if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) { + socket[kReset] = true; + } + if (blocking) { + socket[kBlocking] = true; + } + let header = `${method} ${path14} HTTP/1.1\r +`; + if (typeof host === "string") { + header += `host: ${host}\r +`; + } else { + header += client[kHostHeader]; + } + if (upgrade) { + header += `connection: upgrade\r +upgrade: ${upgrade}\r +`; + } else if (client[kPipelining] && !socket[kReset]) { + header += "connection: keep-alive\r\n"; + } else { + header += "connection: close\r\n"; + } + if (headers) { + header += headers; + } + if (channels.sendHeaders.hasSubscribers) { + channels.sendHeaders.publish({ request, headers: header, socket }); + } + if (!body2) { + if (contentLength2 === 0) { + socket.write(`${header}content-length: 0\r +\r +`, "latin1"); + } else { + assert(contentLength2 === null, "no body must not have content length"); + socket.write(`${header}\r +`, "latin1"); + } + request.onRequestSent(); + } else if (util3.isBuffer(body2)) { + assert(contentLength2 === body2.byteLength, "buffer body must have content length"); + socket.cork(); + socket.write(`${header}content-length: ${contentLength2}\r +\r +`, "latin1"); + socket.write(body2); + socket.uncork(); + request.onBodySent(body2); + request.onRequestSent(); + if (!expectsPayload) { + socket[kReset] = true; + } + } else if (util3.isBlobLike(body2)) { + if (typeof body2.stream === "function") { + writeIterable({ body: body2.stream(), client, request, socket, contentLength: contentLength2, header, expectsPayload }); + } else { + writeBlob({ body: body2, client, request, socket, contentLength: contentLength2, header, expectsPayload }); + } + } else if (util3.isStream(body2)) { + writeStream({ body: body2, client, request, socket, contentLength: contentLength2, header, expectsPayload }); + } else if (util3.isIterable(body2)) { + writeIterable({ body: body2, client, request, socket, contentLength: contentLength2, header, expectsPayload }); + } else { + assert(false); + } + return true; } - minimatch.braceExpand = function(pattern, options) { - return braceExpand(pattern, options); - }; - Minimatch.prototype.braceExpand = braceExpand; - function braceExpand(pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options; + function writeH2(client, session, request) { + const { body: body2, method, path: path14, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; + let headers; + if (typeof reqHeaders === "string") + headers = Request2[kHTTP2CopyHeaders](reqHeaders.trim()); + else + headers = reqHeaders; + if (upgrade) { + errorRequest(client, request, new Error("Upgrade not supported for H2")); + return false; + } + try { + request.onConnect((err) => { + if (request.aborted || request.completed) { + return; + } + errorRequest(client, request, err || new RequestAbortedError()); + }); + } catch (err) { + errorRequest(client, request, err); + } + if (request.aborted) { + return false; + } + let stream; + const h2State = client[kHTTP2SessionState]; + headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]; + headers[HTTP2_HEADER_METHOD] = method; + if (method === "CONNECT") { + session.ref(); + stream = session.request(headers, { endStream: false, signal }); + if (stream.id && !stream.pending) { + request.onUpgrade(null, null, stream); + ++h2State.openStreams; } else { - options = {}; + stream.once("ready", () => { + request.onUpgrade(null, null, stream); + ++h2State.openStreams; + }); } + stream.once("close", () => { + h2State.openStreams -= 1; + if (h2State.openStreams === 0) + session.unref(); + }); + return true; } - pattern = typeof pattern === "undefined" ? this.pattern : pattern; - assertValidPattern(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; + headers[HTTP2_HEADER_PATH] = path14; + headers[HTTP2_HEADER_SCHEME] = "https"; + const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; + if (body2 && typeof body2.read === "function") { + body2.read(0); } - return expand(pattern); - } - var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = function(pattern) { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); + let contentLength2 = util3.bodyLength(body2); + if (contentLength2 == null) { + contentLength2 = request.contentLength; } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError("pattern is too long"); + if (contentLength2 === 0 || !expectsPayload) { + contentLength2 = null; } - }; - Minimatch.prototype.parse = parse5; - var SUBPARSE = {}; - function parse5(pattern, isSub) { - assertValidPattern(pattern); - var options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR; - else - pattern = "*"; + if (request.contentLength != null && request.contentLength !== contentLength2) { + if (client[kStrictContentLength]) { + errorRequest(client, request, new RequestContentLengthMismatchError()); + return false; + } + process.emitWarning(new RequestContentLengthMismatchError()); } - if (pattern === "") - return ""; - var re3 = ""; - var hasMagic = !!options.nocase; - var escaping = false; - var patternListStack = []; - var negativeLists = []; - var stateChar; - var inClass = false; - var reClassStart = -1; - var classStart = -1; - var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; - var self2 = this; - function clearStateChar() { - if (stateChar) { - switch (stateChar) { - case "*": - re3 += star; - hasMagic = true; - break; - case "?": - re3 += qmark; - hasMagic = true; - break; - default: - re3 += "\\" + stateChar; - break; + if (contentLength2 != null) { + assert(body2, "no body must not have content length"); + headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength2}`; + } + session.ref(); + const shouldEndStream = method === "GET" || method === "HEAD"; + if (expectContinue) { + headers[HTTP2_HEADER_EXPECT] = "100-continue"; + stream = session.request(headers, { endStream: shouldEndStream, signal }); + stream.once("continue", writeBodyH2); + } else { + stream = session.request(headers, { + endStream: shouldEndStream, + signal + }); + writeBodyH2(); + } + ++h2State.openStreams; + stream.once("response", (headers2) => { + if (request.onHeaders(Number(headers2[HTTP2_HEADER_STATUS]), headers2, stream.resume.bind(stream), "") === false) { + stream.pause(); + } + }); + stream.once("end", () => { + request.onComplete([]); + }); + stream.on("data", (chunk) => { + if (request.onData(chunk) === false) + stream.pause(); + }); + stream.once("close", () => { + h2State.openStreams -= 1; + if (h2State.openStreams === 0) + session.unref(); + }); + stream.once("error", function(err) { + if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { + h2State.streams -= 1; + util3.destroy(stream, err); + } + }); + stream.once("frameError", (type3, code) => { + const err = new InformationalError(`HTTP/2: "frameError" received - type ${type3}, code ${code}`); + errorRequest(client, request, err); + if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { + h2State.streams -= 1; + util3.destroy(stream, err); + } + }); + return true; + function writeBodyH2() { + if (!body2) { + request.onRequestSent(); + } else if (util3.isBuffer(body2)) { + assert(contentLength2 === body2.byteLength, "buffer body must have content length"); + stream.cork(); + stream.write(body2); + stream.uncork(); + stream.end(); + request.onBodySent(body2); + request.onRequestSent(); + } else if (util3.isBlobLike(body2)) { + if (typeof body2.stream === "function") { + writeIterable({ + client, + request, + contentLength: contentLength2, + h2stream: stream, + expectsPayload, + body: body2.stream(), + socket: client[kSocket], + header: "" + }); + } else { + writeBlob({ + body: body2, + client, + request, + contentLength: contentLength2, + expectsPayload, + h2stream: stream, + header: "", + socket: client[kSocket] + }); } - self2.debug("clearStateChar %j %j", stateChar, re3); - stateChar = false; + } else if (util3.isStream(body2)) { + writeStream({ + body: body2, + client, + request, + contentLength: contentLength2, + expectsPayload, + socket: client[kSocket], + h2stream: stream, + header: "" + }); + } else if (util3.isIterable(body2)) { + writeIterable({ + body: body2, + client, + request, + contentLength: contentLength2, + expectsPayload, + header: "", + h2stream: stream, + socket: client[kSocket] + }); + } else { + assert(false); } } - for (var i2 = 0, len = pattern.length, c2; i2 < len && (c2 = pattern.charAt(i2)); i2++) { - this.debug("%s %s %s %j", pattern, i2, re3, c2); - if (escaping && reSpecials[c2]) { - re3 += "\\" + c2; - escaping = false; - continue; + } + function writeStream({ h2stream, body: body2, client, request, socket, contentLength: contentLength2, header, expectsPayload }) { + assert(contentLength2 !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); + if (client[kHTTPConnVersion] === "h2") { + let onPipeData = function(chunk) { + request.onBodySent(chunk); + }; + const pipe = pipeline( + body2, + h2stream, + (err) => { + if (err) { + util3.destroy(body2, err); + util3.destroy(h2stream, err); + } else { + request.onRequestSent(); + } + } + ); + pipe.on("data", onPipeData); + pipe.once("end", () => { + pipe.removeListener("data", onPipeData); + util3.destroy(pipe); + }); + return; + } + let finished = false; + const writer = new AsyncWriter({ socket, request, contentLength: contentLength2, client, expectsPayload, header }); + const onData = function(chunk) { + if (finished) { + return; } - switch (c2) { - case "/": { - return false; + try { + if (!writer.write(chunk) && this.pause) { + this.pause(); } - case "\\": - clearStateChar(); - escaping = true; - continue; - case "?": - case "*": - case "+": - case "@": - case "!": - this.debug("%s %s %s %j <-- stateChar", pattern, i2, re3, c2); - if (inClass) { - this.debug(" in class"); - if (c2 === "!" && i2 === classStart + 1) - c2 = "^"; - re3 += c2; - continue; - } - self2.debug("call clearStateChar %j", stateChar); - clearStateChar(); - stateChar = c2; - if (options.noext) - clearStateChar(); - continue; - case "(": - if (inClass) { - re3 += "("; - continue; - } - if (!stateChar) { - re3 += "\\("; - continue; - } - patternListStack.push({ - type: stateChar, - start: i2 - 1, - reStart: re3.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }); - re3 += stateChar === "!" ? "(?:(?!(?:" : "(?:"; - this.debug("plType %j %j", stateChar, re3); - stateChar = false; - continue; - case ")": - if (inClass || !patternListStack.length) { - re3 += "\\)"; - continue; - } - clearStateChar(); - hasMagic = true; - var pl = patternListStack.pop(); - re3 += pl.close; - if (pl.type === "!") { - negativeLists.push(pl); - } - pl.reEnd = re3.length; - continue; - case "|": - if (inClass || !patternListStack.length || escaping) { - re3 += "\\|"; - escaping = false; - continue; - } - clearStateChar(); - re3 += "|"; - continue; - case "[": - clearStateChar(); - if (inClass) { - re3 += "\\" + c2; - continue; - } - inClass = true; - classStart = i2; - reClassStart = re3.length; - re3 += c2; - continue; - case "]": - if (i2 === classStart + 1 || !inClass) { - re3 += "\\" + c2; - escaping = false; - continue; - } - var cs = pattern.substring(classStart + 1, i2); - try { - RegExp("[" + cs + "]"); - } catch (er2) { - var sp = this.parse(cs, SUBPARSE); - re3 = re3.substr(0, reClassStart) + "\\[" + sp[0] + "\\]"; - hasMagic = hasMagic || sp[1]; - inClass = false; - continue; - } - hasMagic = true; - inClass = false; - re3 += c2; - continue; - default: - clearStateChar(); - if (escaping) { - escaping = false; - } else if (reSpecials[c2] && !(c2 === "^" && inClass)) { - re3 += "\\"; - } - re3 += c2; + } catch (err) { + util3.destroy(this, err); + } + }; + const onDrain = function() { + if (finished) { + return; + } + if (body2.resume) { + body2.resume(); + } + }; + const onAbort = function() { + onFinished(new RequestAbortedError()); + }; + const onFinished = function(err) { + if (finished) { + return; + } + finished = true; + assert(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); + socket.off("drain", onDrain).off("error", onFinished); + body2.removeListener("data", onData).removeListener("end", onFinished).removeListener("error", onFinished).removeListener("close", onAbort); + if (!err) { + try { + writer.end(); + } catch (er2) { + err = er2; + } + } + writer.destroy(err); + if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) { + util3.destroy(body2, err); + } else { + util3.destroy(body2); } + }; + body2.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onAbort); + if (body2.resume) { + body2.resume(); } - if (inClass) { - cs = pattern.substr(classStart + 1); - sp = this.parse(cs, SUBPARSE); - re3 = re3.substr(0, reClassStart) + "\\[" + sp[0]; - hasMagic = hasMagic || sp[1]; + socket.on("drain", onDrain).on("error", onFinished); + } + async function writeBlob({ h2stream, body: body2, client, request, socket, contentLength: contentLength2, header, expectsPayload }) { + assert(contentLength2 === body2.size, "blob body must have content length"); + const isH2 = client[kHTTPConnVersion] === "h2"; + try { + if (contentLength2 != null && contentLength2 !== body2.size) { + throw new RequestContentLengthMismatchError(); + } + const buffer = Buffer.from(await body2.arrayBuffer()); + if (isH2) { + h2stream.cork(); + h2stream.write(buffer); + h2stream.uncork(); + } else { + socket.cork(); + socket.write(`${header}content-length: ${contentLength2}\r +\r +`, "latin1"); + socket.write(buffer); + socket.uncork(); + } + request.onBodySent(buffer); + request.onRequestSent(); + if (!expectsPayload) { + socket[kReset] = true; + } + resume(client); + } catch (err) { + util3.destroy(isH2 ? h2stream : socket, err); } - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re3.slice(pl.reStart + pl.open.length); - this.debug("setting tail", re3, pl); - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_2, $1, $2) { - if (!$2) { - $2 = "\\"; + } + async function writeIterable({ h2stream, body: body2, client, request, socket, contentLength: contentLength2, header, expectsPayload }) { + assert(contentLength2 !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); + let callback = null; + function onDrain() { + if (callback) { + const cb = callback; + callback = null; + cb(); + } + } + const waitForDrain = () => new Promise((resolve2, reject) => { + assert(callback === null); + if (socket[kError]) { + reject(socket[kError]); + } else { + callback = resolve2; + } + }); + if (client[kHTTPConnVersion] === "h2") { + h2stream.on("close", onDrain).on("drain", onDrain); + try { + for await (const chunk of body2) { + if (socket[kError]) { + throw socket[kError]; + } + const res = h2stream.write(chunk); + request.onBodySent(chunk); + if (!res) { + await waitForDrain(); + } } - return $1 + $1 + $2 + "|"; - }); - this.debug("tail=%j\n %s", tail, tail, pl, re3); - var t2 = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; - hasMagic = true; - re3 = re3.slice(0, pl.reStart) + t2 + "\\(" + tail; + } catch (err) { + h2stream.destroy(err); + } finally { + request.onRequestSent(); + h2stream.end(); + h2stream.off("close", onDrain).off("drain", onDrain); + } + return; } - clearStateChar(); - if (escaping) { - re3 += "\\\\"; + socket.on("close", onDrain).on("drain", onDrain); + const writer = new AsyncWriter({ socket, request, contentLength: contentLength2, client, expectsPayload, header }); + try { + for await (const chunk of body2) { + if (socket[kError]) { + throw socket[kError]; + } + if (!writer.write(chunk)) { + await waitForDrain(); + } + } + writer.end(); + } catch (err) { + writer.destroy(err); + } finally { + socket.off("close", onDrain).off("drain", onDrain); } - var addPatternStart = false; - switch (re3.charAt(0)) { - case "[": - case ".": - case "(": - addPatternStart = true; + } + var AsyncWriter = class { + constructor({ socket, request, contentLength: contentLength2, client, expectsPayload, header }) { + this.socket = socket; + this.request = request; + this.contentLength = contentLength2; + this.client = client; + this.bytesWritten = 0; + this.expectsPayload = expectsPayload; + this.header = header; + socket[kWriting] = true; } - for (var n2 = negativeLists.length - 1; n2 > -1; n2--) { - var nl = negativeLists[n2]; - var nlBefore = re3.slice(0, nl.reStart); - var nlFirst = re3.slice(nl.reStart, nl.reEnd - 8); - var nlLast = re3.slice(nl.reEnd - 8, nl.reEnd); - var nlAfter = re3.slice(nl.reEnd); - nlLast += nlAfter; - var openParensBefore = nlBefore.split("(").length - 1; - var cleanAfter = nlAfter; - for (i2 = 0; i2 < openParensBefore; i2++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, ""); + write(chunk) { + const { socket, request, contentLength: contentLength2, client, bytesWritten, expectsPayload, header } = this; + if (socket[kError]) { + throw socket[kError]; } - nlAfter = cleanAfter; - var dollar = ""; - if (nlAfter === "" && isSub !== SUBPARSE) { - dollar = "$"; + if (socket.destroyed) { + return false; } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; - re3 = newRe; - } - if (re3 !== "" && hasMagic) { - re3 = "(?=.)" + re3; - } - if (addPatternStart) { - re3 = patternStart + re3; + const len = Buffer.byteLength(chunk); + if (!len) { + return true; + } + if (contentLength2 !== null && bytesWritten + len > contentLength2) { + if (client[kStrictContentLength]) { + throw new RequestContentLengthMismatchError(); + } + process.emitWarning(new RequestContentLengthMismatchError()); + } + socket.cork(); + if (bytesWritten === 0) { + if (!expectsPayload) { + socket[kReset] = true; + } + if (contentLength2 === null) { + socket.write(`${header}transfer-encoding: chunked\r +`, "latin1"); + } else { + socket.write(`${header}content-length: ${contentLength2}\r +\r +`, "latin1"); + } + } + if (contentLength2 === null) { + socket.write(`\r +${len.toString(16)}\r +`, "latin1"); + } + this.bytesWritten += len; + const ret = socket.write(chunk); + socket.uncork(); + request.onBodySent(chunk); + if (!ret) { + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + if (socket[kParser].timeout.refresh) { + socket[kParser].timeout.refresh(); + } + } + } + return ret; } - if (isSub === SUBPARSE) { - return [re3, hasMagic]; + end() { + const { socket, contentLength: contentLength2, client, bytesWritten, expectsPayload, header, request } = this; + request.onRequestSent(); + socket[kWriting] = false; + if (socket[kError]) { + throw socket[kError]; + } + if (socket.destroyed) { + return; + } + if (bytesWritten === 0) { + if (expectsPayload) { + socket.write(`${header}content-length: 0\r +\r +`, "latin1"); + } else { + socket.write(`${header}\r +`, "latin1"); + } + } else if (contentLength2 === null) { + socket.write("\r\n0\r\n\r\n", "latin1"); + } + if (contentLength2 !== null && bytesWritten !== contentLength2) { + if (client[kStrictContentLength]) { + throw new RequestContentLengthMismatchError(); + } else { + process.emitWarning(new RequestContentLengthMismatchError()); + } + } + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + if (socket[kParser].timeout.refresh) { + socket[kParser].timeout.refresh(); + } + } + resume(client); } - if (!hasMagic) { - return globUnescape(pattern); + destroy(err) { + const { socket, client } = this; + socket[kWriting] = false; + if (err) { + assert(client[kRunning] <= 1, "pipeline should only contain this request"); + util3.destroy(socket, err); + } } - var flags = options.nocase ? "i" : ""; + }; + function errorRequest(client, request, err) { try { - var regExp = new RegExp("^" + re3 + "$", flags); - } catch (er2) { - return new RegExp("$."); + request.onError(err); + assert(request.aborted); + } catch (err2) { + client.emit("error", err2); } - regExp._glob = pattern; - regExp._src = re3; - return regExp; } - minimatch.makeRe = function(pattern, options) { - return new Minimatch(pattern, options || {}).makeRe(); - }; - Minimatch.prototype.makeRe = makeRe; - function makeRe() { - if (this.regexp || this.regexp === false) - return this.regexp; - var set2 = this.set; - if (!set2.length) { - this.regexp = false; - return this.regexp; + module.exports = Client; + } +}); + +// node_modules/undici/lib/node/fixed-queue.js +var require_fixed_queue = __commonJS({ + "node_modules/undici/lib/node/fixed-queue.js"(exports, module) { + "use strict"; + var kSize = 2048; + var kMask = kSize - 1; + var FixedCircularBuffer = class { + constructor() { + this.bottom = 0; + this.top = 0; + this.list = new Array(kSize); + this.next = null; } - var options = this.options; - var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; - var flags = options.nocase ? "i" : ""; - var re3 = set2.map(function(pattern) { - return pattern.map(function(p2) { - return p2 === GLOBSTAR ? twoStar : typeof p2 === "string" ? regExpEscape(p2) : p2._src; - }).join("\\/"); - }).join("|"); - re3 = "^(?:" + re3 + ")$"; - if (this.negate) - re3 = "^(?!" + re3 + ").*$"; - try { - this.regexp = new RegExp(re3, flags); - } catch (ex) { - this.regexp = false; + isEmpty() { + return this.top === this.bottom; } - return this.regexp; - } - minimatch.match = function(list3, pattern, options) { - options = options || {}; - var mm = new Minimatch(pattern, options); - list3 = list3.filter(function(f2) { - return mm.match(f2); - }); - if (mm.options.nonull && !list3.length) { - list3.push(pattern); + isFull() { + return (this.top + 1 & kMask) === this.bottom; + } + push(data) { + this.list[this.top] = data; + this.top = this.top + 1 & kMask; + } + shift() { + const nextItem = this.list[this.bottom]; + if (nextItem === void 0) + return null; + this.list[this.bottom] = void 0; + this.bottom = this.bottom + 1 & kMask; + return nextItem; } - return list3; }; - Minimatch.prototype.match = function match(f2, partial) { - if (typeof partial === "undefined") - partial = this.partial; - this.debug("match", f2, this.pattern); - if (this.comment) - return false; - if (this.empty) - return f2 === ""; - if (f2 === "/" && partial) - return true; - var options = this.options; - if (path15.sep !== "/") { - f2 = f2.split(path15.sep).join("/"); + module.exports = class FixedQueue { + constructor() { + this.head = this.tail = new FixedCircularBuffer(); } - f2 = f2.split(slashSplit); - this.debug(this.pattern, "split", f2); - var set2 = this.set; - this.debug(this.pattern, "set", set2); - var filename; - var i2; - for (i2 = f2.length - 1; i2 >= 0; i2--) { - filename = f2[i2]; - if (filename) - break; + isEmpty() { + return this.head.isEmpty(); } - for (i2 = 0; i2 < set2.length; i2++) { - var pattern = set2[i2]; - var file = f2; - if (options.matchBase && pattern.length === 1) { - file = [filename]; + push(data) { + if (this.head.isFull()) { + this.head = this.head.next = new FixedCircularBuffer(); } - var hit = this.matchOne(file, pattern, partial); - if (hit) { - if (options.flipNegate) - return true; - return !this.negate; + this.head.push(data); + } + shift() { + const tail = this.tail; + const next = tail.shift(); + if (tail.isEmpty() && tail.next !== null) { + this.tail = tail.next; } + return next; } - if (options.flipNegate) - return false; - return this.negate; }; - Minimatch.prototype.matchOne = function(file, pattern, partial) { - var options = this.options; - this.debug( - "matchOne", - { "this": this, file, pattern } - ); - this.debug("matchOne", file.length, pattern.length); - for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { - this.debug("matchOne loop"); - var p2 = pattern[pi]; - var f2 = file[fi]; - this.debug(pattern, p2, f2); - if (p2 === false) - return false; - if (p2 === GLOBSTAR) { - this.debug("GLOBSTAR", [pattern, p2, f2]); - var fr2 = fi; - var pr2 = pi + 1; - if (pr2 === pl) { - this.debug("** at the end"); - for (; fi < fl; fi++) { - if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") - return false; + } +}); + +// node_modules/undici/lib/pool-stats.js +var require_pool_stats = __commonJS({ + "node_modules/undici/lib/pool-stats.js"(exports, module) { + var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); + var kPool = Symbol("pool"); + var PoolStats = class { + constructor(pool) { + this[kPool] = pool; + } + get connected() { + return this[kPool][kConnected]; + } + get free() { + return this[kPool][kFree]; + } + get pending() { + return this[kPool][kPending]; + } + get queued() { + return this[kPool][kQueued]; + } + get running() { + return this[kPool][kRunning]; + } + get size() { + return this[kPool][kSize]; + } + }; + module.exports = PoolStats; + } +}); + +// node_modules/undici/lib/pool-base.js +var require_pool_base = __commonJS({ + "node_modules/undici/lib/pool-base.js"(exports, module) { + "use strict"; + var DispatcherBase = require_dispatcher_base(); + var FixedQueue = require_fixed_queue(); + var { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require_symbols(); + var PoolStats = require_pool_stats(); + var kClients = Symbol("clients"); + var kNeedDrain = Symbol("needDrain"); + var kQueue = Symbol("queue"); + var kClosedResolve = Symbol("closed resolve"); + var kOnDrain = Symbol("onDrain"); + var kOnConnect = Symbol("onConnect"); + var kOnDisconnect = Symbol("onDisconnect"); + var kOnConnectionError = Symbol("onConnectionError"); + var kGetDispatcher = Symbol("get dispatcher"); + var kAddClient = Symbol("add client"); + var kRemoveClient = Symbol("remove client"); + var kStats = Symbol("stats"); + var PoolBase = class extends DispatcherBase { + constructor() { + super(); + this[kQueue] = new FixedQueue(); + this[kClients] = []; + this[kQueued] = 0; + const pool = this; + this[kOnDrain] = function onDrain(origin, targets) { + const queue = pool[kQueue]; + let needDrain = false; + while (!needDrain) { + const item = queue.shift(); + if (!item) { + break; } - return true; + pool[kQueued]--; + needDrain = !this.dispatch(item.opts, item.handler); } - while (fr2 < fl) { - var swallowee = file[fr2]; - this.debug("\nglobstar while", file, fr2, pattern, pr2, swallowee); - if (this.matchOne(file.slice(fr2), pattern.slice(pr2), partial)) { - this.debug("globstar found match!", fr2, fl, swallowee); - return true; - } else { - if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { - this.debug("dot detected!", file, fr2, pattern, pr2); - break; - } - this.debug("globstar swallow a segment, and continue"); - fr2++; - } + this[kNeedDrain] = needDrain; + if (!this[kNeedDrain] && pool[kNeedDrain]) { + pool[kNeedDrain] = false; + pool.emit("drain", origin, [pool, ...targets]); } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr2, pattern, pr2); - if (fr2 === fl) - return true; + if (pool[kClosedResolve] && queue.isEmpty()) { + Promise.all(pool[kClients].map((c2) => c2.close())).then(pool[kClosedResolve]); } - return false; + }; + this[kOnConnect] = (origin, targets) => { + pool.emit("connect", origin, [pool, ...targets]); + }; + this[kOnDisconnect] = (origin, targets, err) => { + pool.emit("disconnect", origin, [pool, ...targets], err); + }; + this[kOnConnectionError] = (origin, targets, err) => { + pool.emit("connectionError", origin, [pool, ...targets], err); + }; + this[kStats] = new PoolStats(this); + } + get [kBusy]() { + return this[kNeedDrain]; + } + get [kConnected]() { + return this[kClients].filter((client) => client[kConnected]).length; + } + get [kFree]() { + return this[kClients].filter((client) => client[kConnected] && !client[kNeedDrain]).length; + } + get [kPending]() { + let ret = this[kQueued]; + for (const { [kPending]: pending } of this[kClients]) { + ret += pending; } - var hit; - if (typeof p2 === "string") { - hit = f2 === p2; - this.debug("string match", p2, f2, hit); + return ret; + } + get [kRunning]() { + let ret = 0; + for (const { [kRunning]: running } of this[kClients]) { + ret += running; + } + return ret; + } + get [kSize]() { + let ret = this[kQueued]; + for (const { [kSize]: size } of this[kClients]) { + ret += size; + } + return ret; + } + get stats() { + return this[kStats]; + } + async [kClose]() { + if (this[kQueue].isEmpty()) { + return Promise.all(this[kClients].map((c2) => c2.close())); } else { - hit = f2.match(p2); - this.debug("pattern match", p2, f2, hit); + return new Promise((resolve2) => { + this[kClosedResolve] = resolve2; + }); } - if (!hit) - return false; } - if (fi === fl && pi === pl) { - return true; - } else if (fi === fl) { - return partial; - } else if (pi === pl) { - return fi === fl - 1 && file[fi] === ""; + async [kDestroy](err) { + while (true) { + const item = this[kQueue].shift(); + if (!item) { + break; + } + item.handler.onError(err); + } + return Promise.all(this[kClients].map((c2) => c2.destroy(err))); + } + [kDispatch](opts, handler) { + const dispatcher = this[kGetDispatcher](); + if (!dispatcher) { + this[kNeedDrain] = true; + this[kQueue].push({ opts, handler }); + this[kQueued]++; + } else if (!dispatcher.dispatch(opts, handler)) { + dispatcher[kNeedDrain] = true; + this[kNeedDrain] = !this[kGetDispatcher](); + } + return !this[kNeedDrain]; + } + [kAddClient](client) { + client.on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); + this[kClients].push(client); + if (this[kNeedDrain]) { + process.nextTick(() => { + if (this[kNeedDrain]) { + this[kOnDrain](client[kUrl], [this, client]); + } + }); + } + return this; + } + [kRemoveClient](client) { + client.close(() => { + const idx = this[kClients].indexOf(client); + if (idx !== -1) { + this[kClients].splice(idx, 1); + } + }); + this[kNeedDrain] = this[kClients].some((dispatcher) => !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true); } - throw new Error("wtf?"); }; - function globUnescape(s2) { - return s2.replace(/\\(.)/g, "$1"); - } - function regExpEscape(s2) { - return s2.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - } + module.exports = { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kRemoveClient, + kGetDispatcher + }; } }); -// node_modules/@actions/glob/lib/internal-path.js -var require_internal_path = __commonJS({ - "node_modules/@actions/glob/lib/internal-path.js"(exports) { +// node_modules/undici/lib/pool.js +var require_pool = __commonJS({ + "node_modules/undici/lib/pool.js"(exports, module) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - Object.defineProperty(o2, k22, { enumerable: true, get: function() { - return m3[k2]; - } }); - } : function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - o2[k22] = m3[k2]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { - Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); - } : function(o2, v2) { - o2["default"] = v2; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k2 in mod) - if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) - __createBinding(result, mod, k2); - } - __setModuleDefault(result, mod); - return result; - }; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Path = void 0; - var path15 = __importStar(__require("path")); - var pathHelper = __importStar(require_internal_path_helper()); - var assert_1 = __importDefault(__require("assert")); - var IS_WINDOWS = process.platform === "win32"; - var Path = class { - /** - * Constructs a Path - * @param itemPath Path or array of segments - */ - constructor(itemPath) { - this.segments = []; - if (typeof itemPath === "string") { - assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path15.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path15.basename(remaining); - this.segments.unshift(basename); - remaining = dir; - dir = pathHelper.dirname(remaining); - } - this.segments.unshift(remaining); - } - } else { - assert_1.default(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`); - for (let i2 = 0; i2 < itemPath.length; i2++) { - let segment = itemPath[i2]; - assert_1.default(segment, `Parameter 'itemPath' must not contain any empty segments`); - segment = pathHelper.normalizeSeparators(itemPath[i2]); - if (i2 === 0 && pathHelper.hasRoot(segment)) { - segment = pathHelper.safeTrimTrailingSeparator(segment); - assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); - this.segments.push(segment); - } else { - assert_1.default(!segment.includes(path15.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } - } + var { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kGetDispatcher + } = require_pool_base(); + var Client = require_client(); + var { + InvalidArgumentError + } = require_errors(); + var util3 = require_util(); + var { kUrl, kInterceptors } = require_symbols(); + var buildConnector = require_connect(); + var kOptions = Symbol("options"); + var kConnections = Symbol("connections"); + var kFactory = Symbol("factory"); + function defaultFactory(origin, opts) { + return new Client(origin, opts); + } + var Pool = class extends PoolBase { + constructor(origin, { + connections, + factory = defaultFactory, + connect, + connectTimeout, + tls, + maxCachedSessions, + socketPath, + autoSelectFamily, + autoSelectFamilyAttemptTimeout, + allowH2, + ...options + } = {}) { + super(); + if (connections != null && (!Number.isFinite(connections) || connections < 0)) { + throw new InvalidArgumentError("invalid connections"); + } + if (typeof factory !== "function") { + throw new InvalidArgumentError("factory must be a function."); + } + if (connect != null && typeof connect !== "function" && typeof connect !== "object") { + throw new InvalidArgumentError("connect must be a function or an object"); + } + if (typeof connect !== "function") { + connect = buildConnector({ + ...tls, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout == null ? 1e4 : connectTimeout, + ...util3.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, + ...connect + }); } + this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool) ? options.interceptors.Pool : []; + this[kConnections] = connections || null; + this[kUrl] = util3.parseOrigin(origin); + this[kOptions] = { ...util3.deepClone(options), connect, allowH2 }; + this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; + this[kFactory] = factory; } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path15.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i2 = 1; i2 < this.segments.length; i2++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path15.sep; - } - result += this.segments[i2]; + [kGetDispatcher]() { + let dispatcher = this[kClients].find((dispatcher2) => !dispatcher2[kNeedDrain]); + if (dispatcher) { + return dispatcher; } - return result; + if (!this[kConnections] || this[kClients].length < this[kConnections]) { + dispatcher = this[kFactory](this[kUrl], this[kOptions]); + this[kAddClient](dispatcher); + } + return dispatcher; } }; - exports.Path = Path; + module.exports = Pool; } }); -// node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern = __commonJS({ - "node_modules/@actions/glob/lib/internal-pattern.js"(exports) { +// node_modules/undici/lib/balanced-pool.js +var require_balanced_pool = __commonJS({ + "node_modules/undici/lib/balanced-pool.js"(exports, module) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - Object.defineProperty(o2, k22, { enumerable: true, get: function() { - return m3[k2]; - } }); - } : function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - o2[k22] = m3[k2]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { - Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); - } : function(o2, v2) { - o2["default"] = v2; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k2 in mod) - if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) - __createBinding(result, mod, k2); - } - __setModuleDefault(result, mod); - return result; - }; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Pattern = void 0; - var os3 = __importStar(__require("os")); - var path15 = __importStar(__require("path")); - var pathHelper = __importStar(require_internal_path_helper()); - var assert_1 = __importDefault(__require("assert")); - var minimatch_1 = require_minimatch(); - var internal_match_kind_1 = require_internal_match_kind(); - var internal_path_1 = require_internal_path(); - var IS_WINDOWS = process.platform === "win32"; - var Pattern = class _Pattern { - constructor(patternOrNegate, isImplicitPattern = false, segments, homedir2) { - this.negate = false; - let pattern; - if (typeof patternOrNegate === "string") { - pattern = patternOrNegate.trim(); - } else { - segments = segments || []; - assert_1.default(segments.length, `Parameter 'segments' must not empty`); - const root = _Pattern.getLiteral(segments[0]); - assert_1.default(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`); - pattern = new internal_path_1.Path(segments).toString().trim(); - if (patternOrNegate) { - pattern = `!${pattern}`; - } - } - while (pattern.startsWith("!")) { - this.negate = !this.negate; - pattern = pattern.substr(1).trim(); + var { + BalancedPoolMissingUpstreamError, + InvalidArgumentError + } = require_errors(); + var { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kRemoveClient, + kGetDispatcher + } = require_pool_base(); + var Pool = require_pool(); + var { kUrl, kInterceptors } = require_symbols(); + var { parseOrigin } = require_util(); + var kFactory = Symbol("factory"); + var kOptions = Symbol("options"); + var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor"); + var kCurrentWeight = Symbol("kCurrentWeight"); + var kIndex = Symbol("kIndex"); + var kWeight = Symbol("kWeight"); + var kMaxWeightPerServer = Symbol("kMaxWeightPerServer"); + var kErrorPenalty = Symbol("kErrorPenalty"); + function getGreatestCommonDivisor(a2, b2) { + if (b2 === 0) + return a2; + return getGreatestCommonDivisor(b2, a2 % b2); + } + function defaultFactory(origin, opts) { + return new Pool(origin, opts); + } + var BalancedPool = class extends PoolBase { + constructor(upstreams = [], { factory = defaultFactory, ...opts } = {}) { + super(); + this[kOptions] = opts; + this[kIndex] = -1; + this[kCurrentWeight] = 0; + this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100; + this[kErrorPenalty] = this[kOptions].errorPenalty || 15; + if (!Array.isArray(upstreams)) { + upstreams = [upstreams]; + } + if (typeof factory !== "function") { + throw new InvalidArgumentError("factory must be a function."); + } + this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool) ? opts.interceptors.BalancedPool : []; + this[kFactory] = factory; + for (const upstream of upstreams) { + this.addUpstream(upstream); + } + this._updateBalancedPoolStats(); + } + addUpstream(upstream) { + const upstreamOrigin = parseOrigin(upstream).origin; + if (this[kClients].find((pool2) => pool2[kUrl].origin === upstreamOrigin && pool2.closed !== true && pool2.destroyed !== true)) { + return this; } - pattern = _Pattern.fixupPattern(pattern, homedir2); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path15.sep); - pattern = pathHelper.safeTrimTrailingSeparator(pattern); - let foundGlob = false; - const searchSegments = this.segments.map((x2) => _Pattern.getLiteral(x2)).filter((x2) => !foundGlob && !(foundGlob = x2 === "")); - this.searchPath = new internal_path_1.Path(searchSegments).toString(); - this.rootRegExp = new RegExp(_Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? "i" : ""); - this.isImplicitPattern = isImplicitPattern; - const minimatchOptions = { - dot: true, - nobrace: true, - nocase: IS_WINDOWS, - nocomment: true, - noext: true, - nonegate: true - }; - pattern = IS_WINDOWS ? pattern.replace(/\\/g, "/") : pattern; - this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); - } - /** - * Matches the pattern against the specified path - */ - match(itemPath) { - if (this.segments[this.segments.length - 1] === "**") { - itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path15.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path15.sep}`; + const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions])); + this[kAddClient](pool); + pool.on("connect", () => { + pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty]); + }); + pool.on("connectionError", () => { + pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]); + this._updateBalancedPoolStats(); + }); + pool.on("disconnect", (...args) => { + const err = args[2]; + if (err && err.code === "UND_ERR_SOCKET") { + pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]); + this._updateBalancedPoolStats(); } - } else { - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - } - if (this.minimatch.match(itemPath)) { - return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All; + }); + for (const client of this[kClients]) { + client[kWeight] = this[kMaxWeightPerServer]; } - return internal_match_kind_1.MatchKind.None; + this._updateBalancedPoolStats(); + return this; } - /** - * Indicates whether the pattern may match descendants of the specified path - */ - partialMatch(itemPath) { - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - if (pathHelper.dirname(itemPath) === itemPath) { - return this.rootRegExp.test(itemPath); + _updateBalancedPoolStats() { + this[kGreatestCommonDivisor] = this[kClients].map((p2) => p2[kWeight]).reduce(getGreatestCommonDivisor, 0); + } + removeUpstream(upstream) { + const upstreamOrigin = parseOrigin(upstream).origin; + const pool = this[kClients].find((pool2) => pool2[kUrl].origin === upstreamOrigin && pool2.closed !== true && pool2.destroyed !== true); + if (pool) { + this[kRemoveClient](pool); } - return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); + return this; } - /** - * Escapes glob patterns within a path - */ - static globEscape(s2) { - return (IS_WINDOWS ? s2 : s2.replace(/\\/g, "\\\\")).replace(/(\[)(?=[^/]+\])/g, "[[]").replace(/\?/g, "[?]").replace(/\*/g, "[*]"); + get upstreams() { + return this[kClients].filter((dispatcher) => dispatcher.closed !== true && dispatcher.destroyed !== true).map((p2) => p2[kUrl].origin); } - /** - * Normalizes slashes and ensures absolute root - */ - static fixupPattern(pattern, homedir2) { - assert_1.default(pattern, "pattern cannot be empty"); - const literalSegments = new internal_path_1.Path(pattern).segments.map((x2) => _Pattern.getLiteral(x2)); - assert_1.default(literalSegments.every((x2, i2) => (x2 !== "." || i2 === 0) && x2 !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); - assert_1.default(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); - pattern = pathHelper.normalizeSeparators(pattern); - if (pattern === "." || pattern.startsWith(`.${path15.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path15.sep}`)) { - homedir2 = homedir2 || os3.homedir(); - assert_1.default(homedir2, "Unable to determine HOME directory"); - assert_1.default(pathHelper.hasAbsoluteRoot(homedir2), `Expected HOME directory to be a rooted path. Actual '${homedir2}'`); - pattern = _Pattern.globEscape(homedir2) + pattern.substr(1); - } else if (IS_WINDOWS && (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\]/i))) { - let root = pathHelper.ensureAbsoluteRoot("C:\\dummy-root", pattern.substr(0, 2)); - if (pattern.length > 2 && !root.endsWith("\\")) { - root += "\\"; - } - pattern = _Pattern.globEscape(root) + pattern.substr(2); - } else if (IS_WINDOWS && (pattern === "\\" || pattern.match(/^\\[^\\]/))) { - let root = pathHelper.ensureAbsoluteRoot("C:\\dummy-root", "\\"); - if (!root.endsWith("\\")) { - root += "\\"; - } - pattern = _Pattern.globEscape(root) + pattern.substr(1); - } else { - pattern = pathHelper.ensureAbsoluteRoot(_Pattern.globEscape(process.cwd()), pattern); + [kGetDispatcher]() { + if (this[kClients].length === 0) { + throw new BalancedPoolMissingUpstreamError(); } - return pathHelper.normalizeSeparators(pattern); - } - /** - * Attempts to unescape a pattern segment to create a literal path segment. - * Otherwise returns empty string. - */ - static getLiteral(segment) { - let literal = ""; - for (let i2 = 0; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - literal += segment[++i2]; - continue; - } else if (c2 === "*" || c2 === "?") { - return ""; - } else if (c2 === "[" && i2 + 1 < segment.length) { - let set2 = ""; - let closed = -1; - for (let i22 = i2 + 1; i22 < segment.length; i22++) { - const c22 = segment[i22]; - if (c22 === "\\" && !IS_WINDOWS && i22 + 1 < segment.length) { - set2 += segment[++i22]; - continue; - } else if (c22 === "]") { - closed = i22; - break; - } else { - set2 += c22; - } - } - if (closed >= 0) { - if (set2.length > 1) { - return ""; - } - if (set2) { - literal += set2; - i2 = closed; - continue; - } + const dispatcher = this[kClients].find((dispatcher2) => !dispatcher2[kNeedDrain] && dispatcher2.closed !== true && dispatcher2.destroyed !== true); + if (!dispatcher) { + return; + } + const allClientsBusy = this[kClients].map((pool) => pool[kNeedDrain]).reduce((a2, b2) => a2 && b2, true); + if (allClientsBusy) { + return; + } + let counter = 0; + let maxWeightIndex = this[kClients].findIndex((pool) => !pool[kNeedDrain]); + while (counter++ < this[kClients].length) { + this[kIndex] = (this[kIndex] + 1) % this[kClients].length; + const pool = this[kClients][this[kIndex]]; + if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) { + maxWeightIndex = this[kIndex]; + } + if (this[kIndex] === 0) { + this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]; + if (this[kCurrentWeight] <= 0) { + this[kCurrentWeight] = this[kMaxWeightPerServer]; } } - literal += c2; + if (pool[kWeight] >= this[kCurrentWeight] && !pool[kNeedDrain]) { + return pool; + } } - return literal; - } - /** - * Escapes regexp special characters - * https://javascript.info/regexp-escaping - */ - static regExpEscape(s2) { - return s2.replace(/[[\\^$.|?*+()]/g, "\\$&"); + this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]; + this[kIndex] = maxWeightIndex; + return this[kClients][maxWeightIndex]; } }; - exports.Pattern = Pattern; + module.exports = BalancedPool; } }); -// node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state = __commonJS({ - "node_modules/@actions/glob/lib/internal-search-state.js"(exports) { +// node_modules/undici/lib/compat/dispatcher-weakref.js +var require_dispatcher_weakref = __commonJS({ + "node_modules/undici/lib/compat/dispatcher-weakref.js"(exports, module) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SearchState = void 0; - var SearchState = class { - constructor(path15, level) { - this.path = path15; - this.level = level; + var { kConnected, kSize } = require_symbols(); + var CompatWeakRef = class { + constructor(value) { + this.value = value; + } + deref() { + return this.value[kConnected] === 0 && this.value[kSize] === 0 ? void 0 : this.value; } }; - exports.SearchState = SearchState; + var CompatFinalizer = class { + constructor(finalizer) { + this.finalizer = finalizer; + } + register(dispatcher, key) { + if (dispatcher.on) { + dispatcher.on("disconnect", () => { + if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) { + this.finalizer(key); + } + }); + } + } + }; + module.exports = function() { + if (process.env.NODE_V8_COVERAGE) { + return { + WeakRef: CompatWeakRef, + FinalizationRegistry: CompatFinalizer + }; + } + return { + WeakRef: global.WeakRef || CompatWeakRef, + FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer + }; + }; } }); -// node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber = __commonJS({ - "node_modules/@actions/glob/lib/internal-globber.js"(exports) { +// node_modules/undici/lib/agent.js +var require_agent = __commonJS({ + "node_modules/undici/lib/agent.js"(exports, module) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - Object.defineProperty(o2, k22, { enumerable: true, get: function() { - return m3[k2]; - } }); - } : function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - o2[k22] = m3[k2]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { - Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); - } : function(o2, v2) { - o2["default"] = v2; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k2 in mod) - if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) - __createBinding(result, mod, k2); - } - __setModuleDefault(result, mod); - return result; - }; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve2) { - resolve2(value); - }); + var { InvalidArgumentError } = require_errors(); + var { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require_symbols(); + var DispatcherBase = require_dispatcher_base(); + var Pool = require_pool(); + var Client = require_client(); + var util3 = require_util(); + var createRedirectInterceptor = require_redirectInterceptor(); + var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); + var kOnConnect = Symbol("onConnect"); + var kOnDisconnect = Symbol("onDisconnect"); + var kOnConnectionError = Symbol("onConnectionError"); + var kMaxRedirections = Symbol("maxRedirections"); + var kOnDrain = Symbol("onDrain"); + var kFactory = Symbol("factory"); + var kFinalizer = Symbol("finalizer"); + var kOptions = Symbol("options"); + function defaultFactory(origin, opts) { + return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); + } + var Agent3 = class extends DispatcherBase { + constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { + super(); + if (typeof factory !== "function") { + throw new InvalidArgumentError("factory must be a function."); + } + if (connect != null && typeof connect !== "function" && typeof connect !== "object") { + throw new InvalidArgumentError("connect must be a function or an object"); + } + if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { + throw new InvalidArgumentError("maxRedirections must be a positive number"); + } + if (connect && typeof connect !== "function") { + connect = { ...connect }; + } + this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent) ? options.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })]; + this[kOptions] = { ...util3.deepClone(options), connect }; + this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; + this[kMaxRedirections] = maxRedirections; + this[kFactory] = factory; + this[kClients] = /* @__PURE__ */ new Map(); + this[kFinalizer] = new FinalizationRegistry( + /* istanbul ignore next: gc is undeterministic */ + (key) => { + const ref = this[kClients].get(key); + if (ref !== void 0 && ref.deref() === void 0) { + this[kClients].delete(key); + } + } + ); + const agent = this; + this[kOnDrain] = (origin, targets) => { + agent.emit("drain", origin, [agent, ...targets]); + }; + this[kOnConnect] = (origin, targets) => { + agent.emit("connect", origin, [agent, ...targets]); + }; + this[kOnDisconnect] = (origin, targets, err) => { + agent.emit("disconnect", origin, [agent, ...targets], err); + }; + this[kOnConnectionError] = (origin, targets, err) => { + agent.emit("connectionError", origin, [agent, ...targets], err); + }; } - return new (P2 || (P2 = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e2) { - reject(e2); + get [kRunning]() { + let ret = 0; + for (const ref of this[kClients].values()) { + const client = ref.deref(); + if (client) { + ret += client[kRunning]; } } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e2) { - reject(e2); + return ret; + } + [kDispatch](opts, handler) { + let key; + if (opts.origin && (typeof opts.origin === "string" || opts.origin instanceof URL)) { + key = String(opts.origin); + } else { + throw new InvalidArgumentError("opts.origin must be a non-empty string or URL."); + } + const ref = this[kClients].get(key); + let dispatcher = ref ? ref.deref() : null; + if (!dispatcher) { + dispatcher = this[kFactory](opts.origin, this[kOptions]).on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); + this[kClients].set(key, new WeakRef2(dispatcher)); + this[kFinalizer].register(dispatcher, key); + } + return dispatcher.dispatch(opts, handler); + } + async [kClose]() { + const closePromises = []; + for (const ref of this[kClients].values()) { + const client = ref.deref(); + if (client) { + closePromises.push(client.close()); } } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + await Promise.all(closePromises); + } + async [kDestroy](err) { + const destroyPromises = []; + for (const ref of this[kClients].values()) { + const client = ref.deref(); + if (client) { + destroyPromises.push(client.destroy(err)); + } } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + await Promise.all(destroyPromises); + } }; - var __asyncValues2 = exports && exports.__asyncValues || function(o2) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var m3 = o2[Symbol.asyncIterator], i2; - return m3 ? m3.call(o2) : (o2 = typeof __values === "function" ? __values(o2) : o2[Symbol.iterator](), i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { - return this; - }, i2); - function verb(n2) { - i2[n2] = o2[n2] && function(v2) { - return new Promise(function(resolve2, reject) { - v2 = o2[n2](v2), settle(resolve2, reject, v2.done, v2.value); - }); - }; + module.exports = Agent3; + } +}); + +// node_modules/undici/lib/api/readable.js +var require_readable = __commonJS({ + "node_modules/undici/lib/api/readable.js"(exports, module) { + "use strict"; + var assert = __require("assert"); + var { Readable: Readable5 } = __require("stream"); + var { RequestAbortedError, NotSupportedError, InvalidArgumentError } = require_errors(); + var util3 = require_util(); + var { ReadableStreamFrom, toUSVString } = require_util(); + var Blob4; + var kConsume = Symbol("kConsume"); + var kReading = Symbol("kReading"); + var kBody = Symbol("kBody"); + var kAbort = Symbol("abort"); + var kContentType = Symbol("kContentType"); + module.exports = class BodyReadable extends Readable5 { + constructor({ + resume, + abort, + contentType: contentType2 = "", + highWaterMark = 64 * 1024 + // Same as nodejs fs streams. + }) { + super({ + autoDestroy: true, + read: resume, + highWaterMark + }); + this._readableState.dataEmitted = false; + this[kAbort] = abort; + this[kConsume] = null; + this[kBody] = null; + this[kContentType] = contentType2; + this[kReading] = false; + } + destroy(err) { + if (this.destroyed) { + return this; + } + if (!err && !this._readableState.endEmitted) { + err = new RequestAbortedError(); + } + if (err) { + this[kAbort](); + } + return super.destroy(err); } - function settle(resolve2, reject, d2, v2) { - Promise.resolve(v2).then(function(v6) { - resolve2({ value: v6, done: d2 }); - }, reject); + emit(ev, ...args) { + if (ev === "data") { + this._readableState.dataEmitted = true; + } else if (ev === "error") { + this._readableState.errorEmitted = true; + } + return super.emit(ev, ...args); } - }; - var __await2 = exports && exports.__await || function(v2) { - return this instanceof __await2 ? (this.v = v2, this) : new __await2(v2); - }; - var __asyncGenerator2 = exports && exports.__asyncGenerator || function(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var g2 = generator.apply(thisArg, _arguments || []), i2, q2 = []; - return i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { - return this; - }, i2; - function verb(n2) { - if (g2[n2]) - i2[n2] = function(v2) { - return new Promise(function(a2, b2) { - q2.push([n2, v2, a2, b2]) > 1 || resume(n2, v2); - }); - }; + on(ev, ...args) { + if (ev === "data" || ev === "readable") { + this[kReading] = true; + } + return super.on(ev, ...args); } - function resume(n2, v2) { - try { - step(g2[n2](v2)); - } catch (e2) { - settle(q2[0][3], e2); + addListener(ev, ...args) { + return this.on(ev, ...args); + } + off(ev, ...args) { + const ret = super.off(ev, ...args); + if (ev === "data" || ev === "readable") { + this[kReading] = this.listenerCount("data") > 0 || this.listenerCount("readable") > 0; } + return ret; } - function step(r2) { - r2.value instanceof __await2 ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q2[0][2], r2); + removeListener(ev, ...args) { + return this.off(ev, ...args); } - function fulfill(value) { - resume("next", value); + push(chunk) { + if (this[kConsume] && chunk !== null && this.readableLength === 0) { + consumePush(this[kConsume], chunk); + return this[kReading] ? super.push(chunk) : true; + } + return super.push(chunk); } - function reject(value) { - resume("throw", value); + // https://fetch.spec.whatwg.org/#dom-body-text + async text() { + return consume(this, "text"); } - function settle(f2, v2) { - if (f2(v2), q2.shift(), q2.length) - resume(q2[0][0], q2[0][1]); + // https://fetch.spec.whatwg.org/#dom-body-json + async json() { + return consume(this, "json"); } - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DefaultGlobber = void 0; - var core2 = __importStar(require_core()); - var fs3 = __importStar(__require("fs")); - var globOptionsHelper = __importStar(require_internal_glob_options_helper()); - var path15 = __importStar(__require("path")); - var patternHelper = __importStar(require_internal_pattern_helper()); - var internal_match_kind_1 = require_internal_match_kind(); - var internal_pattern_1 = require_internal_pattern(); - var internal_search_state_1 = require_internal_search_state(); - var IS_WINDOWS = process.platform === "win32"; - var DefaultGlobber = class _DefaultGlobber { - constructor(options) { - this.patterns = []; - this.searchPaths = []; - this.options = globOptionsHelper.getOptions(options); + // https://fetch.spec.whatwg.org/#dom-body-blob + async blob() { + return consume(this, "blob"); } - getSearchPaths() { - return this.searchPaths.slice(); + // https://fetch.spec.whatwg.org/#dom-body-arraybuffer + async arrayBuffer() { + return consume(this, "arrayBuffer"); } - glob() { - var e_1, _a2; - return __awaiter(this, void 0, void 0, function* () { - const result = []; - try { - for (var _b = __asyncValues2(this.globGenerator()), _c; _c = yield _b.next(), !_c.done; ) { - const itemPath = _c.value; - result.push(itemPath); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (_c && !_c.done && (_a2 = _b.return)) - yield _a2.call(_b); - } finally { - if (e_1) - throw e_1.error; - } + // https://fetch.spec.whatwg.org/#dom-body-formdata + async formData() { + throw new NotSupportedError(); + } + // https://fetch.spec.whatwg.org/#dom-body-bodyused + get bodyUsed() { + return util3.isDisturbed(this); + } + // https://fetch.spec.whatwg.org/#dom-body-body + get body() { + if (!this[kBody]) { + this[kBody] = ReadableStreamFrom(this); + if (this[kConsume]) { + this[kBody].getReader(); + assert(this[kBody].locked); } - return result; - }); + } + return this[kBody]; } - globGenerator() { - return __asyncGenerator2(this, arguments, function* globGenerator_1() { - const options = globOptionsHelper.getOptions(this.options); - const patterns = []; - for (const pattern of this.patterns) { - patterns.push(pattern); - if (options.implicitDescendants && (pattern.trailingSeparator || pattern.segments[pattern.segments.length - 1] !== "**")) { - patterns.push(new internal_pattern_1.Pattern(pattern.negate, true, pattern.segments.concat("**"))); - } + async dump(opts) { + let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144; + const signal = opts && opts.signal; + const abortFn = () => { + this.destroy(); + }; + let signalListenerCleanup; + if (signal) { + if (typeof signal !== "object" || !("aborted" in signal)) { + throw new InvalidArgumentError("signal must be an AbortSignal"); } - const stack = []; - for (const searchPath of patternHelper.getSearchPaths(patterns)) { - core2.debug(`Search path '${searchPath}'`); - try { - yield __await2(fs3.promises.lstat(searchPath)); - } catch (err) { - if (err.code === "ENOENT") { - continue; - } - throw err; + util3.throwIfAborted(signal); + signalListenerCleanup = util3.addAbortListener(signal, abortFn); + } + try { + for await (const chunk of this) { + util3.throwIfAborted(signal); + limit -= Buffer.byteLength(chunk); + if (limit < 0) { + return; } - stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); } - const traversalChain = []; - while (stack.length) { - const item = stack.pop(); - const match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await2( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory) { - yield yield __await2(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await2(fs3.promises.readdir(item.path))).map((x2) => new internal_search_state_1.SearchState(path15.join(item.path, x2), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await2(item.path); - } + } catch { + util3.throwIfAborted(signal); + } finally { + if (typeof signalListenerCleanup === "function") { + signalListenerCleanup(); + } else if (signalListenerCleanup) { + signalListenerCleanup[Symbol.dispose](); } - }); + } } - /** - * Constructs a DefaultGlobber - */ - static create(patterns, options) { - return __awaiter(this, void 0, void 0, function* () { - const result = new _DefaultGlobber(options); - if (IS_WINDOWS) { - patterns = patterns.replace(/\r\n/g, "\n"); - patterns = patterns.replace(/\r/g, "\n"); - } - const lines = patterns.split("\n").map((x2) => x2.trim()); - for (const line of lines) { - if (!line || line.startsWith("#")) { - continue; - } else { - result.patterns.push(new internal_pattern_1.Pattern(line)); - } + }; + function isLocked(self2) { + return self2[kBody] && self2[kBody].locked === true || self2[kConsume]; + } + function isUnusable(self2) { + return util3.isDisturbed(self2) || isLocked(self2); + } + async function consume(stream, type3) { + if (isUnusable(stream)) { + throw new TypeError("unusable"); + } + assert(!stream[kConsume]); + return new Promise((resolve2, reject) => { + stream[kConsume] = { + type: type3, + stream, + resolve: resolve2, + reject, + length: 0, + body: [] + }; + stream.on("error", function(err) { + consumeFinish(this[kConsume], err); + }).on("close", function() { + if (this[kConsume].body !== null) { + consumeFinish(this[kConsume], new RequestAbortedError()); } - result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns)); - return result; }); + process.nextTick(consumeStart, stream[kConsume]); + }); + } + function consumeStart(consume2) { + if (consume2.body === null) { + return; } - static stat(item, options, traversalChain) { - return __awaiter(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs3.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core2.debug(`Broken symlink '${item.path}'`); - return void 0; - } - throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); - } - throw err; - } - } else { - stats = yield fs3.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs3.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x2) => x2 === realPath)) { - core2.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; - } - traversalChain.push(realPath); - } - return stats; + const { _readableState: state } = consume2.stream; + for (const chunk of state.buffer) { + consumePush(consume2, chunk); + } + if (state.endEmitted) { + consumeEnd(this[kConsume]); + } else { + consume2.stream.on("end", function() { + consumeEnd(this[kConsume]); }); } - }; - exports.DefaultGlobber = DefaultGlobber; - } -}); - -// node_modules/@actions/glob/lib/glob.js -var require_glob = __commonJS({ - "node_modules/@actions/glob/lib/glob.js"(exports) { - "use strict"; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve2) { - resolve2(value); - }); + consume2.stream.resume(); + while (consume2.stream.read() != null) { } - return new (P2 || (P2 = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e2) { - reject(e2); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e2) { - reject(e2); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.create = void 0; - var internal_globber_1 = require_internal_globber(); - function create(patterns, options) { - return __awaiter(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); } - exports.create = create; - } -}); - -// node_modules/semver/internal/constants.js -var require_constants = __commonJS({ - "node_modules/semver/internal/constants.js"(exports, module) { - var SEMVER_SPEC_VERSION = "2.0.0"; - var MAX_LENGTH = 256; - var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ - 9007199254740991; - var MAX_SAFE_COMPONENT_LENGTH = 16; - var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; - var RELEASE_TYPES = [ - "major", - "premajor", - "minor", - "preminor", - "patch", - "prepatch", - "prerelease" - ]; - module.exports = { - MAX_LENGTH, - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_SAFE_INTEGER, - RELEASE_TYPES, - SEMVER_SPEC_VERSION, - FLAG_INCLUDE_PRERELEASE: 1, - FLAG_LOOSE: 2 - }; - } -}); - -// node_modules/semver/internal/debug.js -var require_debug = __commonJS({ - "node_modules/semver/internal/debug.js"(exports, module) { - var debug3 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { - }; - module.exports = debug3; + function consumeEnd(consume2) { + const { type: type3, body: body2, resolve: resolve2, stream, length } = consume2; + try { + if (type3 === "text") { + resolve2(toUSVString(Buffer.concat(body2))); + } else if (type3 === "json") { + resolve2(JSON.parse(Buffer.concat(body2))); + } else if (type3 === "arrayBuffer") { + const dst = new Uint8Array(length); + let pos = 0; + for (const buf of body2) { + dst.set(buf, pos); + pos += buf.byteLength; + } + resolve2(dst); + } else if (type3 === "blob") { + if (!Blob4) { + Blob4 = __require("buffer").Blob; + } + resolve2(new Blob4(body2, { type: stream[kContentType] })); + } + consumeFinish(consume2); + } catch (err) { + stream.destroy(err); + } + } + function consumePush(consume2, chunk) { + consume2.length += chunk.length; + consume2.body.push(chunk); + } + function consumeFinish(consume2, err) { + if (consume2.body === null) { + return; + } + if (err) { + consume2.reject(err); + } else { + consume2.resolve(); + } + consume2.type = null; + consume2.stream = null; + consume2.resolve = null; + consume2.reject = null; + consume2.length = 0; + consume2.body = null; + } } }); -// node_modules/semver/internal/re.js -var require_re = __commonJS({ - "node_modules/semver/internal/re.js"(exports, module) { +// node_modules/undici/lib/api/util.js +var require_util3 = __commonJS({ + "node_modules/undici/lib/api/util.js"(exports, module) { + var assert = __require("assert"); var { - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_LENGTH - } = require_constants(); - var debug3 = require_debug(); - exports = module.exports = {}; - var re3 = exports.re = []; - var safeRe = exports.safeRe = []; - var src = exports.src = []; - var t2 = exports.t = {}; - var R2 = 0; - var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; - var safeRegexReplacements = [ - ["\\s", 1], - ["\\d", MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] - ]; - var makeSafeRegex = (value) => { - for (const [token, max] of safeRegexReplacements) { - value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`); + ResponseStatusCodeError + } = require_errors(); + var { toUSVString } = require_util(); + async function getResolveErrorBodyCallback({ callback, body: body2, contentType: contentType2, statusCode, statusMessage, headers }) { + assert(body2); + let chunks = []; + let limit = 0; + for await (const chunk of body2) { + chunks.push(chunk); + limit += chunk.length; + if (limit > 128 * 1024) { + chunks = null; + break; + } } - return value; - }; - var createToken = (name2, value, isGlobal) => { - const safe = makeSafeRegex(value); - const index = R2++; - debug3(name2, index, value); - t2[name2] = index; - src[index] = value; - re3[index] = new RegExp(value, isGlobal ? "g" : void 0); - safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0); - }; - createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); - createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); - createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); - createToken("MAINVERSION", `(${src[t2.NUMERICIDENTIFIER]})\\.(${src[t2.NUMERICIDENTIFIER]})\\.(${src[t2.NUMERICIDENTIFIER]})`); - createToken("MAINVERSIONLOOSE", `(${src[t2.NUMERICIDENTIFIERLOOSE]})\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})`); - createToken("PRERELEASEIDENTIFIER", `(?:${src[t2.NUMERICIDENTIFIER]}|${src[t2.NONNUMERICIDENTIFIER]})`); - createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t2.NUMERICIDENTIFIERLOOSE]}|${src[t2.NONNUMERICIDENTIFIER]})`); - createToken("PRERELEASE", `(?:-(${src[t2.PRERELEASEIDENTIFIER]}(?:\\.${src[t2.PRERELEASEIDENTIFIER]})*))`); - createToken("PRERELEASELOOSE", `(?:-?(${src[t2.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t2.PRERELEASEIDENTIFIERLOOSE]})*))`); - createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); - createToken("BUILD", `(?:\\+(${src[t2.BUILDIDENTIFIER]}(?:\\.${src[t2.BUILDIDENTIFIER]})*))`); - createToken("FULLPLAIN", `v?${src[t2.MAINVERSION]}${src[t2.PRERELEASE]}?${src[t2.BUILD]}?`); - createToken("FULL", `^${src[t2.FULLPLAIN]}$`); - createToken("LOOSEPLAIN", `[v=\\s]*${src[t2.MAINVERSIONLOOSE]}${src[t2.PRERELEASELOOSE]}?${src[t2.BUILD]}?`); - createToken("LOOSE", `^${src[t2.LOOSEPLAIN]}$`); - createToken("GTLT", "((?:<|>)?=?)"); - createToken("XRANGEIDENTIFIERLOOSE", `${src[t2.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); - createToken("XRANGEIDENTIFIER", `${src[t2.NUMERICIDENTIFIER]}|x|X|\\*`); - createToken("XRANGEPLAIN", `[v=\\s]*(${src[t2.XRANGEIDENTIFIER]})(?:\\.(${src[t2.XRANGEIDENTIFIER]})(?:\\.(${src[t2.XRANGEIDENTIFIER]})(?:${src[t2.PRERELEASE]})?${src[t2.BUILD]}?)?)?`); - createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:${src[t2.PRERELEASELOOSE]})?${src[t2.BUILD]}?)?)?`); - createToken("XRANGE", `^${src[t2.GTLT]}\\s*${src[t2.XRANGEPLAIN]}$`); - createToken("XRANGELOOSE", `^${src[t2.GTLT]}\\s*${src[t2.XRANGEPLAINLOOSE]}$`); - createToken("COERCE", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:$|[^\\d])`); - createToken("COERCERTL", src[t2.COERCE], true); - createToken("LONETILDE", "(?:~>?)"); - createToken("TILDETRIM", `(\\s*)${src[t2.LONETILDE]}\\s+`, true); - exports.tildeTrimReplace = "$1~"; - createToken("TILDE", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAIN]}$`); - createToken("TILDELOOSE", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAINLOOSE]}$`); - createToken("LONECARET", "(?:\\^)"); - createToken("CARETTRIM", `(\\s*)${src[t2.LONECARET]}\\s+`, true); - exports.caretTrimReplace = "$1^"; - createToken("CARET", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAIN]}$`); - createToken("CARETLOOSE", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAINLOOSE]}$`); - createToken("COMPARATORLOOSE", `^${src[t2.GTLT]}\\s*(${src[t2.LOOSEPLAIN]})$|^$`); - createToken("COMPARATOR", `^${src[t2.GTLT]}\\s*(${src[t2.FULLPLAIN]})$|^$`); - createToken("COMPARATORTRIM", `(\\s*)${src[t2.GTLT]}\\s*(${src[t2.LOOSEPLAIN]}|${src[t2.XRANGEPLAIN]})`, true); - exports.comparatorTrimReplace = "$1$2$3"; - createToken("HYPHENRANGE", `^\\s*(${src[t2.XRANGEPLAIN]})\\s+-\\s+(${src[t2.XRANGEPLAIN]})\\s*$`); - createToken("HYPHENRANGELOOSE", `^\\s*(${src[t2.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t2.XRANGEPLAINLOOSE]})\\s*$`); - createToken("STAR", "(<|>)?=?\\s*\\*"); - createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); - createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); - } -}); - -// node_modules/semver/internal/parse-options.js -var require_parse_options = __commonJS({ - "node_modules/semver/internal/parse-options.js"(exports, module) { - var looseOption = Object.freeze({ loose: true }); - var emptyOpts = Object.freeze({}); - var parseOptions = (options) => { - if (!options) { - return emptyOpts; + if (statusCode === 204 || !contentType2 || !chunks) { + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers)); + return; } - if (typeof options !== "object") { - return looseOption; + try { + if (contentType2.startsWith("application/json")) { + const payload = JSON.parse(toUSVString(Buffer.concat(chunks))); + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers, payload)); + return; + } + if (contentType2.startsWith("text/")) { + const payload = toUSVString(Buffer.concat(chunks)); + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers, payload)); + return; + } + } catch (err) { } - return options; - }; - module.exports = parseOptions; + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers)); + } + module.exports = { getResolveErrorBodyCallback }; } }); -// node_modules/semver/internal/identifiers.js -var require_identifiers = __commonJS({ - "node_modules/semver/internal/identifiers.js"(exports, module) { - var numeric = /^[0-9]+$/; - var compareIdentifiers = (a2, b2) => { - const anum = numeric.test(a2); - const bnum = numeric.test(b2); - if (anum && bnum) { - a2 = +a2; - b2 = +b2; +// node_modules/undici/lib/api/abort-signal.js +var require_abort_signal = __commonJS({ + "node_modules/undici/lib/api/abort-signal.js"(exports, module) { + var { addAbortListener } = require_util(); + var { RequestAbortedError } = require_errors(); + var kListener = Symbol("kListener"); + var kSignal = Symbol("kSignal"); + function abort(self2) { + if (self2.abort) { + self2.abort(); + } else { + self2.onError(new RequestAbortedError()); } - return a2 === b2 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a2 < b2 ? -1 : 1; - }; - var rcompareIdentifiers = (a2, b2) => compareIdentifiers(b2, a2); + } + function addSignal(self2, signal) { + self2[kSignal] = null; + self2[kListener] = null; + if (!signal) { + return; + } + if (signal.aborted) { + abort(self2); + return; + } + self2[kSignal] = signal; + self2[kListener] = () => { + abort(self2); + }; + addAbortListener(self2[kSignal], self2[kListener]); + } + function removeSignal(self2) { + if (!self2[kSignal]) { + return; + } + if ("removeEventListener" in self2[kSignal]) { + self2[kSignal].removeEventListener("abort", self2[kListener]); + } else { + self2[kSignal].removeListener("abort", self2[kListener]); + } + self2[kSignal] = null; + self2[kListener] = null; + } module.exports = { - compareIdentifiers, - rcompareIdentifiers + addSignal, + removeSignal }; } }); -// node_modules/semver/classes/semver.js -var require_semver = __commonJS({ - "node_modules/semver/classes/semver.js"(exports, module) { - var debug3 = require_debug(); - var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants(); - var { safeRe: re3, t: t2 } = require_re(); - var parseOptions = require_parse_options(); - var { compareIdentifiers } = require_identifiers(); - var SemVer = class _SemVer { - constructor(version4, options) { - options = parseOptions(options); - if (version4 instanceof _SemVer) { - if (version4.loose === !!options.loose && version4.includePrerelease === !!options.includePrerelease) { - return version4; - } else { - version4 = version4.version; +// node_modules/undici/lib/api/api-request.js +var require_api_request = __commonJS({ + "node_modules/undici/lib/api/api-request.js"(exports, module) { + "use strict"; + var Readable5 = require_readable(); + var { + InvalidArgumentError, + RequestAbortedError + } = require_errors(); + var util3 = require_util(); + var { getResolveErrorBodyCallback } = require_util3(); + var { AsyncResource } = __require("async_hooks"); + var { addSignal, removeSignal } = require_abort_signal(); + var RequestHandler = class extends AsyncResource { + constructor(opts, callback) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + const { signal, method, opaque, body: body2, onInfo, responseHeaders, throwOnError, highWaterMark } = opts; + try { + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); } - } else if (typeof version4 !== "string") { - throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version4}".`); + if (highWaterMark && (typeof highWaterMark !== "number" || highWaterMark < 0)) { + throw new InvalidArgumentError("invalid highWaterMark"); + } + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + } + if (method === "CONNECT") { + throw new InvalidArgumentError("invalid method"); + } + if (onInfo && typeof onInfo !== "function") { + throw new InvalidArgumentError("invalid onInfo callback"); + } + super("UNDICI_REQUEST"); + } catch (err) { + if (util3.isStream(body2)) { + util3.destroy(body2.on("error", util3.nop), err); + } + throw err; } - if (version4.length > MAX_LENGTH) { - throw new TypeError( - `version is longer than ${MAX_LENGTH} characters` - ); + this.responseHeaders = responseHeaders || null; + this.opaque = opaque || null; + this.callback = callback; + this.res = null; + this.abort = null; + this.body = body2; + this.trailers = {}; + this.context = null; + this.onInfo = onInfo || null; + this.throwOnError = throwOnError; + this.highWaterMark = highWaterMark; + if (util3.isStream(body2)) { + body2.on("error", (err) => { + this.onError(err); + }); } - debug3("SemVer", version4, options); - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - const m3 = version4.trim().match(options.loose ? re3[t2.LOOSE] : re3[t2.FULL]); - if (!m3) { - throw new TypeError(`Invalid Version: ${version4}`); + addSignal(this, signal); + } + onConnect(abort, context3) { + if (!this.callback) { + throw new RequestAbortedError(); } - this.raw = version4; - this.major = +m3[1]; - this.minor = +m3[2]; - this.patch = +m3[3]; - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError("Invalid major version"); + this.abort = abort; + this.context = context3; + } + onHeaders(statusCode, rawHeaders, resume, statusMessage) { + const { callback, opaque, abort, context: context3, responseHeaders, highWaterMark } = this; + const headers = responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + if (statusCode < 200) { + if (this.onInfo) { + this.onInfo({ statusCode, headers }); + } + return; } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); + const parsedHeaders = responseHeaders === "raw" ? util3.parseHeaders(rawHeaders) : headers; + const contentType2 = parsedHeaders["content-type"]; + const body2 = new Readable5({ resume, abort, contentType: contentType2, highWaterMark }); + this.callback = null; + this.res = body2; + if (callback !== null) { + if (this.throwOnError && statusCode >= 400) { + this.runInAsyncScope( + getResolveErrorBodyCallback, + null, + { callback, body: body2, contentType: contentType2, statusCode, statusMessage, headers } + ); + } else { + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + trailers: this.trailers, + opaque, + body: body2, + context: context3 + }); + } } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); + } + onData(chunk) { + const { res } = this; + return res.push(chunk); + } + onComplete(trailers) { + const { res } = this; + removeSignal(this); + util3.parseHeaders(trailers, this.trailers); + res.push(null); + } + onError(err) { + const { res, callback, body: body2, opaque } = this; + removeSignal(this); + if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); } - if (!m3[4]) { - this.prerelease = []; - } else { - this.prerelease = m3[4].split(".").map((id) => { - if (/^[0-9]+$/.test(id)) { - const num = +id; - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num; - } - } - return id; + if (res) { + this.res = null; + queueMicrotask(() => { + util3.destroy(res, err); }); } - this.build = m3[5] ? m3[5].split(".") : []; - this.format(); - } - format() { - this.version = `${this.major}.${this.minor}.${this.patch}`; - if (this.prerelease.length) { - this.version += `-${this.prerelease.join(".")}`; + if (body2) { + this.body = null; + util3.destroy(body2, err); } - return this.version; } - toString() { - return this.version; + }; + function request(opts, callback) { + if (callback === void 0) { + return new Promise((resolve2, reject) => { + request.call(this, opts, (err, data) => { + return err ? reject(err) : resolve2(data); + }); + }); } - compare(other) { - debug3("SemVer.compare", this.version, this.options, other); - if (!(other instanceof _SemVer)) { - if (typeof other === "string" && other === this.version) { - return 0; + try { + this.dispatch(opts, new RequestHandler(opts, callback)); + } catch (err) { + if (typeof callback !== "function") { + throw err; + } + const opaque = opts && opts.opaque; + queueMicrotask(() => callback(err, { opaque })); + } + } + module.exports = request; + } +}); + +// node_modules/undici/lib/api/api-stream.js +var require_api_stream = __commonJS({ + "node_modules/undici/lib/api/api-stream.js"(exports, module) { + "use strict"; + var { finished, PassThrough: PassThrough2 } = __require("stream"); + var { + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError + } = require_errors(); + var util3 = require_util(); + var { getResolveErrorBodyCallback } = require_util3(); + var { AsyncResource } = __require("async_hooks"); + var { addSignal, removeSignal } = require_abort_signal(); + var StreamHandler = class extends AsyncResource { + constructor(opts, factory, callback) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + const { signal, method, opaque, body: body2, onInfo, responseHeaders, throwOnError } = opts; + try { + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); } - other = new _SemVer(other, this.options); + if (typeof factory !== "function") { + throw new InvalidArgumentError("invalid factory"); + } + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + } + if (method === "CONNECT") { + throw new InvalidArgumentError("invalid method"); + } + if (onInfo && typeof onInfo !== "function") { + throw new InvalidArgumentError("invalid onInfo callback"); + } + super("UNDICI_STREAM"); + } catch (err) { + if (util3.isStream(body2)) { + util3.destroy(body2.on("error", util3.nop), err); + } + throw err; } - if (other.version === this.version) { - return 0; + this.responseHeaders = responseHeaders || null; + this.opaque = opaque || null; + this.factory = factory; + this.callback = callback; + this.res = null; + this.abort = null; + this.context = null; + this.trailers = null; + this.body = body2; + this.onInfo = onInfo || null; + this.throwOnError = throwOnError || false; + if (util3.isStream(body2)) { + body2.on("error", (err) => { + this.onError(err); + }); } - return this.compareMain(other) || this.comparePre(other); + addSignal(this, signal); } - compareMain(other) { - if (!(other instanceof _SemVer)) { - other = new _SemVer(other, this.options); + onConnect(abort, context3) { + if (!this.callback) { + throw new RequestAbortedError(); } - return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); + this.abort = abort; + this.context = context3; } - comparePre(other) { - if (!(other instanceof _SemVer)) { - other = new _SemVer(other, this.options); - } - if (this.prerelease.length && !other.prerelease.length) { - return -1; - } else if (!this.prerelease.length && other.prerelease.length) { - return 1; - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0; - } - let i2 = 0; - do { - const a2 = this.prerelease[i2]; - const b2 = other.prerelease[i2]; - debug3("prerelease compare", i2, a2, b2); - if (a2 === void 0 && b2 === void 0) { - return 0; - } else if (b2 === void 0) { - return 1; - } else if (a2 === void 0) { - return -1; - } else if (a2 === b2) { - continue; - } else { - return compareIdentifiers(a2, b2); + onHeaders(statusCode, rawHeaders, resume, statusMessage) { + const { factory, opaque, context: context3, callback, responseHeaders } = this; + const headers = responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + if (statusCode < 200) { + if (this.onInfo) { + this.onInfo({ statusCode, headers }); } - } while (++i2); - } - compareBuild(other) { - if (!(other instanceof _SemVer)) { - other = new _SemVer(other, this.options); + return; } - let i2 = 0; - do { - const a2 = this.build[i2]; - const b2 = other.build[i2]; - debug3("prerelease compare", i2, a2, b2); - if (a2 === void 0 && b2 === void 0) { - return 0; - } else if (b2 === void 0) { - return 1; - } else if (a2 === void 0) { - return -1; - } else if (a2 === b2) { - continue; - } else { - return compareIdentifiers(a2, b2); + this.factory = null; + let res; + if (this.throwOnError && statusCode >= 400) { + const parsedHeaders = responseHeaders === "raw" ? util3.parseHeaders(rawHeaders) : headers; + const contentType2 = parsedHeaders["content-type"]; + res = new PassThrough2(); + this.callback = null; + this.runInAsyncScope( + getResolveErrorBodyCallback, + null, + { callback, body: res, contentType: contentType2, statusCode, statusMessage, headers } + ); + } else { + res = this.runInAsyncScope(factory, null, { + statusCode, + headers, + opaque, + context: context3 + }); + if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { + throw new InvalidReturnValueError("expected Writable"); } - } while (++i2); - } - // preminor will bump the version up to the next minor release, and immediately - // down to pre-release. premajor and prepatch work the same way. - inc(release3, identifier, identifierBase) { - switch (release3) { - case "premajor": - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc("pre", identifier, identifierBase); - break; - case "preminor": - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc("pre", identifier, identifierBase); - break; - case "prepatch": - this.prerelease.length = 0; - this.inc("patch", identifier, identifierBase); - this.inc("pre", identifier, identifierBase); - break; - case "prerelease": - if (this.prerelease.length === 0) { - this.inc("patch", identifier, identifierBase); - } - this.inc("pre", identifier, identifierBase); - break; - case "major": - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { - this.major++; - } - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case "minor": - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++; - } - this.patch = 0; - this.prerelease = []; - break; - case "patch": - if (this.prerelease.length === 0) { - this.patch++; - } - this.prerelease = []; - break; - case "pre": { - const base = Number(identifierBase) ? 1 : 0; - if (!identifier && identifierBase === false) { - throw new Error("invalid increment argument: identifier is empty"); - } - if (this.prerelease.length === 0) { - this.prerelease = [base]; - } else { - let i2 = this.prerelease.length; - while (--i2 >= 0) { - if (typeof this.prerelease[i2] === "number") { - this.prerelease[i2]++; - i2 = -2; - } - } - if (i2 === -1) { - if (identifier === this.prerelease.join(".") && identifierBase === false) { - throw new Error("invalid increment argument: identifier already exists"); - } - this.prerelease.push(base); - } + finished(res, { readable: false }, (err) => { + const { callback: callback2, res: res2, opaque: opaque2, trailers, abort } = this; + this.res = null; + if (err || !res2.readable) { + util3.destroy(res2, err); } - if (identifier) { - let prerelease = [identifier, base]; - if (identifierBase === false) { - prerelease = [identifier]; - } - if (compareIdentifiers(this.prerelease[0], identifier) === 0) { - if (isNaN(this.prerelease[1])) { - this.prerelease = prerelease; - } - } else { - this.prerelease = prerelease; - } + this.callback = null; + this.runInAsyncScope(callback2, null, err || null, { opaque: opaque2, trailers }); + if (err) { + abort(); } - break; - } - default: - throw new Error(`invalid increment argument: ${release3}`); + }); } - this.raw = this.format(); - if (this.build.length) { - this.raw += `+${this.build.join(".")}`; + res.on("drain", resume); + this.res = res; + const needDrain = res.writableNeedDrain !== void 0 ? res.writableNeedDrain : res._writableState && res._writableState.needDrain; + return needDrain !== true; + } + onData(chunk) { + const { res } = this; + return res.write(chunk); + } + onComplete(trailers) { + const { res } = this; + removeSignal(this); + this.trailers = util3.parseHeaders(trailers); + res.end(); + } + onError(err) { + const { res, callback, opaque, body: body2 } = this; + removeSignal(this); + this.factory = null; + if (res) { + this.res = null; + util3.destroy(res, err); + } else if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + if (body2) { + this.body = null; + util3.destroy(body2, err); } - return this; } }; - module.exports = SemVer; - } -}); - -// node_modules/semver/functions/parse.js -var require_parse = __commonJS({ - "node_modules/semver/functions/parse.js"(exports, module) { - var SemVer = require_semver(); - var parse5 = (version4, options, throwErrors = false) => { - if (version4 instanceof SemVer) { - return version4; + function stream(opts, factory, callback) { + if (callback === void 0) { + return new Promise((resolve2, reject) => { + stream.call(this, opts, factory, (err, data) => { + return err ? reject(err) : resolve2(data); + }); + }); } try { - return new SemVer(version4, options); - } catch (er2) { - if (!throwErrors) { - return null; + this.dispatch(opts, new StreamHandler(opts, factory, callback)); + } catch (err) { + if (typeof callback !== "function") { + throw err; } - throw er2; + const opaque = opts && opts.opaque; + queueMicrotask(() => callback(err, { opaque })); } - }; - module.exports = parse5; + } + module.exports = stream; } }); -// node_modules/semver/functions/valid.js -var require_valid = __commonJS({ - "node_modules/semver/functions/valid.js"(exports, module) { - var parse5 = require_parse(); - var valid = (version4, options) => { - const v2 = parse5(version4, options); - return v2 ? v2.version : null; - }; - module.exports = valid; - } -}); - -// node_modules/semver/functions/clean.js -var require_clean = __commonJS({ - "node_modules/semver/functions/clean.js"(exports, module) { - var parse5 = require_parse(); - var clean = (version4, options) => { - const s2 = parse5(version4.trim().replace(/^[=v]+/, ""), options); - return s2 ? s2.version : null; - }; - module.exports = clean; - } -}); - -// node_modules/semver/functions/inc.js -var require_inc = __commonJS({ - "node_modules/semver/functions/inc.js"(exports, module) { - var SemVer = require_semver(); - var inc = (version4, release3, options, identifier, identifierBase) => { - if (typeof options === "string") { - identifierBase = identifier; - identifier = options; - options = void 0; +// node_modules/undici/lib/api/api-pipeline.js +var require_api_pipeline = __commonJS({ + "node_modules/undici/lib/api/api-pipeline.js"(exports, module) { + "use strict"; + var { + Readable: Readable5, + Duplex, + PassThrough: PassThrough2 + } = __require("stream"); + var { + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError + } = require_errors(); + var util3 = require_util(); + var { AsyncResource } = __require("async_hooks"); + var { addSignal, removeSignal } = require_abort_signal(); + var assert = __require("assert"); + var kResume = Symbol("resume"); + var PipelineRequest = class extends Readable5 { + constructor() { + super({ autoDestroy: true }); + this[kResume] = null; } - try { - return new SemVer( - version4 instanceof SemVer ? version4.version : version4, - options - ).inc(release3, identifier, identifierBase).version; - } catch (er2) { - return null; + _read() { + const { [kResume]: resume } = this; + if (resume) { + this[kResume] = null; + resume(); + } + } + _destroy(err, callback) { + this._read(); + callback(err); } }; - module.exports = inc; - } -}); - -// node_modules/semver/functions/diff.js -var require_diff = __commonJS({ - "node_modules/semver/functions/diff.js"(exports, module) { - var parse5 = require_parse(); - var diff = (version1, version22) => { - const v12 = parse5(version1, null, true); - const v2 = parse5(version22, null, true); - const comparison = v12.compare(v2); - if (comparison === 0) { - return null; + var PipelineResponse = class extends Readable5 { + constructor(resume) { + super({ autoDestroy: true }); + this[kResume] = resume; } - const v1Higher = comparison > 0; - const highVersion = v1Higher ? v12 : v2; - const lowVersion = v1Higher ? v2 : v12; - const highHasPre = !!highVersion.prerelease.length; - const lowHasPre = !!lowVersion.prerelease.length; - if (lowHasPre && !highHasPre) { - if (!lowVersion.patch && !lowVersion.minor) { - return "major"; + _read() { + this[kResume](); + } + _destroy(err, callback) { + if (!err && !this._readableState.endEmitted) { + err = new RequestAbortedError(); + } + callback(err); + } + }; + var PipelineHandler = class extends AsyncResource { + constructor(opts, handler) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + if (typeof handler !== "function") { + throw new InvalidArgumentError("invalid handler"); + } + const { signal, method, opaque, onInfo, responseHeaders } = opts; + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + } + if (method === "CONNECT") { + throw new InvalidArgumentError("invalid method"); + } + if (onInfo && typeof onInfo !== "function") { + throw new InvalidArgumentError("invalid onInfo callback"); + } + super("UNDICI_PIPELINE"); + this.opaque = opaque || null; + this.responseHeaders = responseHeaders || null; + this.handler = handler; + this.abort = null; + this.context = null; + this.onInfo = onInfo || null; + this.req = new PipelineRequest().on("error", util3.nop); + this.ret = new Duplex({ + readableObjectMode: opts.objectMode, + autoDestroy: true, + read: () => { + const { body: body2 } = this; + if (body2 && body2.resume) { + body2.resume(); + } + }, + write: (chunk, encoding, callback) => { + const { req } = this; + if (req.push(chunk, encoding) || req._readableState.destroyed) { + callback(); + } else { + req[kResume] = callback; + } + }, + destroy: (err, callback) => { + const { body: body2, req, res, ret, abort } = this; + if (!err && !ret._readableState.endEmitted) { + err = new RequestAbortedError(); + } + if (abort && err) { + abort(); + } + util3.destroy(body2, err); + util3.destroy(req, err); + util3.destroy(res, err); + removeSignal(this); + callback(err); + } + }).on("prefinish", () => { + const { req } = this; + req.push(null); + }); + this.res = null; + addSignal(this, signal); + } + onConnect(abort, context3) { + const { ret, res } = this; + assert(!res, "pipeline cannot be retried"); + if (ret.destroyed) { + throw new RequestAbortedError(); } - if (highVersion.patch) { - return "patch"; + this.abort = abort; + this.context = context3; + } + onHeaders(statusCode, rawHeaders, resume) { + const { opaque, handler, context: context3 } = this; + if (statusCode < 200) { + if (this.onInfo) { + const headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + this.onInfo({ statusCode, headers }); + } + return; } - if (highVersion.minor) { - return "minor"; + this.res = new PipelineResponse(resume); + let body2; + try { + this.handler = null; + const headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + body2 = this.runInAsyncScope(handler, null, { + statusCode, + headers, + opaque, + body: this.res, + context: context3 + }); + } catch (err) { + this.res.on("error", util3.nop); + throw err; } - return "major"; + if (!body2 || typeof body2.on !== "function") { + throw new InvalidReturnValueError("expected Readable"); + } + body2.on("data", (chunk) => { + const { ret, body: body3 } = this; + if (!ret.push(chunk) && body3.pause) { + body3.pause(); + } + }).on("error", (err) => { + const { ret } = this; + util3.destroy(ret, err); + }).on("end", () => { + const { ret } = this; + ret.push(null); + }).on("close", () => { + const { ret } = this; + if (!ret._readableState.ended) { + util3.destroy(ret, new RequestAbortedError()); + } + }); + this.body = body2; } - const prefix2 = highHasPre ? "pre" : ""; - if (v12.major !== v2.major) { - return prefix2 + "major"; + onData(chunk) { + const { res } = this; + return res.push(chunk); } - if (v12.minor !== v2.minor) { - return prefix2 + "minor"; + onComplete(trailers) { + const { res } = this; + res.push(null); } - if (v12.patch !== v2.patch) { - return prefix2 + "patch"; + onError(err) { + const { ret } = this; + this.handler = null; + util3.destroy(ret, err); } - return "prerelease"; }; - module.exports = diff; + function pipeline(opts, handler) { + try { + const pipelineHandler = new PipelineHandler(opts, handler); + this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler); + return pipelineHandler.ret; + } catch (err) { + return new PassThrough2().destroy(err); + } + } + module.exports = pipeline; } }); -// node_modules/semver/functions/major.js -var require_major = __commonJS({ - "node_modules/semver/functions/major.js"(exports, module) { - var SemVer = require_semver(); - var major2 = (a2, loose) => new SemVer(a2, loose).major; - module.exports = major2; +// node_modules/undici/lib/api/api-upgrade.js +var require_api_upgrade = __commonJS({ + "node_modules/undici/lib/api/api-upgrade.js"(exports, module) { + "use strict"; + var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors(); + var { AsyncResource } = __require("async_hooks"); + var util3 = require_util(); + var { addSignal, removeSignal } = require_abort_signal(); + var assert = __require("assert"); + var UpgradeHandler = class extends AsyncResource { + constructor(opts, callback) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); + } + const { signal, opaque, responseHeaders } = opts; + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + } + super("UNDICI_UPGRADE"); + this.responseHeaders = responseHeaders || null; + this.opaque = opaque || null; + this.callback = callback; + this.abort = null; + this.context = null; + addSignal(this, signal); + } + onConnect(abort, context3) { + if (!this.callback) { + throw new RequestAbortedError(); + } + this.abort = abort; + this.context = null; + } + onHeaders() { + throw new SocketError("bad upgrade", null); + } + onUpgrade(statusCode, rawHeaders, socket) { + const { callback, opaque, context: context3 } = this; + assert.strictEqual(statusCode, 101); + removeSignal(this); + this.callback = null; + const headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + this.runInAsyncScope(callback, null, null, { + headers, + socket, + opaque, + context: context3 + }); + } + onError(err) { + const { callback, opaque } = this; + removeSignal(this); + if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + } + }; + function upgrade(opts, callback) { + if (callback === void 0) { + return new Promise((resolve2, reject) => { + upgrade.call(this, opts, (err, data) => { + return err ? reject(err) : resolve2(data); + }); + }); + } + try { + const upgradeHandler = new UpgradeHandler(opts, callback); + this.dispatch({ + ...opts, + method: opts.method || "GET", + upgrade: opts.protocol || "Websocket" + }, upgradeHandler); + } catch (err) { + if (typeof callback !== "function") { + throw err; + } + const opaque = opts && opts.opaque; + queueMicrotask(() => callback(err, { opaque })); + } + } + module.exports = upgrade; } }); -// node_modules/semver/functions/minor.js -var require_minor = __commonJS({ - "node_modules/semver/functions/minor.js"(exports, module) { - var SemVer = require_semver(); - var minor = (a2, loose) => new SemVer(a2, loose).minor; - module.exports = minor; +// node_modules/undici/lib/api/api-connect.js +var require_api_connect = __commonJS({ + "node_modules/undici/lib/api/api-connect.js"(exports, module) { + "use strict"; + var { AsyncResource } = __require("async_hooks"); + var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors(); + var util3 = require_util(); + var { addSignal, removeSignal } = require_abort_signal(); + var ConnectHandler = class extends AsyncResource { + constructor(opts, callback) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); + } + const { signal, opaque, responseHeaders } = opts; + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + } + super("UNDICI_CONNECT"); + this.opaque = opaque || null; + this.responseHeaders = responseHeaders || null; + this.callback = callback; + this.abort = null; + addSignal(this, signal); + } + onConnect(abort, context3) { + if (!this.callback) { + throw new RequestAbortedError(); + } + this.abort = abort; + this.context = context3; + } + onHeaders() { + throw new SocketError("bad connect", null); + } + onUpgrade(statusCode, rawHeaders, socket) { + const { callback, opaque, context: context3 } = this; + removeSignal(this); + this.callback = null; + let headers = rawHeaders; + if (headers != null) { + headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + } + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + socket, + opaque, + context: context3 + }); + } + onError(err) { + const { callback, opaque } = this; + removeSignal(this); + if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + } + }; + function connect(opts, callback) { + if (callback === void 0) { + return new Promise((resolve2, reject) => { + connect.call(this, opts, (err, data) => { + return err ? reject(err) : resolve2(data); + }); + }); + } + try { + const connectHandler = new ConnectHandler(opts, callback); + this.dispatch({ ...opts, method: "CONNECT" }, connectHandler); + } catch (err) { + if (typeof callback !== "function") { + throw err; + } + const opaque = opts && opts.opaque; + queueMicrotask(() => callback(err, { opaque })); + } + } + module.exports = connect; } }); -// node_modules/semver/functions/patch.js -var require_patch = __commonJS({ - "node_modules/semver/functions/patch.js"(exports, module) { - var SemVer = require_semver(); - var patch2 = (a2, loose) => new SemVer(a2, loose).patch; - module.exports = patch2; +// node_modules/undici/lib/api/index.js +var require_api = __commonJS({ + "node_modules/undici/lib/api/index.js"(exports, module) { + "use strict"; + module.exports.request = require_api_request(); + module.exports.stream = require_api_stream(); + module.exports.pipeline = require_api_pipeline(); + module.exports.upgrade = require_api_upgrade(); + module.exports.connect = require_api_connect(); } }); -// node_modules/semver/functions/prerelease.js -var require_prerelease = __commonJS({ - "node_modules/semver/functions/prerelease.js"(exports, module) { - var parse5 = require_parse(); - var prerelease = (version4, options) => { - const parsed = parse5(version4, options); - return parsed && parsed.prerelease.length ? parsed.prerelease : null; +// node_modules/undici/lib/mock/mock-errors.js +var require_mock_errors = __commonJS({ + "node_modules/undici/lib/mock/mock-errors.js"(exports, module) { + "use strict"; + var { UndiciError } = require_errors(); + var MockNotMatchedError = class _MockNotMatchedError extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, _MockNotMatchedError); + this.name = "MockNotMatchedError"; + this.message = message || "The request does not match any registered mock dispatches"; + this.code = "UND_MOCK_ERR_MOCK_NOT_MATCHED"; + } + }; + module.exports = { + MockNotMatchedError }; - module.exports = prerelease; - } -}); - -// node_modules/semver/functions/compare.js -var require_compare = __commonJS({ - "node_modules/semver/functions/compare.js"(exports, module) { - var SemVer = require_semver(); - var compare = (a2, b2, loose) => new SemVer(a2, loose).compare(new SemVer(b2, loose)); - module.exports = compare; } }); -// node_modules/semver/functions/rcompare.js -var require_rcompare = __commonJS({ - "node_modules/semver/functions/rcompare.js"(exports, module) { - var compare = require_compare(); - var rcompare = (a2, b2, loose) => compare(b2, a2, loose); - module.exports = rcompare; +// node_modules/undici/lib/mock/mock-symbols.js +var require_mock_symbols = __commonJS({ + "node_modules/undici/lib/mock/mock-symbols.js"(exports, module) { + "use strict"; + module.exports = { + kAgent: Symbol("agent"), + kOptions: Symbol("options"), + kFactory: Symbol("factory"), + kDispatches: Symbol("dispatches"), + kDispatchKey: Symbol("dispatch key"), + kDefaultHeaders: Symbol("default headers"), + kDefaultTrailers: Symbol("default trailers"), + kContentLength: Symbol("content length"), + kMockAgent: Symbol("mock agent"), + kMockAgentSet: Symbol("mock agent set"), + kMockAgentGet: Symbol("mock agent get"), + kMockDispatch: Symbol("mock dispatch"), + kClose: Symbol("close"), + kOriginalClose: Symbol("original agent close"), + kOrigin: Symbol("origin"), + kIsMockActive: Symbol("is mock active"), + kNetConnect: Symbol("net connect"), + kGetNetConnect: Symbol("get net connect"), + kConnected: Symbol("connected") + }; } }); -// node_modules/semver/functions/compare-loose.js -var require_compare_loose = __commonJS({ - "node_modules/semver/functions/compare-loose.js"(exports, module) { - var compare = require_compare(); - var compareLoose = (a2, b2) => compare(a2, b2, true); - module.exports = compareLoose; +// node_modules/undici/lib/mock/mock-utils.js +var require_mock_utils = __commonJS({ + "node_modules/undici/lib/mock/mock-utils.js"(exports, module) { + "use strict"; + var { MockNotMatchedError } = require_mock_errors(); + var { + kDispatches, + kMockAgent, + kOriginalDispatch, + kOrigin, + kGetNetConnect + } = require_mock_symbols(); + var { buildURL, nop } = require_util(); + var { STATUS_CODES: STATUS_CODES3 } = __require("http"); + var { + types: { + isPromise: isPromise2 + } + } = __require("util"); + function matchValue(match, value) { + if (typeof match === "string") { + return match === value; + } + if (match instanceof RegExp) { + return match.test(value); + } + if (typeof match === "function") { + return match(value) === true; + } + return false; + } + function lowerCaseEntries(headers) { + return Object.fromEntries( + Object.entries(headers).map(([headerName, headerValue]) => { + return [headerName.toLocaleLowerCase(), headerValue]; + }) + ); + } + function getHeaderByName(headers, key) { + if (Array.isArray(headers)) { + for (let i2 = 0; i2 < headers.length; i2 += 2) { + if (headers[i2].toLocaleLowerCase() === key.toLocaleLowerCase()) { + return headers[i2 + 1]; + } + } + return void 0; + } else if (typeof headers.get === "function") { + return headers.get(key); + } else { + return lowerCaseEntries(headers)[key.toLocaleLowerCase()]; + } + } + function buildHeadersFromArray(headers) { + const clone2 = headers.slice(); + const entries = []; + for (let index = 0; index < clone2.length; index += 2) { + entries.push([clone2[index], clone2[index + 1]]); + } + return Object.fromEntries(entries); + } + function matchHeaders(mockDispatch2, headers) { + if (typeof mockDispatch2.headers === "function") { + if (Array.isArray(headers)) { + headers = buildHeadersFromArray(headers); + } + return mockDispatch2.headers(headers ? lowerCaseEntries(headers) : {}); + } + if (typeof mockDispatch2.headers === "undefined") { + return true; + } + if (typeof headers !== "object" || typeof mockDispatch2.headers !== "object") { + return false; + } + for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch2.headers)) { + const headerValue = getHeaderByName(headers, matchHeaderName); + if (!matchValue(matchHeaderValue, headerValue)) { + return false; + } + } + return true; + } + function safeUrl(path14) { + if (typeof path14 !== "string") { + return path14; + } + const pathSegments = path14.split("?"); + if (pathSegments.length !== 2) { + return path14; + } + const qp = new URLSearchParams(pathSegments.pop()); + qp.sort(); + return [...pathSegments, qp.toString()].join("?"); + } + function matchKey(mockDispatch2, { path: path14, method, body: body2, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path14); + const methodMatch = matchValue(mockDispatch2.method, method); + const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body2) : true; + const headersMatch = matchHeaders(mockDispatch2, headers); + return pathMatch && methodMatch && bodyMatch && headersMatch; + } + function getResponseData(data) { + if (Buffer.isBuffer(data)) { + return data; + } else if (typeof data === "object") { + return JSON.stringify(data); + } else { + return data.toString(); + } + } + function getMockDispatch(mockDispatches, key) { + const basePath = key.query ? buildURL(key.path, key.query) : key.path; + const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path14 }) => matchValue(safeUrl(path14), resolvedPath)); + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); + } + matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method)); + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`); + } + matchedMockDispatches = matchedMockDispatches.filter(({ body: body2 }) => typeof body2 !== "undefined" ? matchValue(body2, key.body) : true); + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`); + } + matchedMockDispatches = matchedMockDispatches.filter((mockDispatch2) => matchHeaders(mockDispatch2, key.headers)); + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === "object" ? JSON.stringify(key.headers) : key.headers}'`); + } + return matchedMockDispatches[0]; + } + function addMockDispatch(mockDispatches, key, data) { + const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }; + const replyData = typeof data === "function" ? { callback: data } : { ...data }; + const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }; + mockDispatches.push(newMockDispatch); + return newMockDispatch; + } + function deleteMockDispatch(mockDispatches, key) { + const index = mockDispatches.findIndex((dispatch) => { + if (!dispatch.consumed) { + return false; + } + return matchKey(dispatch, key); + }); + if (index !== -1) { + mockDispatches.splice(index, 1); + } + } + function buildKey(opts) { + const { path: path14, method, body: body2, headers, query } = opts; + return { + path: path14, + method, + body: body2, + headers, + query + }; + } + function generateKeyValues(data) { + return Object.entries(data).reduce((keyValuePairs, [key, value]) => [ + ...keyValuePairs, + Buffer.from(`${key}`), + Array.isArray(value) ? value.map((x2) => Buffer.from(`${x2}`)) : Buffer.from(`${value}`) + ], []); + } + function getStatusText(statusCode) { + return STATUS_CODES3[statusCode] || "unknown"; + } + async function getResponse(body2) { + const buffers = []; + for await (const data of body2) { + buffers.push(data); + } + return Buffer.concat(buffers).toString("utf8"); + } + function mockDispatch(opts, handler) { + const key = buildKey(opts); + const mockDispatch2 = getMockDispatch(this[kDispatches], key); + mockDispatch2.timesInvoked++; + if (mockDispatch2.data.callback) { + mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; + } + const { data: { statusCode, data, headers, trailers, error }, delay: delay3, persist } = mockDispatch2; + const { timesInvoked, times } = mockDispatch2; + mockDispatch2.consumed = !persist && timesInvoked >= times; + mockDispatch2.pending = timesInvoked < times; + if (error !== null) { + deleteMockDispatch(this[kDispatches], key); + handler.onError(error); + return true; + } + if (typeof delay3 === "number" && delay3 > 0) { + setTimeout(() => { + handleReply(this[kDispatches]); + }, delay3); + } else { + handleReply(this[kDispatches]); + } + function handleReply(mockDispatches, _data = data) { + const optsHeaders = Array.isArray(opts.headers) ? buildHeadersFromArray(opts.headers) : opts.headers; + const body2 = typeof _data === "function" ? _data({ ...opts, headers: optsHeaders }) : _data; + if (isPromise2(body2)) { + body2.then((newData) => handleReply(mockDispatches, newData)); + return; + } + const responseData = getResponseData(body2); + const responseHeaders = generateKeyValues(headers); + const responseTrailers = generateKeyValues(trailers); + handler.abort = nop; + handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode)); + handler.onData(Buffer.from(responseData)); + handler.onComplete(responseTrailers); + deleteMockDispatch(mockDispatches, key); + } + function resume() { + } + return true; + } + function buildMockDispatch() { + const agent = this[kMockAgent]; + const origin = this[kOrigin]; + const originalDispatch = this[kOriginalDispatch]; + return function dispatch(opts, handler) { + if (agent.isMockActive) { + try { + mockDispatch.call(this, opts, handler); + } catch (error) { + if (error instanceof MockNotMatchedError) { + const netConnect = agent[kGetNetConnect](); + if (netConnect === false) { + throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + } + if (checkNetConnect(netConnect, origin)) { + originalDispatch.call(this, opts, handler); + } else { + throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + } + } else { + throw error; + } + } + } else { + originalDispatch.call(this, opts, handler); + } + }; + } + function checkNetConnect(netConnect, origin) { + const url2 = new URL(origin); + if (netConnect === true) { + return true; + } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url2.host))) { + return true; + } + return false; + } + function buildMockOptions(opts) { + if (opts) { + const { agent, ...mockOptions } = opts; + return mockOptions; + } + } + module.exports = { + getResponseData, + getMockDispatch, + addMockDispatch, + deleteMockDispatch, + buildKey, + generateKeyValues, + matchValue, + getResponse, + getStatusText, + mockDispatch, + buildMockDispatch, + checkNetConnect, + buildMockOptions, + getHeaderByName + }; } }); -// node_modules/semver/functions/compare-build.js -var require_compare_build = __commonJS({ - "node_modules/semver/functions/compare-build.js"(exports, module) { - var SemVer = require_semver(); - var compareBuild = (a2, b2, loose) => { - const versionA = new SemVer(a2, loose); - const versionB = new SemVer(b2, loose); - return versionA.compare(versionB) || versionA.compareBuild(versionB); +// node_modules/undici/lib/mock/mock-interceptor.js +var require_mock_interceptor = __commonJS({ + "node_modules/undici/lib/mock/mock-interceptor.js"(exports, module) { + "use strict"; + var { getResponseData, buildKey, addMockDispatch } = require_mock_utils(); + var { + kDispatches, + kDispatchKey, + kDefaultHeaders, + kDefaultTrailers, + kContentLength, + kMockDispatch + } = require_mock_symbols(); + var { InvalidArgumentError } = require_errors(); + var { buildURL } = require_util(); + var MockScope = class { + constructor(mockDispatch) { + this[kMockDispatch] = mockDispatch; + } + /** + * Delay a reply by a set amount in ms. + */ + delay(waitInMs) { + if (typeof waitInMs !== "number" || !Number.isInteger(waitInMs) || waitInMs <= 0) { + throw new InvalidArgumentError("waitInMs must be a valid integer > 0"); + } + this[kMockDispatch].delay = waitInMs; + return this; + } + /** + * For a defined reply, never mark as consumed. + */ + persist() { + this[kMockDispatch].persist = true; + return this; + } + /** + * Allow one to define a reply for a set amount of matching requests. + */ + times(repeatTimes) { + if (typeof repeatTimes !== "number" || !Number.isInteger(repeatTimes) || repeatTimes <= 0) { + throw new InvalidArgumentError("repeatTimes must be a valid integer > 0"); + } + this[kMockDispatch].times = repeatTimes; + return this; + } }; - module.exports = compareBuild; + var MockInterceptor = class { + constructor(opts, mockDispatches) { + if (typeof opts !== "object") { + throw new InvalidArgumentError("opts must be an object"); + } + if (typeof opts.path === "undefined") { + throw new InvalidArgumentError("opts.path must be defined"); + } + if (typeof opts.method === "undefined") { + opts.method = "GET"; + } + if (typeof opts.path === "string") { + if (opts.query) { + opts.path = buildURL(opts.path, opts.query); + } else { + const parsedURL = new URL(opts.path, "data://"); + opts.path = parsedURL.pathname + parsedURL.search; + } + } + if (typeof opts.method === "string") { + opts.method = opts.method.toUpperCase(); + } + this[kDispatchKey] = buildKey(opts); + this[kDispatches] = mockDispatches; + this[kDefaultHeaders] = {}; + this[kDefaultTrailers] = {}; + this[kContentLength] = false; + } + createMockScopeDispatchData(statusCode, data, responseOptions = {}) { + const responseData = getResponseData(data); + const contentLength2 = this[kContentLength] ? { "content-length": responseData.length } : {}; + const headers = { ...this[kDefaultHeaders], ...contentLength2, ...responseOptions.headers }; + const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }; + return { statusCode, data, headers, trailers }; + } + validateReplyParameters(statusCode, data, responseOptions) { + if (typeof statusCode === "undefined") { + throw new InvalidArgumentError("statusCode must be defined"); + } + if (typeof data === "undefined") { + throw new InvalidArgumentError("data must be defined"); + } + if (typeof responseOptions !== "object") { + throw new InvalidArgumentError("responseOptions must be an object"); + } + } + /** + * Mock an undici request with a defined reply. + */ + reply(replyData) { + if (typeof replyData === "function") { + const wrappedDefaultsCallback = (opts) => { + const resolvedData = replyData(opts); + if (typeof resolvedData !== "object") { + throw new InvalidArgumentError("reply options callback must return an object"); + } + const { statusCode: statusCode2, data: data2 = "", responseOptions: responseOptions2 = {} } = resolvedData; + this.validateReplyParameters(statusCode2, data2, responseOptions2); + return { + ...this.createMockScopeDispatchData(statusCode2, data2, responseOptions2) + }; + }; + const newMockDispatch2 = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback); + return new MockScope(newMockDispatch2); + } + const [statusCode, data = "", responseOptions = {}] = [...arguments]; + this.validateReplyParameters(statusCode, data, responseOptions); + const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData); + return new MockScope(newMockDispatch); + } + /** + * Mock an undici request with a defined error. + */ + replyWithError(error) { + if (typeof error === "undefined") { + throw new InvalidArgumentError("error must be defined"); + } + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error }); + return new MockScope(newMockDispatch); + } + /** + * Set default reply headers on the interceptor for subsequent replies + */ + defaultReplyHeaders(headers) { + if (typeof headers === "undefined") { + throw new InvalidArgumentError("headers must be defined"); + } + this[kDefaultHeaders] = headers; + return this; + } + /** + * Set default reply trailers on the interceptor for subsequent replies + */ + defaultReplyTrailers(trailers) { + if (typeof trailers === "undefined") { + throw new InvalidArgumentError("trailers must be defined"); + } + this[kDefaultTrailers] = trailers; + return this; + } + /** + * Set reply content length header for replies on the interceptor + */ + replyContentLength() { + this[kContentLength] = true; + return this; + } + }; + module.exports.MockInterceptor = MockInterceptor; + module.exports.MockScope = MockScope; } }); -// node_modules/semver/functions/sort.js -var require_sort = __commonJS({ - "node_modules/semver/functions/sort.js"(exports, module) { - var compareBuild = require_compare_build(); - var sort = (list3, loose) => list3.sort((a2, b2) => compareBuild(a2, b2, loose)); - module.exports = sort; +// node_modules/undici/lib/mock/mock-client.js +var require_mock_client = __commonJS({ + "node_modules/undici/lib/mock/mock-client.js"(exports, module) { + "use strict"; + var { promisify: promisify2 } = __require("util"); + var Client = require_client(); + var { buildMockDispatch } = require_mock_utils(); + var { + kDispatches, + kMockAgent, + kClose, + kOriginalClose, + kOrigin, + kOriginalDispatch, + kConnected + } = require_mock_symbols(); + var { MockInterceptor } = require_mock_interceptor(); + var Symbols = require_symbols(); + var { InvalidArgumentError } = require_errors(); + var MockClient = class extends Client { + constructor(origin, opts) { + super(origin, opts); + if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") { + throw new InvalidArgumentError("Argument opts.agent must implement Agent"); + } + this[kMockAgent] = opts.agent; + this[kOrigin] = origin; + this[kDispatches] = []; + this[kConnected] = 1; + this[kOriginalDispatch] = this.dispatch; + this[kOriginalClose] = this.close.bind(this); + this.dispatch = buildMockDispatch.call(this); + this.close = this[kClose]; + } + get [Symbols.kConnected]() { + return this[kConnected]; + } + /** + * Sets up the base interceptor for mocking replies from undici. + */ + intercept(opts) { + return new MockInterceptor(opts, this[kDispatches]); + } + async [kClose]() { + await promisify2(this[kOriginalClose])(); + this[kConnected] = 0; + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); + } + }; + module.exports = MockClient; } }); -// node_modules/semver/functions/rsort.js -var require_rsort = __commonJS({ - "node_modules/semver/functions/rsort.js"(exports, module) { - var compareBuild = require_compare_build(); - var rsort = (list3, loose) => list3.sort((a2, b2) => compareBuild(b2, a2, loose)); - module.exports = rsort; +// node_modules/undici/lib/mock/mock-pool.js +var require_mock_pool = __commonJS({ + "node_modules/undici/lib/mock/mock-pool.js"(exports, module) { + "use strict"; + var { promisify: promisify2 } = __require("util"); + var Pool = require_pool(); + var { buildMockDispatch } = require_mock_utils(); + var { + kDispatches, + kMockAgent, + kClose, + kOriginalClose, + kOrigin, + kOriginalDispatch, + kConnected + } = require_mock_symbols(); + var { MockInterceptor } = require_mock_interceptor(); + var Symbols = require_symbols(); + var { InvalidArgumentError } = require_errors(); + var MockPool = class extends Pool { + constructor(origin, opts) { + super(origin, opts); + if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") { + throw new InvalidArgumentError("Argument opts.agent must implement Agent"); + } + this[kMockAgent] = opts.agent; + this[kOrigin] = origin; + this[kDispatches] = []; + this[kConnected] = 1; + this[kOriginalDispatch] = this.dispatch; + this[kOriginalClose] = this.close.bind(this); + this.dispatch = buildMockDispatch.call(this); + this.close = this[kClose]; + } + get [Symbols.kConnected]() { + return this[kConnected]; + } + /** + * Sets up the base interceptor for mocking replies from undici. + */ + intercept(opts) { + return new MockInterceptor(opts, this[kDispatches]); + } + async [kClose]() { + await promisify2(this[kOriginalClose])(); + this[kConnected] = 0; + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); + } + }; + module.exports = MockPool; } }); -// node_modules/semver/functions/gt.js -var require_gt = __commonJS({ - "node_modules/semver/functions/gt.js"(exports, module) { - var compare = require_compare(); - var gt2 = (a2, b2, loose) => compare(a2, b2, loose) > 0; - module.exports = gt2; +// node_modules/undici/lib/mock/pluralizer.js +var require_pluralizer = __commonJS({ + "node_modules/undici/lib/mock/pluralizer.js"(exports, module) { + "use strict"; + var singulars = { + pronoun: "it", + is: "is", + was: "was", + this: "this" + }; + var plurals = { + pronoun: "they", + is: "are", + was: "were", + this: "these" + }; + module.exports = class Pluralizer { + constructor(singular, plural) { + this.singular = singular; + this.plural = plural; + } + pluralize(count) { + const one = count === 1; + const keys = one ? singulars : plurals; + const noun = one ? this.singular : this.plural; + return { ...keys, count, noun }; + } + }; } }); -// node_modules/semver/functions/lt.js -var require_lt = __commonJS({ - "node_modules/semver/functions/lt.js"(exports, module) { - var compare = require_compare(); - var lt2 = (a2, b2, loose) => compare(a2, b2, loose) < 0; - module.exports = lt2; +// node_modules/undici/lib/mock/pending-interceptors-formatter.js +var require_pending_interceptors_formatter = __commonJS({ + "node_modules/undici/lib/mock/pending-interceptors-formatter.js"(exports, module) { + "use strict"; + var { Transform: Transform3 } = __require("stream"); + var { Console } = __require("console"); + module.exports = class PendingInterceptorsFormatter { + constructor({ disableColors } = {}) { + this.transform = new Transform3({ + transform(chunk, _enc, cb) { + cb(null, chunk); + } + }); + this.logger = new Console({ + stdout: this.transform, + inspectOptions: { + colors: !disableColors && !process.env.CI + } + }); + } + format(pendingInterceptors) { + const withPrettyHeaders = pendingInterceptors.map( + ({ method, path: path14, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + Method: method, + Origin: origin, + Path: path14, + "Status code": statusCode, + Persistent: persist ? "\u2705" : "\u274C", + Invocations: timesInvoked, + Remaining: persist ? Infinity : times - timesInvoked + }) + ); + this.logger.table(withPrettyHeaders); + return this.transform.read().toString(); + } + }; } }); -// node_modules/semver/functions/eq.js -var require_eq = __commonJS({ - "node_modules/semver/functions/eq.js"(exports, module) { - var compare = require_compare(); - var eq = (a2, b2, loose) => compare(a2, b2, loose) === 0; - module.exports = eq; +// node_modules/undici/lib/mock/mock-agent.js +var require_mock_agent = __commonJS({ + "node_modules/undici/lib/mock/mock-agent.js"(exports, module) { + "use strict"; + var { kClients } = require_symbols(); + var Agent3 = require_agent(); + var { + kAgent, + kMockAgentSet, + kMockAgentGet, + kDispatches, + kIsMockActive, + kNetConnect, + kGetNetConnect, + kOptions, + kFactory + } = require_mock_symbols(); + var MockClient = require_mock_client(); + var MockPool = require_mock_pool(); + var { matchValue, buildMockOptions } = require_mock_utils(); + var { InvalidArgumentError, UndiciError } = require_errors(); + var Dispatcher = require_dispatcher(); + var Pluralizer = require_pluralizer(); + var PendingInterceptorsFormatter = require_pending_interceptors_formatter(); + var FakeWeakRef = class { + constructor(value) { + this.value = value; + } + deref() { + return this.value; + } + }; + var MockAgent = class extends Dispatcher { + constructor(opts) { + super(opts); + this[kNetConnect] = true; + this[kIsMockActive] = true; + if (opts && opts.agent && typeof opts.agent.dispatch !== "function") { + throw new InvalidArgumentError("Argument opts.agent must implement Agent"); + } + const agent = opts && opts.agent ? opts.agent : new Agent3(opts); + this[kAgent] = agent; + this[kClients] = agent[kClients]; + this[kOptions] = buildMockOptions(opts); + } + get(origin) { + let dispatcher = this[kMockAgentGet](origin); + if (!dispatcher) { + dispatcher = this[kFactory](origin); + this[kMockAgentSet](origin, dispatcher); + } + return dispatcher; + } + dispatch(opts, handler) { + this.get(opts.origin); + return this[kAgent].dispatch(opts, handler); + } + async close() { + await this[kAgent].close(); + this[kClients].clear(); + } + deactivate() { + this[kIsMockActive] = false; + } + activate() { + this[kIsMockActive] = true; + } + enableNetConnect(matcher) { + if (typeof matcher === "string" || typeof matcher === "function" || matcher instanceof RegExp) { + if (Array.isArray(this[kNetConnect])) { + this[kNetConnect].push(matcher); + } else { + this[kNetConnect] = [matcher]; + } + } else if (typeof matcher === "undefined") { + this[kNetConnect] = true; + } else { + throw new InvalidArgumentError("Unsupported matcher. Must be one of String|Function|RegExp."); + } + } + disableNetConnect() { + this[kNetConnect] = false; + } + // This is required to bypass issues caused by using global symbols - see: + // https://github.com/nodejs/undici/issues/1447 + get isMockActive() { + return this[kIsMockActive]; + } + [kMockAgentSet](origin, dispatcher) { + this[kClients].set(origin, new FakeWeakRef(dispatcher)); + } + [kFactory](origin) { + const mockOptions = Object.assign({ agent: this }, this[kOptions]); + return this[kOptions] && this[kOptions].connections === 1 ? new MockClient(origin, mockOptions) : new MockPool(origin, mockOptions); + } + [kMockAgentGet](origin) { + const ref = this[kClients].get(origin); + if (ref) { + return ref.deref(); + } + if (typeof origin !== "string") { + const dispatcher = this[kFactory]("http://localhost:9999"); + this[kMockAgentSet](origin, dispatcher); + return dispatcher; + } + for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) { + const nonExplicitDispatcher = nonExplicitRef.deref(); + if (nonExplicitDispatcher && typeof keyMatcher !== "string" && matchValue(keyMatcher, origin)) { + const dispatcher = this[kFactory](origin); + this[kMockAgentSet](origin, dispatcher); + dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]; + return dispatcher; + } + } + } + [kGetNetConnect]() { + return this[kNetConnect]; + } + pendingInterceptors() { + const mockAgentClients = this[kClients]; + return Array.from(mockAgentClients.entries()).flatMap(([origin, scope]) => scope.deref()[kDispatches].map((dispatch) => ({ ...dispatch, origin }))).filter(({ pending }) => pending); + } + assertNoPendingInterceptors({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) { + const pending = this.pendingInterceptors(); + if (pending.length === 0) { + return; + } + const pluralizer = new Pluralizer("interceptor", "interceptors").pluralize(pending.length); + throw new UndiciError(` +${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending: + +${pendingInterceptorsFormatter.format(pending)} +`.trim()); + } + }; + module.exports = MockAgent; } }); -// node_modules/semver/functions/neq.js -var require_neq = __commonJS({ - "node_modules/semver/functions/neq.js"(exports, module) { - var compare = require_compare(); - var neq = (a2, b2, loose) => compare(a2, b2, loose) !== 0; - module.exports = neq; +// node_modules/undici/lib/proxy-agent.js +var require_proxy_agent = __commonJS({ + "node_modules/undici/lib/proxy-agent.js"(exports, module) { + "use strict"; + var { kProxy, kClose, kDestroy, kInterceptors } = require_symbols(); + var { URL: URL4 } = __require("url"); + var Agent3 = require_agent(); + var Pool = require_pool(); + var DispatcherBase = require_dispatcher_base(); + var { InvalidArgumentError, RequestAbortedError } = require_errors(); + var buildConnector = require_connect(); + var kAgent = Symbol("proxy agent"); + var kClient = Symbol("proxy client"); + var kProxyHeaders = Symbol("proxy headers"); + var kRequestTls = Symbol("request tls settings"); + var kProxyTls = Symbol("proxy tls settings"); + var kConnectEndpoint = Symbol("connect endpoint function"); + function defaultProtocolPort(protocol) { + return protocol === "https:" ? 443 : 80; + } + function buildProxyOptions(opts) { + if (typeof opts === "string") { + opts = { uri: opts }; + } + if (!opts || !opts.uri) { + throw new InvalidArgumentError("Proxy opts.uri is mandatory"); + } + return { + uri: opts.uri, + protocol: opts.protocol || "https" + }; + } + function defaultFactory(origin, opts) { + return new Pool(origin, opts); + } + var ProxyAgent = class extends DispatcherBase { + constructor(opts) { + super(opts); + this[kProxy] = buildProxyOptions(opts); + this[kAgent] = new Agent3(opts); + this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) ? opts.interceptors.ProxyAgent : []; + if (typeof opts === "string") { + opts = { uri: opts }; + } + if (!opts || !opts.uri) { + throw new InvalidArgumentError("Proxy opts.uri is mandatory"); + } + const { clientFactory = defaultFactory } = opts; + if (typeof clientFactory !== "function") { + throw new InvalidArgumentError("Proxy opts.clientFactory must be a function."); + } + this[kRequestTls] = opts.requestTls; + this[kProxyTls] = opts.proxyTls; + this[kProxyHeaders] = opts.headers || {}; + if (opts.auth && opts.token) { + throw new InvalidArgumentError("opts.auth cannot be used in combination with opts.token"); + } else if (opts.auth) { + this[kProxyHeaders]["proxy-authorization"] = `Basic ${opts.auth}`; + } else if (opts.token) { + this[kProxyHeaders]["proxy-authorization"] = opts.token; + } + const resolvedUrl = new URL4(opts.uri); + const { origin, port, host } = resolvedUrl; + const connect = buildConnector({ ...opts.proxyTls }); + this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }); + this[kClient] = clientFactory(resolvedUrl, { connect }); + this[kAgent] = new Agent3({ + ...opts, + connect: async (opts2, callback) => { + let requestedHost = opts2.host; + if (!opts2.port) { + requestedHost += `:${defaultProtocolPort(opts2.protocol)}`; + } + try { + const { socket, statusCode } = await this[kClient].connect({ + origin, + port, + path: requestedHost, + signal: opts2.signal, + headers: { + ...this[kProxyHeaders], + host + } + }); + if (statusCode !== 200) { + socket.on("error", () => { + }).destroy(); + callback(new RequestAbortedError("Proxy response !== 200 when HTTP Tunneling")); + } + if (opts2.protocol !== "https:") { + callback(null, socket); + return; + } + let servername; + if (this[kRequestTls]) { + servername = this[kRequestTls].servername; + } else { + servername = opts2.servername; + } + this[kConnectEndpoint]({ ...opts2, servername, httpSocket: socket }, callback); + } catch (err) { + callback(err); + } + } + }); + } + dispatch(opts, handler) { + const { host } = new URL4(opts.origin); + const headers = buildHeaders(opts.headers); + throwIfProxyAuthIsSent(headers); + return this[kAgent].dispatch( + { + ...opts, + headers: { + ...headers, + host + } + }, + handler + ); + } + async [kClose]() { + await this[kAgent].close(); + await this[kClient].close(); + } + async [kDestroy]() { + await this[kAgent].destroy(); + await this[kClient].destroy(); + } + }; + function buildHeaders(headers) { + if (Array.isArray(headers)) { + const headersPair = {}; + for (let i2 = 0; i2 < headers.length; i2 += 2) { + headersPair[headers[i2]] = headers[i2 + 1]; + } + return headersPair; + } + return headers; + } + function throwIfProxyAuthIsSent(headers) { + const existProxyAuth = headers && Object.keys(headers).find((key) => key.toLowerCase() === "proxy-authorization"); + if (existProxyAuth) { + throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor"); + } + } + module.exports = ProxyAgent; } }); -// node_modules/semver/functions/gte.js -var require_gte = __commonJS({ - "node_modules/semver/functions/gte.js"(exports, module) { - var compare = require_compare(); - var gte = (a2, b2, loose) => compare(a2, b2, loose) >= 0; - module.exports = gte; +// node_modules/undici/lib/global.js +var require_global3 = __commonJS({ + "node_modules/undici/lib/global.js"(exports, module) { + "use strict"; + var globalDispatcher = Symbol.for("undici.globalDispatcher.1"); + var { InvalidArgumentError } = require_errors(); + var Agent3 = require_agent(); + if (getGlobalDispatcher() === void 0) { + setGlobalDispatcher(new Agent3()); + } + function setGlobalDispatcher(agent) { + if (!agent || typeof agent.dispatch !== "function") { + throw new InvalidArgumentError("Argument agent must implement Agent"); + } + Object.defineProperty(globalThis, globalDispatcher, { + value: agent, + writable: true, + enumerable: false, + configurable: false + }); + } + function getGlobalDispatcher() { + return globalThis[globalDispatcher]; + } + module.exports = { + setGlobalDispatcher, + getGlobalDispatcher + }; } }); -// node_modules/semver/functions/lte.js -var require_lte = __commonJS({ - "node_modules/semver/functions/lte.js"(exports, module) { - var compare = require_compare(); - var lte = (a2, b2, loose) => compare(a2, b2, loose) <= 0; - module.exports = lte; +// node_modules/undici/lib/handler/DecoratorHandler.js +var require_DecoratorHandler = __commonJS({ + "node_modules/undici/lib/handler/DecoratorHandler.js"(exports, module) { + "use strict"; + module.exports = class DecoratorHandler { + constructor(handler) { + this.handler = handler; + } + onConnect(...args) { + return this.handler.onConnect(...args); + } + onError(...args) { + return this.handler.onError(...args); + } + onUpgrade(...args) { + return this.handler.onUpgrade(...args); + } + onHeaders(...args) { + return this.handler.onHeaders(...args); + } + onData(...args) { + return this.handler.onData(...args); + } + onComplete(...args) { + return this.handler.onComplete(...args); + } + onBodySent(...args) { + return this.handler.onBodySent(...args); + } + }; } }); -// node_modules/semver/functions/cmp.js -var require_cmp = __commonJS({ - "node_modules/semver/functions/cmp.js"(exports, module) { - var eq = require_eq(); - var neq = require_neq(); - var gt2 = require_gt(); - var gte = require_gte(); - var lt2 = require_lt(); - var lte = require_lte(); - var cmp = (a2, op, b2, loose) => { - switch (op) { - case "===": - if (typeof a2 === "object") { - a2 = a2.version; - } - if (typeof b2 === "object") { - b2 = b2.version; - } - return a2 === b2; - case "!==": - if (typeof a2 === "object") { - a2 = a2.version; - } - if (typeof b2 === "object") { - b2 = b2.version; - } - return a2 !== b2; - case "": - case "=": - case "==": - return eq(a2, b2, loose); - case "!=": - return neq(a2, b2, loose); - case ">": - return gt2(a2, b2, loose); - case ">=": - return gte(a2, b2, loose); - case "<": - return lt2(a2, b2, loose); - case "<=": - return lte(a2, b2, loose); - default: - throw new TypeError(`Invalid operator: ${op}`); - } - }; - module.exports = cmp; - } -}); - -// node_modules/semver/functions/coerce.js -var require_coerce = __commonJS({ - "node_modules/semver/functions/coerce.js"(exports, module) { - var SemVer = require_semver(); - var parse5 = require_parse(); - var { safeRe: re3, t: t2 } = require_re(); - var coerce = (version4, options) => { - if (version4 instanceof SemVer) { - return version4; - } - if (typeof version4 === "number") { - version4 = String(version4); - } - if (typeof version4 !== "string") { - return null; - } - options = options || {}; - let match = null; - if (!options.rtl) { - match = version4.match(re3[t2.COERCE]); - } else { - let next; - while ((next = re3[t2.COERCERTL].exec(version4)) && (!match || match.index + match[0].length !== version4.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; +// node_modules/undici/lib/fetch/headers.js +var require_headers = __commonJS({ + "node_modules/undici/lib/fetch/headers.js"(exports, module) { + "use strict"; + var { kHeadersList } = require_symbols(); + var { kGuard } = require_symbols2(); + var { kEnumerableProperty } = require_util(); + var { + makeIterator, + isValidHeaderName, + isValidHeaderValue + } = require_util2(); + var { webidl } = require_webidl(); + var assert = __require("assert"); + var kHeadersMap = Symbol("headers map"); + var kHeadersSortedMap = Symbol("headers map sorted"); + function headerValueNormalize(potentialValue) { + let i2 = potentialValue.length; + while (/[\r\n\t ]/.test(potentialValue.charAt(--i2))) + ; + return potentialValue.slice(0, i2 + 1).replace(/^[\r\n\t ]+/, ""); + } + function fill(headers, object) { + if (Array.isArray(object)) { + for (const header of object) { + if (header.length !== 2) { + throw webidl.errors.exception({ + header: "Headers constructor", + message: `expected name/value pair to be length 2, found ${header.length}.` + }); } - re3[t2.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; + headers.append(header[0], header[1]); } - re3[t2.COERCERTL].lastIndex = -1; - } - if (match === null) { - return null; - } - return parse5(`${match[2]}.${match[3] || "0"}.${match[4] || "0"}`, options); - }; - module.exports = coerce; - } -}); - -// node_modules/semver/node_modules/yallist/iterator.js -var require_iterator = __commonJS({ - "node_modules/semver/node_modules/yallist/iterator.js"(exports, module) { - "use strict"; - module.exports = function(Yallist) { - Yallist.prototype[Symbol.iterator] = function* () { - for (let walker = this.head; walker; walker = walker.next) { - yield walker.value; + } else if (typeof object === "object" && object !== null) { + for (const [key, value] of Object.entries(object)) { + headers.append(key, value); } - }; - }; - } -}); - -// node_modules/semver/node_modules/yallist/yallist.js -var require_yallist = __commonJS({ - "node_modules/semver/node_modules/yallist/yallist.js"(exports, module) { - "use strict"; - module.exports = Yallist; - Yallist.Node = Node; - Yallist.create = Yallist; - function Yallist(list3) { - var self2 = this; - if (!(self2 instanceof Yallist)) { - self2 = new Yallist(); - } - self2.tail = null; - self2.head = null; - self2.length = 0; - if (list3 && typeof list3.forEach === "function") { - list3.forEach(function(item) { - self2.push(item); + } else { + throw webidl.errors.conversionFailed({ + prefix: "Headers constructor", + argument: "Argument 1", + types: ["sequence>", "record"] }); - } else if (arguments.length > 0) { - for (var i2 = 0, l2 = arguments.length; i2 < l2; i2++) { - self2.push(arguments[i2]); - } } - return self2; } - Yallist.prototype.removeNode = function(node) { - if (node.list !== this) { - throw new Error("removing node which does not belong to this list"); + var HeadersList = class _HeadersList { + /** @type {[string, string][]|null} */ + cookies = null; + constructor(init2) { + if (init2 instanceof _HeadersList) { + this[kHeadersMap] = new Map(init2[kHeadersMap]); + this[kHeadersSortedMap] = init2[kHeadersSortedMap]; + this.cookies = init2.cookies; + } else { + this[kHeadersMap] = new Map(init2); + this[kHeadersSortedMap] = null; + } } - var next = node.next; - var prev = node.prev; - if (next) { - next.prev = prev; + // https://fetch.spec.whatwg.org/#header-list-contains + contains(name2) { + name2 = name2.toLowerCase(); + return this[kHeadersMap].has(name2); } - if (prev) { - prev.next = next; + clear() { + this[kHeadersMap].clear(); + this[kHeadersSortedMap] = null; + this.cookies = null; } - if (node === this.head) { - this.head = next; + // https://fetch.spec.whatwg.org/#concept-header-list-append + append(name2, value) { + this[kHeadersSortedMap] = null; + const lowercaseName = name2.toLowerCase(); + const exists = this[kHeadersMap].get(lowercaseName); + if (exists) { + const delimiter2 = lowercaseName === "cookie" ? "; " : ", "; + this[kHeadersMap].set(lowercaseName, { + name: exists.name, + value: `${exists.value}${delimiter2}${value}` + }); + } else { + this[kHeadersMap].set(lowercaseName, { name: name2, value }); + } + if (lowercaseName === "set-cookie") { + this.cookies ??= []; + this.cookies.push(value); + } } - if (node === this.tail) { - this.tail = prev; + // https://fetch.spec.whatwg.org/#concept-header-list-set + set(name2, value) { + this[kHeadersSortedMap] = null; + const lowercaseName = name2.toLowerCase(); + if (lowercaseName === "set-cookie") { + this.cookies = [value]; + } + return this[kHeadersMap].set(lowercaseName, { name: name2, value }); } - node.list.length--; - node.next = null; - node.prev = null; - node.list = null; - return next; - }; - Yallist.prototype.unshiftNode = function(node) { - if (node === this.head) { - return; + // https://fetch.spec.whatwg.org/#concept-header-list-delete + delete(name2) { + this[kHeadersSortedMap] = null; + name2 = name2.toLowerCase(); + if (name2 === "set-cookie") { + this.cookies = null; + } + return this[kHeadersMap].delete(name2); } - if (node.list) { - node.list.removeNode(node); + // https://fetch.spec.whatwg.org/#concept-header-list-get + get(name2) { + if (!this.contains(name2)) { + return null; + } + return this[kHeadersMap].get(name2.toLowerCase())?.value ?? null; } - var head = this.head; - node.list = this; - node.next = head; - if (head) { - head.prev = node; + *[Symbol.iterator]() { + for (const [name2, { value }] of this[kHeadersMap]) { + yield [name2, value]; + } } - this.head = node; - if (!this.tail) { - this.tail = node; + get entries() { + const headers = {}; + if (this[kHeadersMap].size) { + for (const { name: name2, value } of this[kHeadersMap].values()) { + headers[name2] = value; + } + } + return headers; } - this.length++; }; - Yallist.prototype.pushNode = function(node) { - if (node === this.tail) { - return; - } - if (node.list) { - node.list.removeNode(node); + var Headers2 = class _Headers { + constructor(init2 = void 0) { + this[kHeadersList] = new HeadersList(); + this[kGuard] = "none"; + if (init2 !== void 0) { + init2 = webidl.converters.HeadersInit(init2); + fill(this, init2); + } } - var tail = this.tail; - node.list = this; - node.prev = tail; - if (tail) { - tail.next = node; + // https://fetch.spec.whatwg.org/#dom-headers-append + append(name2, value) { + webidl.brandCheck(this, _Headers); + webidl.argumentLengthCheck(arguments, 2, { header: "Headers.append" }); + name2 = webidl.converters.ByteString(name2); + value = webidl.converters.ByteString(value); + value = headerValueNormalize(value); + if (!isValidHeaderName(name2)) { + throw webidl.errors.invalidArgument({ + prefix: "Headers.append", + value: name2, + type: "header name" + }); + } else if (!isValidHeaderValue(value)) { + throw webidl.errors.invalidArgument({ + prefix: "Headers.append", + value, + type: "header value" + }); + } + if (this[kGuard] === "immutable") { + throw new TypeError("immutable"); + } else if (this[kGuard] === "request-no-cors") { + } + return this[kHeadersList].append(name2, value); } - this.tail = node; - if (!this.head) { - this.head = node; + // https://fetch.spec.whatwg.org/#dom-headers-delete + delete(name2) { + webidl.brandCheck(this, _Headers); + webidl.argumentLengthCheck(arguments, 1, { header: "Headers.delete" }); + name2 = webidl.converters.ByteString(name2); + if (!isValidHeaderName(name2)) { + throw webidl.errors.invalidArgument({ + prefix: "Headers.delete", + value: name2, + type: "header name" + }); + } + if (this[kGuard] === "immutable") { + throw new TypeError("immutable"); + } else if (this[kGuard] === "request-no-cors") { + } + if (!this[kHeadersList].contains(name2)) { + return; + } + return this[kHeadersList].delete(name2); } - this.length++; - }; - Yallist.prototype.push = function() { - for (var i2 = 0, l2 = arguments.length; i2 < l2; i2++) { - push(this, arguments[i2]); + // https://fetch.spec.whatwg.org/#dom-headers-get + get(name2) { + webidl.brandCheck(this, _Headers); + webidl.argumentLengthCheck(arguments, 1, { header: "Headers.get" }); + name2 = webidl.converters.ByteString(name2); + if (!isValidHeaderName(name2)) { + throw webidl.errors.invalidArgument({ + prefix: "Headers.get", + value: name2, + type: "header name" + }); + } + return this[kHeadersList].get(name2); } - return this.length; - }; - Yallist.prototype.unshift = function() { - for (var i2 = 0, l2 = arguments.length; i2 < l2; i2++) { - unshift(this, arguments[i2]); + // https://fetch.spec.whatwg.org/#dom-headers-has + has(name2) { + webidl.brandCheck(this, _Headers); + webidl.argumentLengthCheck(arguments, 1, { header: "Headers.has" }); + name2 = webidl.converters.ByteString(name2); + if (!isValidHeaderName(name2)) { + throw webidl.errors.invalidArgument({ + prefix: "Headers.has", + value: name2, + type: "header name" + }); + } + return this[kHeadersList].contains(name2); } - return this.length; - }; - Yallist.prototype.pop = function() { - if (!this.tail) { - return void 0; + // https://fetch.spec.whatwg.org/#dom-headers-set + set(name2, value) { + webidl.brandCheck(this, _Headers); + webidl.argumentLengthCheck(arguments, 2, { header: "Headers.set" }); + name2 = webidl.converters.ByteString(name2); + value = webidl.converters.ByteString(value); + value = headerValueNormalize(value); + if (!isValidHeaderName(name2)) { + throw webidl.errors.invalidArgument({ + prefix: "Headers.set", + value: name2, + type: "header name" + }); + } else if (!isValidHeaderValue(value)) { + throw webidl.errors.invalidArgument({ + prefix: "Headers.set", + value, + type: "header value" + }); + } + if (this[kGuard] === "immutable") { + throw new TypeError("immutable"); + } else if (this[kGuard] === "request-no-cors") { + } + return this[kHeadersList].set(name2, value); } - var res = this.tail.value; - this.tail = this.tail.prev; - if (this.tail) { - this.tail.next = null; - } else { - this.head = null; + // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie + getSetCookie() { + webidl.brandCheck(this, _Headers); + const list3 = this[kHeadersList].cookies; + if (list3) { + return [...list3]; + } + return []; } - this.length--; - return res; - }; - Yallist.prototype.shift = function() { - if (!this.head) { - return void 0; + // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine + get [kHeadersSortedMap]() { + if (this[kHeadersList][kHeadersSortedMap]) { + return this[kHeadersList][kHeadersSortedMap]; + } + const headers = []; + const names = [...this[kHeadersList]].sort((a2, b2) => a2[0] < b2[0] ? -1 : 1); + const cookies = this[kHeadersList].cookies; + for (const [name2, value] of names) { + if (name2 === "set-cookie") { + for (const value2 of cookies) { + headers.push([name2, value2]); + } + } else { + assert(value !== null); + headers.push([name2, value]); + } + } + this[kHeadersList][kHeadersSortedMap] = headers; + return headers; } - var res = this.head.value; - this.head = this.head.next; - if (this.head) { - this.head.prev = null; - } else { - this.tail = null; + keys() { + webidl.brandCheck(this, _Headers); + return makeIterator( + () => [...this[kHeadersSortedMap].values()], + "Headers", + "key" + ); } - this.length--; - return res; - }; - Yallist.prototype.forEach = function(fn2, thisp) { - thisp = thisp || this; - for (var walker = this.head, i2 = 0; walker !== null; i2++) { - fn2.call(thisp, walker.value, i2, this); - walker = walker.next; + values() { + webidl.brandCheck(this, _Headers); + return makeIterator( + () => [...this[kHeadersSortedMap].values()], + "Headers", + "value" + ); } - }; - Yallist.prototype.forEachReverse = function(fn2, thisp) { - thisp = thisp || this; - for (var walker = this.tail, i2 = this.length - 1; walker !== null; i2--) { - fn2.call(thisp, walker.value, i2, this); - walker = walker.prev; + entries() { + webidl.brandCheck(this, _Headers); + return makeIterator( + () => [...this[kHeadersSortedMap].values()], + "Headers", + "key+value" + ); } - }; - Yallist.prototype.get = function(n2) { - for (var i2 = 0, walker = this.head; walker !== null && i2 < n2; i2++) { - walker = walker.next; + /** + * @param {(value: string, key: string, self: Headers) => void} callbackFn + * @param {unknown} thisArg + */ + forEach(callbackFn, thisArg = globalThis) { + webidl.brandCheck(this, _Headers); + webidl.argumentLengthCheck(arguments, 1, { header: "Headers.forEach" }); + if (typeof callbackFn !== "function") { + throw new TypeError( + "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'." + ); + } + for (const [key, value] of this) { + callbackFn.apply(thisArg, [value, key, this]); + } } - if (i2 === n2 && walker !== null) { - return walker.value; + [Symbol.for("nodejs.util.inspect.custom")]() { + webidl.brandCheck(this, _Headers); + return this[kHeadersList]; } }; - Yallist.prototype.getReverse = function(n2) { - for (var i2 = 0, walker = this.tail; walker !== null && i2 < n2; i2++) { - walker = walker.prev; - } - if (i2 === n2 && walker !== null) { - return walker.value; + Headers2.prototype[Symbol.iterator] = Headers2.prototype.entries; + Object.defineProperties(Headers2.prototype, { + append: kEnumerableProperty, + delete: kEnumerableProperty, + get: kEnumerableProperty, + has: kEnumerableProperty, + set: kEnumerableProperty, + getSetCookie: kEnumerableProperty, + keys: kEnumerableProperty, + values: kEnumerableProperty, + entries: kEnumerableProperty, + forEach: kEnumerableProperty, + [Symbol.iterator]: { enumerable: false }, + [Symbol.toStringTag]: { + value: "Headers", + configurable: true } - }; - Yallist.prototype.map = function(fn2, thisp) { - thisp = thisp || this; - var res = new Yallist(); - for (var walker = this.head; walker !== null; ) { - res.push(fn2.call(thisp, walker.value, this)); - walker = walker.next; + }); + webidl.converters.HeadersInit = function(V2) { + if (webidl.util.Type(V2) === "Object") { + if (V2[Symbol.iterator]) { + return webidl.converters["sequence>"](V2); + } + return webidl.converters["record"](V2); } - return res; + throw webidl.errors.conversionFailed({ + prefix: "Headers constructor", + argument: "Argument 1", + types: ["sequence>", "record"] + }); }; - Yallist.prototype.mapReverse = function(fn2, thisp) { - thisp = thisp || this; - var res = new Yallist(); - for (var walker = this.tail; walker !== null; ) { - res.push(fn2.call(thisp, walker.value, this)); - walker = walker.prev; - } - return res; + module.exports = { + fill, + Headers: Headers2, + HeadersList }; - Yallist.prototype.reduce = function(fn2, initial) { - var acc; - var walker = this.head; - if (arguments.length > 1) { - acc = initial; - } else if (this.head) { - walker = this.head.next; - acc = this.head.value; - } else { - throw new TypeError("Reduce of empty list with no initial value"); - } - for (var i2 = 0; walker !== null; i2++) { - acc = fn2(acc, walker.value, i2); - walker = walker.next; + } +}); + +// node_modules/undici/lib/fetch/response.js +var require_response = __commonJS({ + "node_modules/undici/lib/fetch/response.js"(exports, module) { + "use strict"; + var { Headers: Headers2, HeadersList, fill } = require_headers(); + var { extractBody, cloneBody, mixinBody } = require_body(); + var util3 = require_util(); + var { kEnumerableProperty } = util3; + var { + isValidReasonPhrase, + isCancelled, + isAborted, + isBlobLike, + serializeJavascriptValueToJSONString, + isErrorLike, + isomorphicEncode + } = require_util2(); + var { + redirectStatus, + nullBodyStatus, + DOMException: DOMException2 + } = require_constants(); + var { kState, kHeaders, kGuard, kRealm } = require_symbols2(); + var { webidl } = require_webidl(); + var { FormData: FormData2 } = require_formdata(); + var { getGlobalOrigin } = require_global2(); + var { URLSerializer } = require_dataURL(); + var { kHeadersList } = require_symbols(); + var assert = __require("assert"); + var { types } = __require("util"); + var ReadableStream = globalThis.ReadableStream || __require("stream/web").ReadableStream; + var Response2 = class _Response { + // Creates network error Response. + static error() { + const relevantRealm = { settingsObject: {} }; + const responseObject = new _Response(); + responseObject[kState] = makeNetworkError(); + responseObject[kRealm] = relevantRealm; + responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList; + responseObject[kHeaders][kGuard] = "immutable"; + responseObject[kHeaders][kRealm] = relevantRealm; + return responseObject; + } + // https://fetch.spec.whatwg.org/#dom-response-json + static json(data, init2 = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: "Response.json" }); + if (init2 !== null) { + init2 = webidl.converters.ResponseInit(init2); + } + const bytes = new TextEncoder("utf-8").encode( + serializeJavascriptValueToJSONString(data) + ); + const body2 = extractBody(bytes); + const relevantRealm = { settingsObject: {} }; + const responseObject = new _Response(); + responseObject[kRealm] = relevantRealm; + responseObject[kHeaders][kGuard] = "response"; + responseObject[kHeaders][kRealm] = relevantRealm; + initializeResponse(responseObject, init2, { body: body2[0], type: "application/json" }); + return responseObject; + } + // Creates a redirect Response that redirects to url with status status. + static redirect(url2, status = 302) { + const relevantRealm = { settingsObject: {} }; + webidl.argumentLengthCheck(arguments, 1, { header: "Response.redirect" }); + url2 = webidl.converters.USVString(url2); + status = webidl.converters["unsigned short"](status); + let parsedURL; + try { + parsedURL = new URL(url2, getGlobalOrigin()); + } catch (err) { + throw Object.assign(new TypeError("Failed to parse URL from " + url2), { + cause: err + }); + } + if (!redirectStatus.includes(status)) { + throw new RangeError("Invalid status code " + status); + } + const responseObject = new _Response(); + responseObject[kRealm] = relevantRealm; + responseObject[kHeaders][kGuard] = "immutable"; + responseObject[kHeaders][kRealm] = relevantRealm; + responseObject[kState].status = status; + const value = isomorphicEncode(URLSerializer(parsedURL)); + responseObject[kState].headersList.append("location", value); + return responseObject; + } + // https://fetch.spec.whatwg.org/#dom-response + constructor(body2 = null, init2 = {}) { + if (body2 !== null) { + body2 = webidl.converters.BodyInit(body2); + } + init2 = webidl.converters.ResponseInit(init2); + this[kRealm] = { settingsObject: {} }; + this[kState] = makeResponse({}); + this[kHeaders] = new Headers2(); + this[kHeaders][kGuard] = "response"; + this[kHeaders][kHeadersList] = this[kState].headersList; + this[kHeaders][kRealm] = this[kRealm]; + let bodyWithType = null; + if (body2 != null) { + const [extractedBody, type3] = extractBody(body2); + bodyWithType = { body: extractedBody, type: type3 }; + } + initializeResponse(this, init2, bodyWithType); + } + // Returns response’s type, e.g., "cors". + get type() { + webidl.brandCheck(this, _Response); + return this[kState].type; } - return acc; - }; - Yallist.prototype.reduceReverse = function(fn2, initial) { - var acc; - var walker = this.tail; - if (arguments.length > 1) { - acc = initial; - } else if (this.tail) { - walker = this.tail.prev; - acc = this.tail.value; - } else { - throw new TypeError("Reduce of empty list with no initial value"); + // Returns response’s URL, if it has one; otherwise the empty string. + get url() { + webidl.brandCheck(this, _Response); + const urlList = this[kState].urlList; + const url2 = urlList[urlList.length - 1] ?? null; + if (url2 === null) { + return ""; + } + return URLSerializer(url2, true); } - for (var i2 = this.length - 1; walker !== null; i2--) { - acc = fn2(acc, walker.value, i2); - walker = walker.prev; + // Returns whether response was obtained through a redirect. + get redirected() { + webidl.brandCheck(this, _Response); + return this[kState].urlList.length > 1; } - return acc; - }; - Yallist.prototype.toArray = function() { - var arr = new Array(this.length); - for (var i2 = 0, walker = this.head; walker !== null; i2++) { - arr[i2] = walker.value; - walker = walker.next; + // Returns response’s status. + get status() { + webidl.brandCheck(this, _Response); + return this[kState].status; } - return arr; - }; - Yallist.prototype.toArrayReverse = function() { - var arr = new Array(this.length); - for (var i2 = 0, walker = this.tail; walker !== null; i2++) { - arr[i2] = walker.value; - walker = walker.prev; + // Returns whether response’s status is an ok status. + get ok() { + webidl.brandCheck(this, _Response); + return this[kState].status >= 200 && this[kState].status <= 299; } - return arr; - }; - Yallist.prototype.slice = function(from, to2) { - to2 = to2 || this.length; - if (to2 < 0) { - to2 += this.length; + // Returns response’s status message. + get statusText() { + webidl.brandCheck(this, _Response); + return this[kState].statusText; } - from = from || 0; - if (from < 0) { - from += this.length; + // Returns response’s headers as Headers. + get headers() { + webidl.brandCheck(this, _Response); + return this[kHeaders]; } - var ret = new Yallist(); - if (to2 < from || to2 < 0) { - return ret; + get body() { + webidl.brandCheck(this, _Response); + return this[kState].body ? this[kState].body.stream : null; } - if (from < 0) { - from = 0; + get bodyUsed() { + webidl.brandCheck(this, _Response); + return !!this[kState].body && util3.isDisturbed(this[kState].body.stream); } - if (to2 > this.length) { - to2 = this.length; + // Returns a clone of response. + clone() { + webidl.brandCheck(this, _Response); + if (this.bodyUsed || this.body && this.body.locked) { + throw webidl.errors.exception({ + header: "Response.clone", + message: "Body has already been consumed." + }); + } + const clonedResponse = cloneResponse(this[kState]); + const clonedResponseObject = new _Response(); + clonedResponseObject[kState] = clonedResponse; + clonedResponseObject[kRealm] = this[kRealm]; + clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList; + clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]; + clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]; + return clonedResponseObject; + } + }; + mixinBody(Response2); + Object.defineProperties(Response2.prototype, { + type: kEnumerableProperty, + url: kEnumerableProperty, + status: kEnumerableProperty, + ok: kEnumerableProperty, + redirected: kEnumerableProperty, + statusText: kEnumerableProperty, + headers: kEnumerableProperty, + clone: kEnumerableProperty, + body: kEnumerableProperty, + bodyUsed: kEnumerableProperty, + [Symbol.toStringTag]: { + value: "Response", + configurable: true } - for (var i2 = 0, walker = this.head; walker !== null && i2 < from; i2++) { - walker = walker.next; + }); + Object.defineProperties(Response2, { + json: kEnumerableProperty, + redirect: kEnumerableProperty, + error: kEnumerableProperty + }); + function cloneResponse(response) { + if (response.internalResponse) { + return filterResponse( + cloneResponse(response.internalResponse), + response.type + ); } - for (; walker !== null && i2 < to2; i2++, walker = walker.next) { - ret.push(walker.value); + const newResponse = makeResponse({ ...response, body: null }); + if (response.body != null) { + newResponse.body = cloneBody(response.body); } - return ret; - }; - Yallist.prototype.sliceReverse = function(from, to2) { - to2 = to2 || this.length; - if (to2 < 0) { - to2 += this.length; + return newResponse; + } + function makeResponse(init2) { + return { + aborted: false, + rangeRequested: false, + timingAllowPassed: false, + requestIncludesCredentials: false, + type: "default", + status: 200, + timingInfo: null, + cacheState: "", + statusText: "", + ...init2, + headersList: init2.headersList ? new HeadersList(init2.headersList) : new HeadersList(), + urlList: init2.urlList ? [...init2.urlList] : [] + }; + } + function makeNetworkError(reason) { + const isError = isErrorLike(reason); + return makeResponse({ + type: "error", + status: 0, + error: isError ? reason : new Error(reason ? String(reason) : reason), + aborted: reason && reason.name === "AbortError" + }); + } + function makeFilteredResponse(response, state) { + state = { + internalResponse: response, + ...state + }; + return new Proxy(response, { + get(target, p2) { + return p2 in state ? state[p2] : target[p2]; + }, + set(target, p2, value) { + assert(!(p2 in state)); + target[p2] = value; + return true; + } + }); + } + function filterResponse(response, type3) { + if (type3 === "basic") { + return makeFilteredResponse(response, { + type: "basic", + headersList: response.headersList + }); + } else if (type3 === "cors") { + return makeFilteredResponse(response, { + type: "cors", + headersList: response.headersList + }); + } else if (type3 === "opaque") { + return makeFilteredResponse(response, { + type: "opaque", + urlList: Object.freeze([]), + status: 0, + statusText: "", + body: null + }); + } else if (type3 === "opaqueredirect") { + return makeFilteredResponse(response, { + type: "opaqueredirect", + status: 0, + statusText: "", + headersList: [], + body: null + }); + } else { + assert(false); } - from = from || 0; - if (from < 0) { - from += this.length; + } + function makeAppropriateNetworkError(fetchParams, err = null) { + assert(isCancelled(fetchParams)); + return isAborted(fetchParams) ? makeNetworkError(Object.assign(new DOMException2("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException2("Request was cancelled."), { cause: err })); + } + function initializeResponse(response, init2, body2) { + if (init2.status !== null && (init2.status < 200 || init2.status > 599)) { + throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.'); } - var ret = new Yallist(); - if (to2 < from || to2 < 0) { - return ret; + if ("statusText" in init2 && init2.statusText != null) { + if (!isValidReasonPhrase(String(init2.statusText))) { + throw new TypeError("Invalid statusText"); + } } - if (from < 0) { - from = 0; + if ("status" in init2 && init2.status != null) { + response[kState].status = init2.status; } - if (to2 > this.length) { - to2 = this.length; + if ("statusText" in init2 && init2.statusText != null) { + response[kState].statusText = init2.statusText; } - for (var i2 = this.length, walker = this.tail; walker !== null && i2 > to2; i2--) { - walker = walker.prev; + if ("headers" in init2 && init2.headers != null) { + fill(response[kHeaders], init2.headers); } - for (; walker !== null && i2 > from; i2--, walker = walker.prev) { - ret.push(walker.value); + if (body2) { + if (nullBodyStatus.includes(response.status)) { + throw webidl.errors.exception({ + header: "Response constructor", + message: "Invalid response status code " + response.status + }); + } + response[kState].body = body2.body; + if (body2.type != null && !response[kState].headersList.contains("Content-Type")) { + response[kState].headersList.append("content-type", body2.type); + } } - return ret; - }; - Yallist.prototype.splice = function(start, deleteCount, ...nodes) { - if (start > this.length) { - start = this.length - 1; + } + webidl.converters.ReadableStream = webidl.interfaceConverter( + ReadableStream + ); + webidl.converters.FormData = webidl.interfaceConverter( + FormData2 + ); + webidl.converters.URLSearchParams = webidl.interfaceConverter( + URLSearchParams + ); + webidl.converters.XMLHttpRequestBodyInit = function(V2) { + if (typeof V2 === "string") { + return webidl.converters.USVString(V2); } - if (start < 0) { - start = this.length + start; + if (isBlobLike(V2)) { + return webidl.converters.Blob(V2, { strict: false }); } - for (var i2 = 0, walker = this.head; walker !== null && i2 < start; i2++) { - walker = walker.next; + if (types.isAnyArrayBuffer(V2) || types.isTypedArray(V2) || types.isDataView(V2)) { + return webidl.converters.BufferSource(V2); } - var ret = []; - for (var i2 = 0; walker && i2 < deleteCount; i2++) { - ret.push(walker.value); - walker = this.removeNode(walker); + if (util3.isFormDataLike(V2)) { + return webidl.converters.FormData(V2, { strict: false }); } - if (walker === null) { - walker = this.tail; + if (V2 instanceof URLSearchParams) { + return webidl.converters.URLSearchParams(V2); } - if (walker !== this.head && walker !== this.tail) { - walker = walker.prev; + return webidl.converters.DOMString(V2); + }; + webidl.converters.BodyInit = function(V2) { + if (V2 instanceof ReadableStream) { + return webidl.converters.ReadableStream(V2); } - for (var i2 = 0; i2 < nodes.length; i2++) { - walker = insert(this, walker, nodes[i2]); + if (V2?.[Symbol.asyncIterator]) { + return V2; } - return ret; + return webidl.converters.XMLHttpRequestBodyInit(V2); }; - Yallist.prototype.reverse = function() { - var head = this.head; - var tail = this.tail; - for (var walker = head; walker !== null; walker = walker.prev) { - var p2 = walker.prev; - walker.prev = walker.next; - walker.next = p2; + webidl.converters.ResponseInit = webidl.dictionaryConverter([ + { + key: "status", + converter: webidl.converters["unsigned short"], + defaultValue: 200 + }, + { + key: "statusText", + converter: webidl.converters.ByteString, + defaultValue: "" + }, + { + key: "headers", + converter: webidl.converters.HeadersInit } - this.head = tail; - this.tail = head; - return this; + ]); + module.exports = { + makeNetworkError, + makeResponse, + makeAppropriateNetworkError, + filterResponse, + Response: Response2, + cloneResponse }; - function insert(self2, node, value) { - var inserted = node === self2.head ? new Node(value, null, node, self2) : new Node(value, node, node.next, self2); - if (inserted.next === null) { - self2.tail = inserted; - } - if (inserted.prev === null) { - self2.head = inserted; - } - self2.length++; - return inserted; - } - function push(self2, item) { - self2.tail = new Node(item, self2.tail, null, self2); - if (!self2.head) { - self2.head = self2.tail; - } - self2.length++; - } - function unshift(self2, item) { - self2.head = new Node(item, null, self2.head, self2); - if (!self2.tail) { - self2.tail = self2.head; - } - self2.length++; - } - function Node(value, prev, next, list3) { - if (!(this instanceof Node)) { - return new Node(value, prev, next, list3); - } - this.list = list3; - this.value = value; - if (prev) { - prev.next = this; - this.prev = prev; - } else { - this.prev = null; - } - if (next) { - next.prev = this; - this.next = next; - } else { - this.next = null; - } - } - try { - require_iterator()(Yallist); - } catch (er2) { - } } }); -// node_modules/semver/node_modules/lru-cache/index.js -var require_lru_cache = __commonJS({ - "node_modules/semver/node_modules/lru-cache/index.js"(exports, module) { +// node_modules/undici/lib/fetch/request.js +var require_request2 = __commonJS({ + "node_modules/undici/lib/fetch/request.js"(exports, module) { "use strict"; - var Yallist = require_yallist(); - var MAX = Symbol("max"); - var LENGTH = Symbol("length"); - var LENGTH_CALCULATOR = Symbol("lengthCalculator"); - var ALLOW_STALE = Symbol("allowStale"); - var MAX_AGE = Symbol("maxAge"); - var DISPOSE = Symbol("dispose"); - var NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet"); - var LRU_LIST = Symbol("lruList"); - var CACHE = Symbol("cache"); - var UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet"); - var naiveLength = () => 1; - var LRUCache = class { - constructor(options) { - if (typeof options === "number") - options = { max: options }; - if (!options) - options = {}; - if (options.max && (typeof options.max !== "number" || options.max < 0)) - throw new TypeError("max must be a non-negative number"); - const max = this[MAX] = options.max || Infinity; - const lc = options.length || naiveLength; - this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc; - this[ALLOW_STALE] = options.stale || false; - if (options.maxAge && typeof options.maxAge !== "number") - throw new TypeError("maxAge must be a number"); - this[MAX_AGE] = options.maxAge || 0; - this[DISPOSE] = options.dispose; - this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false; - this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false; - this.reset(); + var { extractBody, mixinBody, cloneBody } = require_body(); + var { Headers: Headers2, fill: fillHeaders, HeadersList } = require_headers(); + var { FinalizationRegistry } = require_dispatcher_weakref()(); + var util3 = require_util(); + var { + isValidHTTPToken, + sameOrigin, + normalizeMethod, + makePolicyContainer + } = require_util2(); + var { + forbiddenMethods, + corsSafeListedMethods, + referrerPolicy, + requestRedirect, + requestMode, + requestCredentials, + requestCache, + requestDuplex + } = require_constants(); + var { kEnumerableProperty } = util3; + var { kHeaders, kSignal, kState, kGuard, kRealm } = require_symbols2(); + var { webidl } = require_webidl(); + var { getGlobalOrigin } = require_global2(); + var { URLSerializer } = require_dataURL(); + var { kHeadersList } = require_symbols(); + var assert = __require("assert"); + var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __require("events"); + var TransformStream = globalThis.TransformStream; + var kInit = Symbol("init"); + var kAbortController = Symbol("abortController"); + var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { + signal.removeEventListener("abort", abort); + }); + var Request2 = class _Request { + // https://fetch.spec.whatwg.org/#dom-request + constructor(input, init2 = {}) { + if (input === kInit) { + return; + } + webidl.argumentLengthCheck(arguments, 1, { header: "Request constructor" }); + input = webidl.converters.RequestInfo(input); + init2 = webidl.converters.RequestInit(init2); + this[kRealm] = { + settingsObject: { + baseUrl: getGlobalOrigin(), + get origin() { + return this.baseUrl?.origin; + }, + policyContainer: makePolicyContainer() + } + }; + let request = null; + let fallbackMode = null; + const baseUrl = this[kRealm].settingsObject.baseUrl; + let signal = null; + if (typeof input === "string") { + let parsedURL; + try { + parsedURL = new URL(input, baseUrl); + } catch (err) { + throw new TypeError("Failed to parse URL from " + input, { cause: err }); + } + if (parsedURL.username || parsedURL.password) { + throw new TypeError( + "Request cannot be constructed from a URL that includes credentials: " + input + ); + } + request = makeRequest({ urlList: [parsedURL] }); + fallbackMode = "cors"; + } else { + assert(input instanceof _Request); + request = input[kState]; + signal = input[kSignal]; + } + const origin = this[kRealm].settingsObject.origin; + let window2 = "client"; + if (request.window?.constructor?.name === "EnvironmentSettingsObject" && sameOrigin(request.window, origin)) { + window2 = request.window; + } + if (init2.window != null) { + throw new TypeError(`'window' option '${window2}' must be null`); + } + if ("window" in init2) { + window2 = "no-window"; + } + request = makeRequest({ + // URL request’s URL. + // undici implementation note: this is set as the first item in request's urlList in makeRequest + // method request’s method. + method: request.method, + // header list A copy of request’s header list. + // undici implementation note: headersList is cloned in makeRequest + headersList: request.headersList, + // unsafe-request flag Set. + unsafeRequest: request.unsafeRequest, + // client This’s relevant settings object. + client: this[kRealm].settingsObject, + // window window. + window: window2, + // priority request’s priority. + priority: request.priority, + // origin request’s origin. The propagation of the origin is only significant for navigation requests + // being handled by a service worker. In this scenario a request can have an origin that is different + // from the current client. + origin: request.origin, + // referrer request’s referrer. + referrer: request.referrer, + // referrer policy request’s referrer policy. + referrerPolicy: request.referrerPolicy, + // mode request’s mode. + mode: request.mode, + // credentials mode request’s credentials mode. + credentials: request.credentials, + // cache mode request’s cache mode. + cache: request.cache, + // redirect mode request’s redirect mode. + redirect: request.redirect, + // integrity metadata request’s integrity metadata. + integrity: request.integrity, + // keepalive request’s keepalive. + keepalive: request.keepalive, + // reload-navigation flag request’s reload-navigation flag. + reloadNavigation: request.reloadNavigation, + // history-navigation flag request’s history-navigation flag. + historyNavigation: request.historyNavigation, + // URL list A clone of request’s URL list. + urlList: [...request.urlList] + }); + if (Object.keys(init2).length > 0) { + if (request.mode === "navigate") { + request.mode = "same-origin"; + } + request.reloadNavigation = false; + request.historyNavigation = false; + request.origin = "client"; + request.referrer = "client"; + request.referrerPolicy = ""; + request.url = request.urlList[request.urlList.length - 1]; + request.urlList = [request.url]; + } + if (init2.referrer !== void 0) { + const referrer = init2.referrer; + if (referrer === "") { + request.referrer = "no-referrer"; + } else { + let parsedReferrer; + try { + parsedReferrer = new URL(referrer, baseUrl); + } catch (err) { + throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err }); + } + if (parsedReferrer.protocol === "about:" && parsedReferrer.hostname === "client" || origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl)) { + request.referrer = "client"; + } else { + request.referrer = parsedReferrer; + } + } + } + if (init2.referrerPolicy !== void 0) { + request.referrerPolicy = init2.referrerPolicy; + } + let mode; + if (init2.mode !== void 0) { + mode = init2.mode; + } else { + mode = fallbackMode; + } + if (mode === "navigate") { + throw webidl.errors.exception({ + header: "Request constructor", + message: "invalid request mode navigate." + }); + } + if (mode != null) { + request.mode = mode; + } + if (init2.credentials !== void 0) { + request.credentials = init2.credentials; + } + if (init2.cache !== void 0) { + request.cache = init2.cache; + } + if (request.cache === "only-if-cached" && request.mode !== "same-origin") { + throw new TypeError( + "'only-if-cached' can be set only with 'same-origin' mode" + ); + } + if (init2.redirect !== void 0) { + request.redirect = init2.redirect; + } + if (init2.integrity !== void 0 && init2.integrity != null) { + request.integrity = String(init2.integrity); + } + if (init2.keepalive !== void 0) { + request.keepalive = Boolean(init2.keepalive); + } + if (init2.method !== void 0) { + let method = init2.method; + if (!isValidHTTPToken(init2.method)) { + throw TypeError(`'${init2.method}' is not a valid HTTP method.`); + } + if (forbiddenMethods.indexOf(method.toUpperCase()) !== -1) { + throw TypeError(`'${init2.method}' HTTP method is unsupported.`); + } + method = normalizeMethod(init2.method); + request.method = method; + } + if (init2.signal !== void 0) { + signal = init2.signal; + } + this[kState] = request; + const ac = new AbortController(); + this[kSignal] = ac.signal; + this[kSignal][kRealm] = this[kRealm]; + if (signal != null) { + if (!signal || typeof signal.aborted !== "boolean" || typeof signal.addEventListener !== "function") { + throw new TypeError( + "Failed to construct 'Request': member signal is not of type AbortSignal." + ); + } + if (signal.aborted) { + ac.abort(signal.reason); + } else { + this[kAbortController] = ac; + const acRef = new WeakRef(ac); + const abort = function() { + const ac2 = acRef.deref(); + if (ac2 !== void 0) { + ac2.abort(this.reason); + } + }; + try { + if (typeof getMaxListeners === "function" && getMaxListeners(signal) === defaultMaxListeners) { + setMaxListeners(100, signal); + } else if (getEventListeners(signal, "abort").length >= defaultMaxListeners) { + setMaxListeners(100, signal); + } + } catch { + } + util3.addAbortListener(signal, abort); + requestFinalizer.register(ac, { signal, abort }); + } + } + this[kHeaders] = new Headers2(); + this[kHeaders][kHeadersList] = request.headersList; + this[kHeaders][kGuard] = "request"; + this[kHeaders][kRealm] = this[kRealm]; + if (mode === "no-cors") { + if (!corsSafeListedMethods.includes(request.method)) { + throw new TypeError( + `'${request.method} is unsupported in no-cors mode.` + ); + } + this[kHeaders][kGuard] = "request-no-cors"; + } + if (Object.keys(init2).length !== 0) { + let headers = new Headers2(this[kHeaders]); + if (init2.headers !== void 0) { + headers = init2.headers; + } + this[kHeaders][kHeadersList].clear(); + if (headers.constructor.name === "Headers") { + for (const [key, val] of headers) { + this[kHeaders].append(key, val); + } + } else { + fillHeaders(this[kHeaders], headers); + } + } + const inputBody = input instanceof _Request ? input[kState].body : null; + if ((init2.body != null || inputBody != null) && (request.method === "GET" || request.method === "HEAD")) { + throw new TypeError("Request with GET/HEAD method cannot have body."); + } + let initBody = null; + if (init2.body != null) { + const [extractedBody, contentType2] = extractBody( + init2.body, + request.keepalive + ); + initBody = extractedBody; + if (contentType2 && !this[kHeaders][kHeadersList].contains("content-type")) { + this[kHeaders].append("content-type", contentType2); + } + } + const inputOrInitBody = initBody ?? inputBody; + if (inputOrInitBody != null && inputOrInitBody.source == null) { + if (initBody != null && init2.duplex == null) { + throw new TypeError("RequestInit: duplex option is required when sending a body."); + } + if (request.mode !== "same-origin" && request.mode !== "cors") { + throw new TypeError( + 'If request is made from ReadableStream, mode should be "same-origin" or "cors"' + ); + } + request.useCORSPreflightFlag = true; + } + let finalBody = inputOrInitBody; + if (initBody == null && inputBody != null) { + if (util3.isDisturbed(inputBody.stream) || inputBody.stream.locked) { + throw new TypeError( + "Cannot construct a Request with a Request object that has already been used." + ); + } + if (!TransformStream) { + TransformStream = __require("stream/web").TransformStream; + } + const identityTransform = new TransformStream(); + inputBody.stream.pipeThrough(identityTransform); + finalBody = { + source: inputBody.source, + length: inputBody.length, + stream: identityTransform.readable + }; + } + this[kState].body = finalBody; } - // resize the cache when the max changes. - set max(mL) { - if (typeof mL !== "number" || mL < 0) - throw new TypeError("max must be a non-negative number"); - this[MAX] = mL || Infinity; - trim(this); + // Returns request’s HTTP method, which is "GET" by default. + get method() { + webidl.brandCheck(this, _Request); + return this[kState].method; } - get max() { - return this[MAX]; + // Returns the URL of request as a string. + get url() { + webidl.brandCheck(this, _Request); + return URLSerializer(this[kState].url); } - set allowStale(allowStale) { - this[ALLOW_STALE] = !!allowStale; + // Returns a Headers object consisting of the headers associated with request. + // Note that headers added in the network layer by the user agent will not + // be accounted for in this object, e.g., the "Host" header. + get headers() { + webidl.brandCheck(this, _Request); + return this[kHeaders]; + } + // Returns the kind of resource requested by request, e.g., "document" + // or "script". + get destination() { + webidl.brandCheck(this, _Request); + return this[kState].destination; + } + // Returns the referrer of request. Its value can be a same-origin URL if + // explicitly set in init, the empty string to indicate no referrer, and + // "about:client" when defaulting to the global’s default. This is used + // during fetching to determine the value of the `Referer` header of the + // request being made. + get referrer() { + webidl.brandCheck(this, _Request); + if (this[kState].referrer === "no-referrer") { + return ""; + } + if (this[kState].referrer === "client") { + return "about:client"; + } + return this[kState].referrer.toString(); + } + // Returns the referrer policy associated with request. + // This is used during fetching to compute the value of the request’s + // referrer. + get referrerPolicy() { + webidl.brandCheck(this, _Request); + return this[kState].referrerPolicy; + } + // Returns the mode associated with request, which is a string indicating + // whether the request will use CORS, or will be restricted to same-origin + // URLs. + get mode() { + webidl.brandCheck(this, _Request); + return this[kState].mode; + } + // Returns the credentials mode associated with request, + // which is a string indicating whether credentials will be sent with the + // request always, never, or only when sent to a same-origin URL. + get credentials() { + return this[kState].credentials; + } + // Returns the cache mode associated with request, + // which is a string indicating how the request will + // interact with the browser’s cache when fetching. + get cache() { + webidl.brandCheck(this, _Request); + return this[kState].cache; + } + // Returns the redirect mode associated with request, + // which is a string indicating how redirects for the + // request will be handled during fetching. A request + // will follow redirects by default. + get redirect() { + webidl.brandCheck(this, _Request); + return this[kState].redirect; + } + // Returns request’s subresource integrity metadata, which is a + // cryptographic hash of the resource being fetched. Its value + // consists of multiple hashes separated by whitespace. [SRI] + get integrity() { + webidl.brandCheck(this, _Request); + return this[kState].integrity; + } + // Returns a boolean indicating whether or not request can outlive the + // global in which it was created. + get keepalive() { + webidl.brandCheck(this, _Request); + return this[kState].keepalive; + } + // Returns a boolean indicating whether or not request is for a reload + // navigation. + get isReloadNavigation() { + webidl.brandCheck(this, _Request); + return this[kState].reloadNavigation; + } + // Returns a boolean indicating whether or not request is for a history + // navigation (a.k.a. back-foward navigation). + get isHistoryNavigation() { + webidl.brandCheck(this, _Request); + return this[kState].historyNavigation; + } + // Returns the signal associated with request, which is an AbortSignal + // object indicating whether or not request has been aborted, and its + // abort event handler. + get signal() { + webidl.brandCheck(this, _Request); + return this[kSignal]; } - get allowStale() { - return this[ALLOW_STALE]; + get body() { + webidl.brandCheck(this, _Request); + return this[kState].body ? this[kState].body.stream : null; } - set maxAge(mA) { - if (typeof mA !== "number") - throw new TypeError("maxAge must be a non-negative number"); - this[MAX_AGE] = mA; - trim(this); + get bodyUsed() { + webidl.brandCheck(this, _Request); + return !!this[kState].body && util3.isDisturbed(this[kState].body.stream); } - get maxAge() { - return this[MAX_AGE]; + get duplex() { + webidl.brandCheck(this, _Request); + return "half"; } - // resize the cache when the lengthCalculator changes. - set lengthCalculator(lC) { - if (typeof lC !== "function") - lC = naiveLength; - if (lC !== this[LENGTH_CALCULATOR]) { - this[LENGTH_CALCULATOR] = lC; - this[LENGTH] = 0; - this[LRU_LIST].forEach((hit) => { - hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key); - this[LENGTH] += hit.length; - }); + // Returns a clone of request. + clone() { + webidl.brandCheck(this, _Request); + if (this.bodyUsed || this.body?.locked) { + throw new TypeError("unusable"); + } + const clonedRequest = cloneRequest(this[kState]); + const clonedRequestObject = new _Request(kInit); + clonedRequestObject[kState] = clonedRequest; + clonedRequestObject[kRealm] = this[kRealm]; + clonedRequestObject[kHeaders] = new Headers2(); + clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList; + clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]; + clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]; + const ac = new AbortController(); + if (this.signal.aborted) { + ac.abort(this.signal.reason); + } else { + util3.addAbortListener( + this.signal, + () => { + ac.abort(this.signal.reason); + } + ); } - trim(this); + clonedRequestObject[kSignal] = ac.signal; + return clonedRequestObject; + } + }; + mixinBody(Request2); + function makeRequest(init2) { + const request = { + method: "GET", + localURLsOnly: false, + unsafeRequest: false, + body: null, + client: null, + reservedClient: null, + replacesClientId: "", + window: "client", + keepalive: false, + serviceWorkers: "all", + initiator: "", + destination: "", + priority: null, + origin: "client", + policyContainer: "client", + referrer: "client", + referrerPolicy: "", + mode: "no-cors", + useCORSPreflightFlag: false, + credentials: "same-origin", + useCredentials: false, + cache: "default", + redirect: "follow", + integrity: "", + cryptoGraphicsNonceMetadata: "", + parserMetadata: "", + reloadNavigation: false, + historyNavigation: false, + userActivation: false, + taintedOrigin: false, + redirectCount: 0, + responseTainting: "basic", + preventNoCacheCacheControlHeaderModification: false, + done: false, + timingAllowFailed: false, + ...init2, + headersList: init2.headersList ? new HeadersList(init2.headersList) : new HeadersList() + }; + request.url = request.urlList[0]; + return request; + } + function cloneRequest(request) { + const newRequest = makeRequest({ ...request, body: null }); + if (request.body != null) { + newRequest.body = cloneBody(request.body); } - get lengthCalculator() { - return this[LENGTH_CALCULATOR]; + return newRequest; + } + Object.defineProperties(Request2.prototype, { + method: kEnumerableProperty, + url: kEnumerableProperty, + headers: kEnumerableProperty, + redirect: kEnumerableProperty, + clone: kEnumerableProperty, + signal: kEnumerableProperty, + duplex: kEnumerableProperty, + destination: kEnumerableProperty, + body: kEnumerableProperty, + bodyUsed: kEnumerableProperty, + isHistoryNavigation: kEnumerableProperty, + isReloadNavigation: kEnumerableProperty, + keepalive: kEnumerableProperty, + integrity: kEnumerableProperty, + cache: kEnumerableProperty, + credentials: kEnumerableProperty, + attribute: kEnumerableProperty, + referrerPolicy: kEnumerableProperty, + referrer: kEnumerableProperty, + mode: kEnumerableProperty, + [Symbol.toStringTag]: { + value: "Request", + configurable: true } - get length() { - return this[LENGTH]; + }); + webidl.converters.Request = webidl.interfaceConverter( + Request2 + ); + webidl.converters.RequestInfo = function(V2) { + if (typeof V2 === "string") { + return webidl.converters.USVString(V2); } - get itemCount() { - return this[LRU_LIST].length; + if (V2 instanceof Request2) { + return webidl.converters.Request(V2); } - rforEach(fn2, thisp) { - thisp = thisp || this; - for (let walker = this[LRU_LIST].tail; walker !== null; ) { - const prev = walker.prev; - forEachStep(this, fn2, walker, thisp); - walker = prev; + return webidl.converters.USVString(V2); + }; + webidl.converters.AbortSignal = webidl.interfaceConverter( + AbortSignal + ); + webidl.converters.RequestInit = webidl.dictionaryConverter([ + { + key: "method", + converter: webidl.converters.ByteString + }, + { + key: "headers", + converter: webidl.converters.HeadersInit + }, + { + key: "body", + converter: webidl.nullableConverter( + webidl.converters.BodyInit + ) + }, + { + key: "referrer", + converter: webidl.converters.USVString + }, + { + key: "referrerPolicy", + converter: webidl.converters.DOMString, + // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy + allowedValues: referrerPolicy + }, + { + key: "mode", + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#concept-request-mode + allowedValues: requestMode + }, + { + key: "credentials", + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#requestcredentials + allowedValues: requestCredentials + }, + { + key: "cache", + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#requestcache + allowedValues: requestCache + }, + { + key: "redirect", + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#requestredirect + allowedValues: requestRedirect + }, + { + key: "integrity", + converter: webidl.converters.DOMString + }, + { + key: "keepalive", + converter: webidl.converters.boolean + }, + { + key: "signal", + converter: webidl.nullableConverter( + (signal) => webidl.converters.AbortSignal( + signal, + { strict: false } + ) + ) + }, + { + key: "window", + converter: webidl.converters.any + }, + { + key: "duplex", + converter: webidl.converters.DOMString, + allowedValues: requestDuplex + } + ]); + module.exports = { Request: Request2, makeRequest }; + } +}); + +// node_modules/undici/lib/fetch/index.js +var require_fetch = __commonJS({ + "node_modules/undici/lib/fetch/index.js"(exports, module) { + "use strict"; + var { + Response: Response2, + makeNetworkError, + makeAppropriateNetworkError, + filterResponse, + makeResponse + } = require_response(); + var { Headers: Headers2 } = require_headers(); + var { Request: Request2, makeRequest } = require_request2(); + var zlib2 = __require("zlib"); + var { + bytesMatch, + makePolicyContainer, + clonePolicyContainer, + requestBadPort, + TAOCheck, + appendRequestOriginHeader, + responseLocationURL, + requestCurrentURL, + setRequestReferrerPolicyOnRedirect, + tryUpgradeRequestToAPotentiallyTrustworthyURL, + createOpaqueTimingInfo, + appendFetchMetadata, + corsCheck, + crossOriginResourcePolicyCheck, + determineRequestsReferrer, + coarsenedSharedCurrentTime, + createDeferredPromise, + isBlobLike, + sameOrigin, + isCancelled, + isAborted, + isErrorLike, + fullyReadBody, + readableStreamClose, + isomorphicEncode, + urlIsLocal, + urlIsHttpHttpsScheme, + urlHasHttpsScheme + } = require_util2(); + var { kState, kHeaders, kGuard, kRealm } = require_symbols2(); + var assert = __require("assert"); + var { safelyExtractBody } = require_body(); + var { + redirectStatus, + nullBodyStatus, + safeMethods, + requestBodyHeader, + subresource, + DOMException: DOMException2 + } = require_constants(); + var { kHeadersList } = require_symbols(); + var EE = __require("events"); + var { Readable: Readable5, pipeline } = __require("stream"); + var { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = require_util(); + var { dataURLProcessor, serializeAMimeType } = require_dataURL(); + var { TransformStream } = __require("stream/web"); + var { getGlobalDispatcher } = require_global3(); + var { webidl } = require_webidl(); + var { STATUS_CODES: STATUS_CODES3 } = __require("http"); + var resolveObjectURL; + var ReadableStream = globalThis.ReadableStream; + var Fetch = class extends EE { + constructor(dispatcher) { + super(); + this.dispatcher = dispatcher; + this.connection = null; + this.dump = false; + this.state = "ongoing"; + this.setMaxListeners(21); + } + terminate(reason) { + if (this.state !== "ongoing") { + return; } + this.state = "terminated"; + this.connection?.destroy(reason); + this.emit("terminated", reason); } - forEach(fn2, thisp) { - thisp = thisp || this; - for (let walker = this[LRU_LIST].head; walker !== null; ) { - const next = walker.next; - forEachStep(this, fn2, walker, thisp); - walker = next; + // https://fetch.spec.whatwg.org/#fetch-controller-abort + abort(error) { + if (this.state !== "ongoing") { + return; + } + this.state = "aborted"; + if (!error) { + error = new DOMException2("The operation was aborted.", "AbortError"); } + this.serializedAbortReason = error; + this.connection?.destroy(error); + this.emit("terminated", error); } - keys() { - return this[LRU_LIST].toArray().map((k2) => k2.key); + }; + async function fetch2(input, init2 = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: "globalThis.fetch" }); + const p2 = createDeferredPromise(); + let requestObject; + try { + requestObject = new Request2(input, init2); + } catch (e2) { + p2.reject(e2); + return p2.promise; + } + const request = requestObject[kState]; + if (requestObject.signal.aborted) { + abortFetch(p2, request, null, requestObject.signal.reason); + return p2.promise; + } + const globalObject = request.client.globalObject; + if (globalObject?.constructor?.name === "ServiceWorkerGlobalScope") { + request.serviceWorkers = "none"; + } + let responseObject = null; + const relevantRealm = null; + let locallyAborted = false; + let controller = null; + addAbortListener( + requestObject.signal, + () => { + locallyAborted = true; + assert(controller != null); + controller.abort(requestObject.signal.reason); + abortFetch(p2, request, responseObject, requestObject.signal.reason); + } + ); + const handleFetchDone = (response) => finalizeAndReportTiming(response, "fetch"); + const processResponse = (response) => { + if (locallyAborted) { + return; + } + if (response.aborted) { + abortFetch(p2, request, responseObject, controller.serializedAbortReason); + return; + } + if (response.type === "error") { + p2.reject( + Object.assign(new TypeError("fetch failed"), { cause: response.error }) + ); + return; + } + responseObject = new Response2(); + responseObject[kState] = response; + responseObject[kRealm] = relevantRealm; + responseObject[kHeaders][kHeadersList] = response.headersList; + responseObject[kHeaders][kGuard] = "immutable"; + responseObject[kHeaders][kRealm] = relevantRealm; + p2.resolve(responseObject); + }; + controller = fetching({ + request, + processResponseEndOfBody: handleFetchDone, + processResponse, + dispatcher: init2.dispatcher ?? getGlobalDispatcher() + // undici + }); + return p2.promise; + } + function finalizeAndReportTiming(response, initiatorType = "other") { + if (response.type === "error" && response.aborted) { + return; } - values() { - return this[LRU_LIST].toArray().map((k2) => k2.value); + if (!response.urlList?.length) { + return; } - reset() { - if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) { - this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value)); - } - this[CACHE] = /* @__PURE__ */ new Map(); - this[LRU_LIST] = new Yallist(); - this[LENGTH] = 0; + const originalURL = response.urlList[0]; + let timingInfo = response.timingInfo; + let cacheState = response.cacheState; + if (!urlIsHttpHttpsScheme(originalURL)) { + return; } - dump() { - return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : { - k: hit.key, - v: hit.value, - e: hit.now + (hit.maxAge || 0) - }).toArray().filter((h2) => h2); + if (timingInfo === null) { + return; } - dumpLru() { - return this[LRU_LIST]; + if (!timingInfo.timingAllowPassed) { + timingInfo = createOpaqueTimingInfo({ + startTime: timingInfo.startTime + }); + cacheState = ""; + } + timingInfo.endTime = coarsenedSharedCurrentTime(); + response.timingInfo = timingInfo; + markResourceTiming( + timingInfo, + originalURL, + initiatorType, + globalThis, + cacheState + ); + } + function markResourceTiming(timingInfo, originalURL, initiatorType, globalThis2, cacheState) { + if (nodeMajor > 18 || nodeMajor === 18 && nodeMinor >= 2) { + performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState); } - set(key, value, maxAge) { - maxAge = maxAge || this[MAX_AGE]; - if (maxAge && typeof maxAge !== "number") - throw new TypeError("maxAge must be a number"); - const now = maxAge ? Date.now() : 0; - const len = this[LENGTH_CALCULATOR](value, key); - if (this[CACHE].has(key)) { - if (len > this[MAX]) { - del(this, this[CACHE].get(key)); - return false; + } + function abortFetch(p2, request, responseObject, error) { + if (!error) { + error = new DOMException2("The operation was aborted.", "AbortError"); + } + p2.reject(error); + if (request.body != null && isReadable(request.body?.stream)) { + request.body.stream.cancel(error).catch((err) => { + if (err.code === "ERR_INVALID_STATE") { + return; } - const node = this[CACHE].get(key); - const item = node.value; - if (this[DISPOSE]) { - if (!this[NO_DISPOSE_ON_SET]) - this[DISPOSE](key, item.value); + throw err; + }); + } + if (responseObject == null) { + return; + } + const response = responseObject[kState]; + if (response.body != null && isReadable(response.body?.stream)) { + response.body.stream.cancel(error).catch((err) => { + if (err.code === "ERR_INVALID_STATE") { + return; } - item.now = now; - item.maxAge = maxAge; - item.value = value; - this[LENGTH] += len - item.length; - item.length = len; - this.get(key); - trim(this); - return true; - } - const hit = new Entry(key, value, len, now, maxAge); - if (hit.length > this[MAX]) { - if (this[DISPOSE]) - this[DISPOSE](key, value); - return false; - } - this[LENGTH] += hit.length; - this[LRU_LIST].unshift(hit); - this[CACHE].set(key, this[LRU_LIST].head); - trim(this); - return true; + throw err; + }); } - has(key) { - if (!this[CACHE].has(key)) - return false; - const hit = this[CACHE].get(key).value; - return !isStale(this, hit); + } + function fetching({ + request, + processRequestBodyChunkLength, + processRequestEndOfBody, + processResponse, + processResponseEndOfBody, + processResponseConsumeBody, + useParallelQueue = false, + dispatcher + // undici + }) { + let taskDestination = null; + let crossOriginIsolatedCapability = false; + if (request.client != null) { + taskDestination = request.client.globalObject; + crossOriginIsolatedCapability = request.client.crossOriginIsolatedCapability; + } + const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability); + const timingInfo = createOpaqueTimingInfo({ + startTime: currenTime + }); + const fetchParams = { + controller: new Fetch(dispatcher), + request, + timingInfo, + processRequestBodyChunkLength, + processRequestEndOfBody, + processResponse, + processResponseConsumeBody, + processResponseEndOfBody, + taskDestination, + crossOriginIsolatedCapability + }; + assert(!request.body || request.body.stream); + if (request.window === "client") { + request.window = request.client?.globalObject?.constructor?.name === "Window" ? request.client : "no-window"; } - get(key) { - return get(this, key, true); + if (request.origin === "client") { + request.origin = request.client?.origin; } - peek(key) { - return get(this, key, false); + if (request.policyContainer === "client") { + if (request.client != null) { + request.policyContainer = clonePolicyContainer( + request.client.policyContainer + ); + } else { + request.policyContainer = makePolicyContainer(); + } } - pop() { - const node = this[LRU_LIST].tail; - if (!node) - return null; - del(this, node); - return node.value; + if (!request.headersList.contains("accept")) { + const value = "*/*"; + request.headersList.append("accept", value); } - del(key) { - del(this, this[CACHE].get(key)); + if (!request.headersList.contains("accept-language")) { + request.headersList.append("accept-language", "*"); } - load(arr) { - this.reset(); - const now = Date.now(); - for (let l2 = arr.length - 1; l2 >= 0; l2--) { - const hit = arr[l2]; - const expiresAt = hit.e || 0; - if (expiresAt === 0) - this.set(hit.k, hit.v); - else { - const maxAge = expiresAt - now; - if (maxAge > 0) { - this.set(hit.k, hit.v, maxAge); + if (request.priority === null) { + } + if (subresource.includes(request.destination)) { + } + mainFetch(fetchParams).catch((err) => { + fetchParams.controller.terminate(err); + }); + return fetchParams.controller; + } + async function mainFetch(fetchParams, recursive = false) { + const request = fetchParams.request; + let response = null; + if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) { + response = makeNetworkError("local URLs only"); + } + tryUpgradeRequestToAPotentiallyTrustworthyURL(request); + if (requestBadPort(request) === "blocked") { + response = makeNetworkError("bad port"); + } + if (request.referrerPolicy === "") { + request.referrerPolicy = request.policyContainer.referrerPolicy; + } + if (request.referrer !== "no-referrer") { + request.referrer = determineRequestsReferrer(request); + } + if (response === null) { + response = await (async () => { + const currentURL = requestCurrentURL(request); + if ( + // - request’s current URL’s origin is same origin with request’s origin, + // and request’s response tainting is "basic" + sameOrigin(currentURL, request.url) && request.responseTainting === "basic" || // request’s current URL’s scheme is "data" + currentURL.protocol === "data:" || // - request’s mode is "navigate" or "websocket" + (request.mode === "navigate" || request.mode === "websocket") + ) { + request.responseTainting = "basic"; + return await schemeFetch(fetchParams); + } + if (request.mode === "same-origin") { + return makeNetworkError('request mode cannot be "same-origin"'); + } + if (request.mode === "no-cors") { + if (request.redirect !== "follow") { + return makeNetworkError( + 'redirect mode cannot be "follow" for "no-cors" request' + ); } + request.responseTainting = "opaque"; + return await schemeFetch(fetchParams); } - } + if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) { + return makeNetworkError("URL scheme must be a HTTP(S) scheme"); + } + request.responseTainting = "cors"; + return await httpFetch(fetchParams); + })(); } - prune() { - this[CACHE].forEach((value, key) => get(this, key, false)); + if (recursive) { + return response; } - }; - var get = (self2, key, doUse) => { - const node = self2[CACHE].get(key); - if (node) { - const hit = node.value; - if (isStale(self2, hit)) { - del(self2, node); - if (!self2[ALLOW_STALE]) - return void 0; + if (response.status !== 0 && !response.internalResponse) { + if (request.responseTainting === "cors") { + } + if (request.responseTainting === "basic") { + response = filterResponse(response, "basic"); + } else if (request.responseTainting === "cors") { + response = filterResponse(response, "cors"); + } else if (request.responseTainting === "opaque") { + response = filterResponse(response, "opaque"); } else { - if (doUse) { - if (self2[UPDATE_AGE_ON_GET]) - node.value.now = Date.now(); - self2[LRU_LIST].unshiftNode(node); - } + assert(false); } - return hit.value; } - }; - var isStale = (self2, hit) => { - if (!hit || !hit.maxAge && !self2[MAX_AGE]) - return false; - const diff = Date.now() - hit.now; - return hit.maxAge ? diff > hit.maxAge : self2[MAX_AGE] && diff > self2[MAX_AGE]; - }; - var trim = (self2) => { - if (self2[LENGTH] > self2[MAX]) { - for (let walker = self2[LRU_LIST].tail; self2[LENGTH] > self2[MAX] && walker !== null; ) { - const prev = walker.prev; - del(self2, walker); - walker = prev; - } + let internalResponse = response.status === 0 ? response : response.internalResponse; + if (internalResponse.urlList.length === 0) { + internalResponse.urlList.push(...request.urlList); } - }; - var del = (self2, node) => { - if (node) { - const hit = node.value; - if (self2[DISPOSE]) - self2[DISPOSE](hit.key, hit.value); - self2[LENGTH] -= hit.length; - self2[CACHE].delete(hit.key); - self2[LRU_LIST].removeNode(node); + if (!request.timingAllowFailed) { + response.timingAllowPassed = true; } - }; - var Entry = class { - constructor(key, value, length, now, maxAge) { - this.key = key; - this.value = value; - this.length = length; - this.now = now; - this.maxAge = maxAge || 0; + if (response.type === "opaque" && internalResponse.status === 206 && internalResponse.rangeRequested && !request.headers.contains("range")) { + response = internalResponse = makeNetworkError(); } - }; - var forEachStep = (self2, fn2, node, thisp) => { - let hit = node.value; - if (isStale(self2, hit)) { - del(self2, node); - if (!self2[ALLOW_STALE]) - hit = void 0; + if (response.status !== 0 && (request.method === "HEAD" || request.method === "CONNECT" || nullBodyStatus.includes(internalResponse.status))) { + internalResponse.body = null; + fetchParams.controller.dump = true; } - if (hit) - fn2.call(thisp, hit.value, hit.key, self2); - }; - module.exports = LRUCache; - } -}); - -// node_modules/semver/classes/range.js -var require_range = __commonJS({ - "node_modules/semver/classes/range.js"(exports, module) { - var Range3 = class _Range { - constructor(range2, options) { - options = parseOptions(options); - if (range2 instanceof _Range) { - if (range2.loose === !!options.loose && range2.includePrerelease === !!options.includePrerelease) { - return range2; - } else { - return new _Range(range2.raw, options); + if (request.integrity) { + const processBodyError = (reason) => fetchFinale(fetchParams, makeNetworkError(reason)); + if (request.responseTainting === "opaque" || response.body == null) { + processBodyError(response.error); + return; + } + const processBody = (bytes) => { + if (!bytesMatch(bytes, request.integrity)) { + processBodyError("integrity mismatch"); + return; } + response.body = safelyExtractBody(bytes)[0]; + fetchFinale(fetchParams, response); + }; + await fullyReadBody(response.body, processBody, processBodyError); + } else { + fetchFinale(fetchParams, response); + } + } + async function schemeFetch(fetchParams) { + if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) { + return makeAppropriateNetworkError(fetchParams); + } + const { request } = fetchParams; + const { protocol: scheme } = requestCurrentURL(request); + switch (scheme) { + case "about:": { + return makeNetworkError("about scheme is not supported"); + } + case "blob:": { + if (!resolveObjectURL) { + resolveObjectURL = __require("buffer").resolveObjectURL; + } + const blobURLEntry = requestCurrentURL(request); + if (blobURLEntry.search.length !== 0) { + return makeNetworkError("NetworkError when attempting to fetch resource."); + } + const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString()); + if (request.method !== "GET" || !isBlobLike(blobURLEntryObject)) { + return makeNetworkError("invalid method"); + } + const bodyWithType = safelyExtractBody(blobURLEntryObject); + const body2 = bodyWithType[0]; + const length = isomorphicEncode(`${body2.length}`); + const type3 = bodyWithType[1] ?? ""; + const response = makeResponse({ + statusText: "OK", + headersList: [ + ["content-length", { name: "Content-Length", value: length }], + ["content-type", { name: "Content-Type", value: type3 }] + ] + }); + response.body = body2; + return response; } - if (range2 instanceof Comparator) { - this.raw = range2.value; - this.set = [[range2]]; - this.format(); - return this; + case "data:": { + const currentURL = requestCurrentURL(request); + const dataURLStruct = dataURLProcessor(currentURL); + if (dataURLStruct === "failure") { + return makeNetworkError("failed to fetch the data URL"); + } + const mimeType = serializeAMimeType(dataURLStruct.mimeType); + return makeResponse({ + statusText: "OK", + headersList: [ + ["content-type", { name: "Content-Type", value: mimeType }] + ], + body: safelyExtractBody(dataURLStruct.body)[0] + }); } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range2.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map((r2) => this.parseRange(r2.trim())).filter((c2) => c2.length); - if (!this.set.length) { - throw new TypeError(`Invalid SemVer Range: ${this.raw}`); + case "file:": { + return makeNetworkError("not implemented... yet..."); } - if (this.set.length > 1) { - const first = this.set[0]; - this.set = this.set.filter((c2) => !isNullSet(c2[0])); - if (this.set.length === 0) { - this.set = [first]; - } else if (this.set.length > 1) { - for (const c2 of this.set) { - if (c2.length === 1 && isAny(c2[0])) { - this.set = [c2]; - break; - } - } - } + case "http:": + case "https:": { + return await httpFetch(fetchParams).catch((err) => makeNetworkError(err)); + } + default: { + return makeNetworkError("unknown scheme"); } - this.format(); } - format() { - this.range = this.set.map((comps) => comps.join(" ").trim()).join("||").trim(); - return this.range; + } + function finalizeResponse(fetchParams, response) { + fetchParams.request.done = true; + if (fetchParams.processResponseDone != null) { + queueMicrotask(() => fetchParams.processResponseDone(response)); } - toString() { - return this.range; + } + async function fetchFinale(fetchParams, response) { + if (response.type === "error") { + response.urlList = [fetchParams.request.urlList[0]]; + response.timingInfo = createOpaqueTimingInfo({ + startTime: fetchParams.timingInfo.startTime + }); } - parseRange(range2) { - const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); - const memoKey = memoOpts + ":" + range2; - const cached = cache.get(memoKey); - if (cached) { - return cached; - } - const loose = this.options.loose; - const hr2 = loose ? re3[t2.HYPHENRANGELOOSE] : re3[t2.HYPHENRANGE]; - range2 = range2.replace(hr2, hyphenReplace(this.options.includePrerelease)); - debug3("hyphen replace", range2); - range2 = range2.replace(re3[t2.COMPARATORTRIM], comparatorTrimReplace); - debug3("comparator trim", range2); - range2 = range2.replace(re3[t2.TILDETRIM], tildeTrimReplace); - debug3("tilde trim", range2); - range2 = range2.replace(re3[t2.CARETTRIM], caretTrimReplace); - debug3("caret trim", range2); - let rangeList = range2.split(" ").map((comp26) => parseComparator(comp26, this.options)).join(" ").split(/\s+/).map((comp26) => replaceGTE0(comp26, this.options)); - if (loose) { - rangeList = rangeList.filter((comp26) => { - debug3("loose invalid filter", comp26, this.options); - return !!comp26.match(re3[t2.COMPARATORLOOSE]); - }); + const processResponseEndOfBody = () => { + fetchParams.request.done = true; + if (fetchParams.processResponseEndOfBody != null) { + queueMicrotask(() => fetchParams.processResponseEndOfBody(response)); } - debug3("range list", rangeList); - const rangeMap = /* @__PURE__ */ new Map(); - const comparators = rangeList.map((comp26) => new Comparator(comp26, this.options)); - for (const comp26 of comparators) { - if (isNullSet(comp26)) { - return [comp26]; + }; + if (fetchParams.processResponse != null) { + queueMicrotask(() => fetchParams.processResponse(response)); + } + if (response.body == null) { + processResponseEndOfBody(); + } else { + const identityTransformAlgorithm = (chunk, controller) => { + controller.enqueue(chunk); + }; + const transformStream = new TransformStream({ + start() { + }, + transform: identityTransformAlgorithm, + flush: processResponseEndOfBody + }, { + size() { + return 1; } - rangeMap.set(comp26.value, comp26); - } - if (rangeMap.size > 1 && rangeMap.has("")) { - rangeMap.delete(""); + }, { + size() { + return 1; + } + }); + response.body = { stream: response.body.stream.pipeThrough(transformStream) }; + } + if (fetchParams.processResponseConsumeBody != null) { + const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes); + const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure); + if (response.body == null) { + queueMicrotask(() => processBody(null)); + } else { + await fullyReadBody(response.body, processBody, processBodyError); } - const result = [...rangeMap.values()]; - cache.set(memoKey, result); - return result; } - intersects(range2, options) { - if (!(range2 instanceof _Range)) { - throw new TypeError("a Range is required"); + } + async function httpFetch(fetchParams) { + const request = fetchParams.request; + let response = null; + let actualResponse = null; + const timingInfo = fetchParams.timingInfo; + if (request.serviceWorkers === "all") { + } + if (response === null) { + if (request.redirect === "follow") { + request.serviceWorkers = "none"; + } + actualResponse = response = await httpNetworkOrCacheFetch(fetchParams); + if (request.responseTainting === "cors" && corsCheck(request, response) === "failure") { + return makeNetworkError("cors failure"); + } + if (TAOCheck(request, response) === "failure") { + request.timingAllowFailed = true; + } + } + if ((request.responseTainting === "opaque" || response.type === "opaque") && crossOriginResourcePolicyCheck( + request.origin, + request.client, + request.destination, + actualResponse + ) === "blocked") { + return makeNetworkError("blocked"); + } + if (redirectStatus.includes(actualResponse.status)) { + if (request.redirect !== "manual") { + fetchParams.controller.connection.destroy(); + } + if (request.redirect === "error") { + response = makeNetworkError("unexpected redirect"); + } else if (request.redirect === "manual") { + response = actualResponse; + } else if (request.redirect === "follow") { + response = await httpRedirectFetch(fetchParams, response); + } else { + assert(false); } - return this.set.some((thisComparators) => { - return isSatisfiable(thisComparators, options) && range2.set.some((rangeComparators) => { - return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { - return rangeComparators.every((rangeComparator) => { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); - }); } - // if ANY of the sets match ALL of its comparators, then pass - test(version4) { - if (!version4) { - return false; + response.timingInfo = timingInfo; + return response; + } + async function httpRedirectFetch(fetchParams, response) { + const request = fetchParams.request; + const actualResponse = response.internalResponse ? response.internalResponse : response; + let locationURL; + try { + locationURL = responseLocationURL( + actualResponse, + requestCurrentURL(request).hash + ); + if (locationURL == null) { + return response; } - if (typeof version4 === "string") { - try { - version4 = new SemVer(version4, this.options); - } catch (er2) { - return false; - } + } catch (err) { + return makeNetworkError(err); + } + if (!urlIsHttpHttpsScheme(locationURL)) { + return makeNetworkError("URL scheme must be a HTTP(S) scheme"); + } + if (request.redirectCount === 20) { + return makeNetworkError("redirect count exceeded"); + } + request.redirectCount += 1; + if (request.mode === "cors" && (locationURL.username || locationURL.password) && !sameOrigin(request, locationURL)) { + return makeNetworkError('cross origin not allowed for request mode "cors"'); + } + if (request.responseTainting === "cors" && (locationURL.username || locationURL.password)) { + return makeNetworkError( + 'URL cannot contain credentials for request mode "cors"' + ); + } + if (actualResponse.status !== 303 && request.body != null && request.body.source == null) { + return makeNetworkError(); + } + if ([301, 302].includes(actualResponse.status) && request.method === "POST" || actualResponse.status === 303 && !["GET", "HEAD"].includes(request.method)) { + request.method = "GET"; + request.body = null; + for (const headerName of requestBodyHeader) { + request.headersList.delete(headerName); } - for (let i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version4, this.options)) { - return true; - } + } + if (!sameOrigin(requestCurrentURL(request), locationURL)) { + request.headersList.delete("authorization"); + request.headersList.delete("cookie"); + request.headersList.delete("host"); + } + if (request.body != null) { + assert(request.body.source != null); + request.body = safelyExtractBody(request.body.source)[0]; + } + const timingInfo = fetchParams.timingInfo; + timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability); + if (timingInfo.redirectStartTime === 0) { + timingInfo.redirectStartTime = timingInfo.startTime; + } + request.urlList.push(locationURL); + setRequestReferrerPolicyOnRedirect(request, actualResponse); + return mainFetch(fetchParams, true); + } + async function httpNetworkOrCacheFetch(fetchParams, isAuthenticationFetch = false, isNewConnectionFetch = false) { + const request = fetchParams.request; + let httpFetchParams = null; + let httpRequest = null; + let response = null; + const httpCache = null; + const revalidatingFlag = false; + if (request.window === "no-window" && request.redirect === "error") { + httpFetchParams = fetchParams; + httpRequest = request; + } else { + httpRequest = makeRequest(request); + httpFetchParams = { ...fetchParams }; + httpFetchParams.request = httpRequest; + } + const includeCredentials = request.credentials === "include" || request.credentials === "same-origin" && request.responseTainting === "basic"; + const contentLength2 = httpRequest.body ? httpRequest.body.length : null; + let contentLengthHeaderValue = null; + if (httpRequest.body == null && ["POST", "PUT"].includes(httpRequest.method)) { + contentLengthHeaderValue = "0"; + } + if (contentLength2 != null) { + contentLengthHeaderValue = isomorphicEncode(`${contentLength2}`); + } + if (contentLengthHeaderValue != null) { + httpRequest.headersList.append("content-length", contentLengthHeaderValue); + } + if (contentLength2 != null && httpRequest.keepalive) { + } + if (httpRequest.referrer instanceof URL) { + httpRequest.headersList.append("referer", isomorphicEncode(httpRequest.referrer.href)); + } + appendRequestOriginHeader(httpRequest); + appendFetchMetadata(httpRequest); + if (!httpRequest.headersList.contains("user-agent")) { + httpRequest.headersList.append("user-agent", typeof esbuildDetection === "undefined" ? "undici" : "node"); + } + if (httpRequest.cache === "default" && (httpRequest.headersList.contains("if-modified-since") || httpRequest.headersList.contains("if-none-match") || httpRequest.headersList.contains("if-unmodified-since") || httpRequest.headersList.contains("if-match") || httpRequest.headersList.contains("if-range"))) { + httpRequest.cache = "no-store"; + } + if (httpRequest.cache === "no-cache" && !httpRequest.preventNoCacheCacheControlHeaderModification && !httpRequest.headersList.contains("cache-control")) { + httpRequest.headersList.append("cache-control", "max-age=0"); + } + if (httpRequest.cache === "no-store" || httpRequest.cache === "reload") { + if (!httpRequest.headersList.contains("pragma")) { + httpRequest.headersList.append("pragma", "no-cache"); + } + if (!httpRequest.headersList.contains("cache-control")) { + httpRequest.headersList.append("cache-control", "no-cache"); } - return false; } - }; - module.exports = Range3; - var LRU = require_lru_cache(); - var cache = new LRU({ max: 1e3 }); - var parseOptions = require_parse_options(); - var Comparator = require_comparator(); - var debug3 = require_debug(); - var SemVer = require_semver(); - var { - safeRe: re3, - t: t2, - comparatorTrimReplace, - tildeTrimReplace, - caretTrimReplace - } = require_re(); - var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants(); - var isNullSet = (c2) => c2.value === "<0.0.0-0"; - var isAny = (c2) => c2.value === ""; - var isSatisfiable = (comparators, options) => { - let result = true; - const remainingComparators = comparators.slice(); - let testComparator = remainingComparators.pop(); - while (result && remainingComparators.length) { - result = remainingComparators.every((otherComparator) => { - return testComparator.intersects(otherComparator, options); - }); - testComparator = remainingComparators.pop(); + if (httpRequest.headersList.contains("range")) { + httpRequest.headersList.append("accept-encoding", "identity"); } - return result; - }; - var parseComparator = (comp26, options) => { - debug3("comp", comp26, options); - comp26 = replaceCarets(comp26, options); - debug3("caret", comp26); - comp26 = replaceTildes(comp26, options); - debug3("tildes", comp26); - comp26 = replaceXRanges(comp26, options); - debug3("xrange", comp26); - comp26 = replaceStars(comp26, options); - debug3("stars", comp26); - return comp26; - }; - var isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; - var replaceTildes = (comp26, options) => { - return comp26.trim().split(/\s+/).map((c2) => replaceTilde(c2, options)).join(" "); - }; - var replaceTilde = (comp26, options) => { - const r2 = options.loose ? re3[t2.TILDELOOSE] : re3[t2.TILDE]; - return comp26.replace(r2, (_2, M2, m3, p2, pr2) => { - debug3("tilde", comp26, _2, M2, m3, p2, pr2); - let ret; - if (isX(M2)) { - ret = ""; - } else if (isX(m3)) { - ret = `>=${M2}.0.0 <${+M2 + 1}.0.0-0`; - } else if (isX(p2)) { - ret = `>=${M2}.${m3}.0 <${M2}.${+m3 + 1}.0-0`; - } else if (pr2) { - debug3("replaceTilde pr", pr2); - ret = `>=${M2}.${m3}.${p2}-${pr2} <${M2}.${+m3 + 1}.0-0`; + if (!httpRequest.headersList.contains("accept-encoding")) { + if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) { + httpRequest.headersList.append("accept-encoding", "br, gzip, deflate"); } else { - ret = `>=${M2}.${m3}.${p2} <${M2}.${+m3 + 1}.0-0`; + httpRequest.headersList.append("accept-encoding", "gzip, deflate"); } - debug3("tilde return", ret); - return ret; - }); - }; - var replaceCarets = (comp26, options) => { - return comp26.trim().split(/\s+/).map((c2) => replaceCaret(c2, options)).join(" "); - }; - var replaceCaret = (comp26, options) => { - debug3("caret", comp26, options); - const r2 = options.loose ? re3[t2.CARETLOOSE] : re3[t2.CARET]; - const z2 = options.includePrerelease ? "-0" : ""; - return comp26.replace(r2, (_2, M2, m3, p2, pr2) => { - debug3("caret", comp26, _2, M2, m3, p2, pr2); - let ret; - if (isX(M2)) { - ret = ""; - } else if (isX(m3)) { - ret = `>=${M2}.0.0${z2} <${+M2 + 1}.0.0-0`; - } else if (isX(p2)) { - if (M2 === "0") { - ret = `>=${M2}.${m3}.0${z2} <${M2}.${+m3 + 1}.0-0`; - } else { - ret = `>=${M2}.${m3}.0${z2} <${+M2 + 1}.0.0-0`; + } + httpRequest.headersList.delete("host"); + if (includeCredentials) { + } + if (httpCache == null) { + httpRequest.cache = "no-store"; + } + if (httpRequest.mode !== "no-store" && httpRequest.mode !== "reload") { + } + if (response == null) { + if (httpRequest.mode === "only-if-cached") { + return makeNetworkError("only if cached"); + } + const forwardResponse = await httpNetworkFetch( + httpFetchParams, + includeCredentials, + isNewConnectionFetch + ); + if (!safeMethods.includes(httpRequest.method) && forwardResponse.status >= 200 && forwardResponse.status <= 399) { + } + if (revalidatingFlag && forwardResponse.status === 304) { + } + if (response == null) { + response = forwardResponse; + } + } + response.urlList = [...httpRequest.urlList]; + if (httpRequest.headersList.contains("range")) { + response.rangeRequested = true; + } + response.requestIncludesCredentials = includeCredentials; + if (response.status === 407) { + if (request.window === "no-window") { + return makeNetworkError(); + } + if (isCancelled(fetchParams)) { + return makeAppropriateNetworkError(fetchParams); + } + return makeNetworkError("proxy authentication required"); + } + if ( + // response’s status is 421 + response.status === 421 && // isNewConnectionFetch is false + !isNewConnectionFetch && // request’s body is null, or request’s body is non-null and request’s body’s source is non-null + (request.body == null || request.body.source != null) + ) { + if (isCancelled(fetchParams)) { + return makeAppropriateNetworkError(fetchParams); + } + fetchParams.controller.connection.destroy(); + response = await httpNetworkOrCacheFetch( + fetchParams, + isAuthenticationFetch, + true + ); + } + if (isAuthenticationFetch) { + } + return response; + } + async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) { + assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed); + fetchParams.controller.connection = { + abort: null, + destroyed: false, + destroy(err) { + if (!this.destroyed) { + this.destroyed = true; + this.abort?.(err ?? new DOMException2("The operation was aborted.", "AbortError")); } - } else if (pr2) { - debug3("replaceCaret pr", pr2); - if (M2 === "0") { - if (m3 === "0") { - ret = `>=${M2}.${m3}.${p2}-${pr2} <${M2}.${m3}.${+p2 + 1}-0`; - } else { - ret = `>=${M2}.${m3}.${p2}-${pr2} <${M2}.${+m3 + 1}.0-0`; - } + } + }; + const request = fetchParams.request; + let response = null; + const timingInfo = fetchParams.timingInfo; + const httpCache = null; + if (httpCache == null) { + request.cache = "no-store"; + } + const newConnection = forceNewConnection ? "yes" : "no"; + if (request.mode === "websocket") { + } else { + } + let requestBody = null; + if (request.body == null && fetchParams.processRequestEndOfBody) { + queueMicrotask(() => fetchParams.processRequestEndOfBody()); + } else if (request.body != null) { + const processBodyChunk = async function* (bytes) { + if (isCancelled(fetchParams)) { + return; + } + yield bytes; + fetchParams.processRequestBodyChunkLength?.(bytes.byteLength); + }; + const processEndOfBody = () => { + if (isCancelled(fetchParams)) { + return; + } + if (fetchParams.processRequestEndOfBody) { + fetchParams.processRequestEndOfBody(); + } + }; + const processBodyError = (e2) => { + if (isCancelled(fetchParams)) { + return; + } + if (e2.name === "AbortError") { + fetchParams.controller.abort(); } else { - ret = `>=${M2}.${m3}.${p2}-${pr2} <${+M2 + 1}.0.0-0`; + fetchParams.controller.terminate(e2); } - } else { - debug3("no pr"); - if (M2 === "0") { - if (m3 === "0") { - ret = `>=${M2}.${m3}.${p2}${z2} <${M2}.${m3}.${+p2 + 1}-0`; - } else { - ret = `>=${M2}.${m3}.${p2}${z2} <${M2}.${+m3 + 1}.0-0`; + }; + requestBody = async function* () { + try { + for await (const bytes of request.body.stream) { + yield* processBodyChunk(bytes); } - } else { - ret = `>=${M2}.${m3}.${p2} <${+M2 + 1}.0.0-0`; + processEndOfBody(); + } catch (err) { + processBodyError(err); } + }(); + } + try { + const { body: body2, status, statusText, headersList, socket } = await dispatch({ body: requestBody }); + if (socket) { + response = makeResponse({ status, statusText, headersList, socket }); + } else { + const iterator = body2[Symbol.asyncIterator](); + fetchParams.controller.next = () => iterator.next(); + response = makeResponse({ status, statusText, headersList }); } - debug3("caret return", ret); - return ret; - }); - }; - var replaceXRanges = (comp26, options) => { - debug3("replaceXRanges", comp26, options); - return comp26.split(/\s+/).map((c2) => replaceXRange(c2, options)).join(" "); - }; - var replaceXRange = (comp26, options) => { - comp26 = comp26.trim(); - const r2 = options.loose ? re3[t2.XRANGELOOSE] : re3[t2.XRANGE]; - return comp26.replace(r2, (ret, gtlt, M2, m3, p2, pr2) => { - debug3("xRange", comp26, ret, gtlt, M2, m3, p2, pr2); - const xM = isX(M2); - const xm = xM || isX(m3); - const xp = xm || isX(p2); - const anyX = xp; - if (gtlt === "=" && anyX) { - gtlt = ""; + } catch (err) { + if (err.name === "AbortError") { + fetchParams.controller.connection.destroy(); + return makeAppropriateNetworkError(fetchParams, err); } - pr2 = options.includePrerelease ? "-0" : ""; - if (xM) { - if (gtlt === ">" || gtlt === "<") { - ret = "<0.0.0-0"; - } else { - ret = "*"; + return makeNetworkError(err); + } + const pullAlgorithm = () => { + fetchParams.controller.resume(); + }; + const cancelAlgorithm = (reason) => { + fetchParams.controller.abort(reason); + }; + if (!ReadableStream) { + ReadableStream = __require("stream/web").ReadableStream; + } + const stream = new ReadableStream( + { + async start(controller) { + fetchParams.controller.controller = controller; + }, + async pull(controller) { + await pullAlgorithm(controller); + }, + async cancel(reason) { + await cancelAlgorithm(reason); } - } else if (gtlt && anyX) { - if (xm) { - m3 = 0; + }, + { + highWaterMark: 0, + size() { + return 1; } - p2 = 0; - if (gtlt === ">") { - gtlt = ">="; - if (xm) { - M2 = +M2 + 1; - m3 = 0; - p2 = 0; - } else { - m3 = +m3 + 1; - p2 = 0; + } + ); + response.body = { stream }; + fetchParams.controller.on("terminated", onAborted); + fetchParams.controller.resume = async () => { + while (true) { + let bytes; + let isFailure; + try { + const { done, value } = await fetchParams.controller.next(); + if (isAborted(fetchParams)) { + break; } - } else if (gtlt === "<=") { - gtlt = "<"; - if (xm) { - M2 = +M2 + 1; + bytes = done ? void 0 : value; + } catch (err) { + if (fetchParams.controller.ended && !timingInfo.encodedBodySize) { + bytes = void 0; } else { - m3 = +m3 + 1; + bytes = err; + isFailure = true; } } - if (gtlt === "<") { - pr2 = "-0"; + if (bytes === void 0) { + readableStreamClose(fetchParams.controller.controller); + finalizeResponse(fetchParams, response); + return; + } + timingInfo.decodedBodySize += bytes?.byteLength ?? 0; + if (isFailure) { + fetchParams.controller.terminate(bytes); + return; + } + fetchParams.controller.controller.enqueue(new Uint8Array(bytes)); + if (isErrored(stream)) { + fetchParams.controller.terminate(); + return; + } + if (!fetchParams.controller.controller.desiredSize) { + return; } - ret = `${gtlt + M2}.${m3}.${p2}${pr2}`; - } else if (xm) { - ret = `>=${M2}.0.0${pr2} <${+M2 + 1}.0.0-0`; - } else if (xp) { - ret = `>=${M2}.${m3}.0${pr2} <${M2}.${+m3 + 1}.0-0`; } - debug3("xRange return", ret); - return ret; - }); + }; + function onAborted(reason) { + if (isAborted(fetchParams)) { + response.aborted = true; + if (isReadable(stream)) { + fetchParams.controller.controller.error( + fetchParams.controller.serializedAbortReason + ); + } + } else { + if (isReadable(stream)) { + fetchParams.controller.controller.error(new TypeError("terminated", { + cause: isErrorLike(reason) ? reason : void 0 + })); + } + } + fetchParams.controller.connection.destroy(); + } + return response; + async function dispatch({ body: body2 }) { + const url2 = requestCurrentURL(request); + const agent = fetchParams.controller.dispatcher; + return new Promise((resolve2, reject) => agent.dispatch( + { + path: url2.pathname + url2.search, + origin: url2.origin, + method: request.method, + body: fetchParams.controller.dispatcher.isMockActive ? request.body && request.body.source : body2, + headers: request.headersList.entries, + maxRedirections: 0, + upgrade: request.mode === "websocket" ? "websocket" : void 0 + }, + { + body: null, + abort: null, + onConnect(abort) { + const { connection } = fetchParams.controller; + if (connection.destroyed) { + abort(new DOMException2("The operation was aborted.", "AbortError")); + } else { + fetchParams.controller.on("terminated", abort); + this.abort = connection.abort = abort; + } + }, + onHeaders(status, headersList, resume, statusText) { + if (status < 200) { + return; + } + let codings = []; + let location = ""; + const headers = new Headers2(); + if (Array.isArray(headersList)) { + for (let n2 = 0; n2 < headersList.length; n2 += 2) { + const key = headersList[n2 + 0].toString("latin1"); + const val = headersList[n2 + 1].toString("latin1"); + if (key.toLowerCase() === "content-encoding") { + codings = val.toLowerCase().split(",").map((x2) => x2.trim()); + } else if (key.toLowerCase() === "location") { + location = val; + } + headers.append(key, val); + } + } else { + const keys = Object.keys(headersList); + for (const key of keys) { + const val = headersList[key]; + if (key.toLowerCase() === "content-encoding") { + codings = val.toLowerCase().split(",").map((x2) => x2.trim()).reverse(); + } else if (key.toLowerCase() === "location") { + location = val; + } + headers.append(key, val); + } + } + this.body = new Readable5({ read: resume }); + const decoders = []; + const willFollow = request.redirect === "follow" && location && redirectStatus.includes(status); + if (request.method !== "HEAD" && request.method !== "CONNECT" && !nullBodyStatus.includes(status) && !willFollow) { + for (const coding of codings) { + if (coding === "x-gzip" || coding === "gzip") { + decoders.push(zlib2.createGunzip({ + // Be less strict when decoding compressed responses, since sometimes + // servers send slightly invalid responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + flush: zlib2.constants.Z_SYNC_FLUSH, + finishFlush: zlib2.constants.Z_SYNC_FLUSH + })); + } else if (coding === "deflate") { + decoders.push(zlib2.createInflate()); + } else if (coding === "br") { + decoders.push(zlib2.createBrotliDecompress()); + } else { + decoders.length = 0; + break; + } + } + } + resolve2({ + status, + statusText, + headersList: headers[kHeadersList], + body: decoders.length ? pipeline(this.body, ...decoders, () => { + }) : this.body.on("error", () => { + }) + }); + return true; + }, + onData(chunk) { + if (fetchParams.controller.dump) { + return; + } + const bytes = chunk; + timingInfo.encodedBodySize += bytes.byteLength; + return this.body.push(bytes); + }, + onComplete() { + if (this.abort) { + fetchParams.controller.off("terminated", this.abort); + } + fetchParams.controller.ended = true; + this.body.push(null); + }, + onError(error) { + if (this.abort) { + fetchParams.controller.off("terminated", this.abort); + } + this.body?.destroy(error); + fetchParams.controller.terminate(error); + reject(error); + }, + onUpgrade(status, headersList, socket) { + if (status !== 101) { + return; + } + const headers = new Headers2(); + for (let n2 = 0; n2 < headersList.length; n2 += 2) { + const key = headersList[n2 + 0].toString("latin1"); + const val = headersList[n2 + 1].toString("latin1"); + headers.append(key, val); + } + resolve2({ + status, + statusText: STATUS_CODES3[status], + headersList: headers[kHeadersList], + socket + }); + return true; + } + } + )); + } + } + module.exports = { + fetch: fetch2, + Fetch, + fetching, + finalizeAndReportTiming }; - var replaceStars = (comp26, options) => { - debug3("replaceStars", comp26, options); - return comp26.trim().replace(re3[t2.STAR], ""); + } +}); + +// node_modules/undici/lib/fileapi/symbols.js +var require_symbols3 = __commonJS({ + "node_modules/undici/lib/fileapi/symbols.js"(exports, module) { + "use strict"; + module.exports = { + kState: Symbol("FileReader state"), + kResult: Symbol("FileReader result"), + kError: Symbol("FileReader error"), + kLastProgressEventFired: Symbol("FileReader last progress event fired timestamp"), + kEvents: Symbol("FileReader events"), + kAborted: Symbol("FileReader aborted") }; - var replaceGTE0 = (comp26, options) => { - debug3("replaceGTE0", comp26, options); - return comp26.trim().replace(re3[options.includePrerelease ? t2.GTE0PRE : t2.GTE0], ""); + } +}); + +// node_modules/undici/lib/fileapi/progressevent.js +var require_progressevent = __commonJS({ + "node_modules/undici/lib/fileapi/progressevent.js"(exports, module) { + "use strict"; + var { webidl } = require_webidl(); + var kState = Symbol("ProgressEvent state"); + var ProgressEvent = class _ProgressEvent extends Event { + constructor(type3, eventInitDict = {}) { + type3 = webidl.converters.DOMString(type3); + eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {}); + super(type3, eventInitDict); + this[kState] = { + lengthComputable: eventInitDict.lengthComputable, + loaded: eventInitDict.loaded, + total: eventInitDict.total + }; + } + get lengthComputable() { + webidl.brandCheck(this, _ProgressEvent); + return this[kState].lengthComputable; + } + get loaded() { + webidl.brandCheck(this, _ProgressEvent); + return this[kState].loaded; + } + get total() { + webidl.brandCheck(this, _ProgressEvent); + return this[kState].total; + } }; - var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to2, tM, tm, tp, tpr, tb) => { - if (isX(fM)) { - from = ""; - } else if (isX(fm)) { - from = `>=${fM}.0.0${incPr ? "-0" : ""}`; - } else if (isX(fp)) { - from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`; - } else if (fpr) { - from = `>=${from}`; - } else { - from = `>=${from}${incPr ? "-0" : ""}`; + webidl.converters.ProgressEventInit = webidl.dictionaryConverter([ + { + key: "lengthComputable", + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: "loaded", + converter: webidl.converters["unsigned long long"], + defaultValue: 0 + }, + { + key: "total", + converter: webidl.converters["unsigned long long"], + defaultValue: 0 + }, + { + key: "bubbles", + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: "cancelable", + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: "composed", + converter: webidl.converters.boolean, + defaultValue: false } - if (isX(tM)) { - to2 = ""; - } else if (isX(tm)) { - to2 = `<${+tM + 1}.0.0-0`; - } else if (isX(tp)) { - to2 = `<${tM}.${+tm + 1}.0-0`; - } else if (tpr) { - to2 = `<=${tM}.${tm}.${tp}-${tpr}`; - } else if (incPr) { - to2 = `<${tM}.${tm}.${+tp + 1}-0`; - } else { - to2 = `<=${to2}`; + ]); + module.exports = { + ProgressEvent + }; + } +}); + +// node_modules/undici/lib/fileapi/encoding.js +var require_encoding = __commonJS({ + "node_modules/undici/lib/fileapi/encoding.js"(exports, module) { + "use strict"; + function getEncoding(label) { + if (!label) { + return "failure"; + } + switch (label.trim().toLowerCase()) { + case "unicode-1-1-utf-8": + case "unicode11utf8": + case "unicode20utf8": + case "utf-8": + case "utf8": + case "x-unicode20utf8": + return "UTF-8"; + case "866": + case "cp866": + case "csibm866": + case "ibm866": + return "IBM866"; + case "csisolatin2": + case "iso-8859-2": + case "iso-ir-101": + case "iso8859-2": + case "iso88592": + case "iso_8859-2": + case "iso_8859-2:1987": + case "l2": + case "latin2": + return "ISO-8859-2"; + case "csisolatin3": + case "iso-8859-3": + case "iso-ir-109": + case "iso8859-3": + case "iso88593": + case "iso_8859-3": + case "iso_8859-3:1988": + case "l3": + case "latin3": + return "ISO-8859-3"; + case "csisolatin4": + case "iso-8859-4": + case "iso-ir-110": + case "iso8859-4": + case "iso88594": + case "iso_8859-4": + case "iso_8859-4:1988": + case "l4": + case "latin4": + return "ISO-8859-4"; + case "csisolatincyrillic": + case "cyrillic": + case "iso-8859-5": + case "iso-ir-144": + case "iso8859-5": + case "iso88595": + case "iso_8859-5": + case "iso_8859-5:1988": + return "ISO-8859-5"; + case "arabic": + case "asmo-708": + case "csiso88596e": + case "csiso88596i": + case "csisolatinarabic": + case "ecma-114": + case "iso-8859-6": + case "iso-8859-6-e": + case "iso-8859-6-i": + case "iso-ir-127": + case "iso8859-6": + case "iso88596": + case "iso_8859-6": + case "iso_8859-6:1987": + return "ISO-8859-6"; + case "csisolatingreek": + case "ecma-118": + case "elot_928": + case "greek": + case "greek8": + case "iso-8859-7": + case "iso-ir-126": + case "iso8859-7": + case "iso88597": + case "iso_8859-7": + case "iso_8859-7:1987": + case "sun_eu_greek": + return "ISO-8859-7"; + case "csiso88598e": + case "csisolatinhebrew": + case "hebrew": + case "iso-8859-8": + case "iso-8859-8-e": + case "iso-ir-138": + case "iso8859-8": + case "iso88598": + case "iso_8859-8": + case "iso_8859-8:1988": + case "visual": + return "ISO-8859-8"; + case "csiso88598i": + case "iso-8859-8-i": + case "logical": + return "ISO-8859-8-I"; + case "csisolatin6": + case "iso-8859-10": + case "iso-ir-157": + case "iso8859-10": + case "iso885910": + case "l6": + case "latin6": + return "ISO-8859-10"; + case "iso-8859-13": + case "iso8859-13": + case "iso885913": + return "ISO-8859-13"; + case "iso-8859-14": + case "iso8859-14": + case "iso885914": + return "ISO-8859-14"; + case "csisolatin9": + case "iso-8859-15": + case "iso8859-15": + case "iso885915": + case "iso_8859-15": + case "l9": + return "ISO-8859-15"; + case "iso-8859-16": + return "ISO-8859-16"; + case "cskoi8r": + case "koi": + case "koi8": + case "koi8-r": + case "koi8_r": + return "KOI8-R"; + case "koi8-ru": + case "koi8-u": + return "KOI8-U"; + case "csmacintosh": + case "mac": + case "macintosh": + case "x-mac-roman": + return "macintosh"; + case "iso-8859-11": + case "iso8859-11": + case "iso885911": + case "tis-620": + case "windows-874": + return "windows-874"; + case "cp1250": + case "windows-1250": + case "x-cp1250": + return "windows-1250"; + case "cp1251": + case "windows-1251": + case "x-cp1251": + return "windows-1251"; + case "ansi_x3.4-1968": + case "ascii": + case "cp1252": + case "cp819": + case "csisolatin1": + case "ibm819": + case "iso-8859-1": + case "iso-ir-100": + case "iso8859-1": + case "iso88591": + case "iso_8859-1": + case "iso_8859-1:1987": + case "l1": + case "latin1": + case "us-ascii": + case "windows-1252": + case "x-cp1252": + return "windows-1252"; + case "cp1253": + case "windows-1253": + case "x-cp1253": + return "windows-1253"; + case "cp1254": + case "csisolatin5": + case "iso-8859-9": + case "iso-ir-148": + case "iso8859-9": + case "iso88599": + case "iso_8859-9": + case "iso_8859-9:1989": + case "l5": + case "latin5": + case "windows-1254": + case "x-cp1254": + return "windows-1254"; + case "cp1255": + case "windows-1255": + case "x-cp1255": + return "windows-1255"; + case "cp1256": + case "windows-1256": + case "x-cp1256": + return "windows-1256"; + case "cp1257": + case "windows-1257": + case "x-cp1257": + return "windows-1257"; + case "cp1258": + case "windows-1258": + case "x-cp1258": + return "windows-1258"; + case "x-mac-cyrillic": + case "x-mac-ukrainian": + return "x-mac-cyrillic"; + case "chinese": + case "csgb2312": + case "csiso58gb231280": + case "gb2312": + case "gb_2312": + case "gb_2312-80": + case "gbk": + case "iso-ir-58": + case "x-gbk": + return "GBK"; + case "gb18030": + return "gb18030"; + case "big5": + case "big5-hkscs": + case "cn-big5": + case "csbig5": + case "x-x-big5": + return "Big5"; + case "cseucpkdfmtjapanese": + case "euc-jp": + case "x-euc-jp": + return "EUC-JP"; + case "csiso2022jp": + case "iso-2022-jp": + return "ISO-2022-JP"; + case "csshiftjis": + case "ms932": + case "ms_kanji": + case "shift-jis": + case "shift_jis": + case "sjis": + case "windows-31j": + case "x-sjis": + return "Shift_JIS"; + case "cseuckr": + case "csksc56011987": + case "euc-kr": + case "iso-ir-149": + case "korean": + case "ks_c_5601-1987": + case "ks_c_5601-1989": + case "ksc5601": + case "ksc_5601": + case "windows-949": + return "EUC-KR"; + case "csiso2022kr": + case "hz-gb-2312": + case "iso-2022-cn": + case "iso-2022-cn-ext": + case "iso-2022-kr": + case "replacement": + return "replacement"; + case "unicodefffe": + case "utf-16be": + return "UTF-16BE"; + case "csunicode": + case "iso-10646-ucs-2": + case "ucs-2": + case "unicode": + case "unicodefeff": + case "utf-16": + case "utf-16le": + return "UTF-16LE"; + case "x-user-defined": + return "x-user-defined"; + default: + return "failure"; } - return `${from} ${to2}`.trim(); + } + module.exports = { + getEncoding }; - var testSet = (set2, version4, options) => { - for (let i2 = 0; i2 < set2.length; i2++) { - if (!set2[i2].test(version4)) { - return false; + } +}); + +// node_modules/undici/lib/fileapi/util.js +var require_util4 = __commonJS({ + "node_modules/undici/lib/fileapi/util.js"(exports, module) { + "use strict"; + var { + kState, + kError, + kResult, + kAborted, + kLastProgressEventFired + } = require_symbols3(); + var { ProgressEvent } = require_progressevent(); + var { getEncoding } = require_encoding(); + var { DOMException: DOMException2 } = require_constants(); + var { serializeAMimeType, parseMIMEType } = require_dataURL(); + var { types } = __require("util"); + var { StringDecoder } = __require("string_decoder"); + var { btoa: btoa2 } = __require("buffer"); + var staticPropertyDescriptors = { + enumerable: true, + writable: false, + configurable: false + }; + function readOperation(fr2, blob, type3, encodingName) { + if (fr2[kState] === "loading") { + throw new DOMException2("Invalid state", "InvalidStateError"); + } + fr2[kState] = "loading"; + fr2[kResult] = null; + fr2[kError] = null; + const stream = blob.stream(); + const reader = stream.getReader(); + const bytes = []; + let chunkPromise = reader.read(); + let isFirstChunk = true; + (async () => { + while (!fr2[kAborted]) { + try { + const { done, value } = await chunkPromise; + if (isFirstChunk && !fr2[kAborted]) { + queueMicrotask(() => { + fireAProgressEvent("loadstart", fr2); + }); + } + isFirstChunk = false; + if (!done && types.isUint8Array(value)) { + bytes.push(value); + if ((fr2[kLastProgressEventFired] === void 0 || Date.now() - fr2[kLastProgressEventFired] >= 50) && !fr2[kAborted]) { + fr2[kLastProgressEventFired] = Date.now(); + queueMicrotask(() => { + fireAProgressEvent("progress", fr2); + }); + } + chunkPromise = reader.read(); + } else if (done) { + queueMicrotask(() => { + fr2[kState] = "done"; + try { + const result = packageData(bytes, type3, blob.type, encodingName); + if (fr2[kAborted]) { + return; + } + fr2[kResult] = result; + fireAProgressEvent("load", fr2); + } catch (error) { + fr2[kError] = error; + fireAProgressEvent("error", fr2); + } + if (fr2[kState] !== "loading") { + fireAProgressEvent("loadend", fr2); + } + }); + break; + } + } catch (error) { + if (fr2[kAborted]) { + return; + } + queueMicrotask(() => { + fr2[kState] = "done"; + fr2[kError] = error; + fireAProgressEvent("error", fr2); + if (fr2[kState] !== "loading") { + fireAProgressEvent("loadend", fr2); + } + }); + break; + } } - } - if (version4.prerelease.length && !options.includePrerelease) { - for (let i2 = 0; i2 < set2.length; i2++) { - debug3(set2[i2].semver); - if (set2[i2].semver === Comparator.ANY) { - continue; + })(); + } + function fireAProgressEvent(e2, reader) { + const event = new ProgressEvent(e2, { + bubbles: false, + cancelable: false + }); + reader.dispatchEvent(event); + } + function packageData(bytes, type3, mimeType, encodingName) { + switch (type3) { + case "DataURL": { + let dataURL = "data:"; + const parsed = parseMIMEType(mimeType || "application/octet-stream"); + if (parsed !== "failure") { + dataURL += serializeAMimeType(parsed); } - if (set2[i2].semver.prerelease.length > 0) { - const allowed = set2[i2].semver; - if (allowed.major === version4.major && allowed.minor === version4.minor && allowed.patch === version4.patch) { - return true; + dataURL += ";base64,"; + const decoder = new StringDecoder("latin1"); + for (const chunk of bytes) { + dataURL += btoa2(decoder.write(chunk)); + } + dataURL += btoa2(decoder.end()); + return dataURL; + } + case "Text": { + let encoding = "failure"; + if (encodingName) { + encoding = getEncoding(encodingName); + } + if (encoding === "failure" && mimeType) { + const type4 = parseMIMEType(mimeType); + if (type4 !== "failure") { + encoding = getEncoding(type4.parameters.get("charset")); } } + if (encoding === "failure") { + encoding = "UTF-8"; + } + return decode(bytes, encoding); + } + case "ArrayBuffer": { + const sequence = combineByteSequences(bytes); + return sequence.buffer; + } + case "BinaryString": { + let binaryString = ""; + const decoder = new StringDecoder("latin1"); + for (const chunk of bytes) { + binaryString += decoder.write(chunk); + } + binaryString += decoder.end(); + return binaryString; } - return false; } - return true; + } + function decode(ioQueue, encoding) { + const bytes = combineByteSequences(ioQueue); + const BOMEncoding = BOMSniffing(bytes); + let slice = 0; + if (BOMEncoding !== null) { + encoding = BOMEncoding; + slice = BOMEncoding === "UTF-8" ? 3 : 2; + } + const sliced = bytes.slice(slice); + return new TextDecoder(encoding).decode(sliced); + } + function BOMSniffing(ioQueue) { + const [a2, b2, c2] = ioQueue; + if (a2 === 239 && b2 === 187 && c2 === 191) { + return "UTF-8"; + } else if (a2 === 254 && b2 === 255) { + return "UTF-16BE"; + } else if (a2 === 255 && b2 === 254) { + return "UTF-16LE"; + } + return null; + } + function combineByteSequences(sequences) { + const size = sequences.reduce((a2, b2) => { + return a2 + b2.byteLength; + }, 0); + let offset = 0; + return sequences.reduce((a2, b2) => { + a2.set(b2, offset); + offset += b2.byteLength; + return a2; + }, new Uint8Array(size)); + } + module.exports = { + staticPropertyDescriptors, + readOperation, + fireAProgressEvent }; } }); -// node_modules/semver/classes/comparator.js -var require_comparator = __commonJS({ - "node_modules/semver/classes/comparator.js"(exports, module) { - var ANY = Symbol("SemVer ANY"); - var Comparator = class _Comparator { - static get ANY() { - return ANY; +// node_modules/undici/lib/fileapi/filereader.js +var require_filereader = __commonJS({ + "node_modules/undici/lib/fileapi/filereader.js"(exports, module) { + "use strict"; + var { + staticPropertyDescriptors, + readOperation, + fireAProgressEvent + } = require_util4(); + var { + kState, + kError, + kResult, + kEvents, + kAborted + } = require_symbols3(); + var { webidl } = require_webidl(); + var { kEnumerableProperty } = require_util(); + var FileReader = class _FileReader extends EventTarget { + constructor() { + super(); + this[kState] = "empty"; + this[kResult] = null; + this[kError] = null; + this[kEvents] = { + loadend: null, + error: null, + abort: null, + load: null, + progress: null, + loadstart: null + }; } - constructor(comp26, options) { - options = parseOptions(options); - if (comp26 instanceof _Comparator) { - if (comp26.loose === !!options.loose) { - return comp26; - } else { - comp26 = comp26.value; - } + /** + * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer + * @param {import('buffer').Blob} blob + */ + readAsArrayBuffer(blob) { + webidl.brandCheck(this, _FileReader); + webidl.argumentLengthCheck(arguments, 1, { header: "FileReader.readAsArrayBuffer" }); + blob = webidl.converters.Blob(blob, { strict: false }); + readOperation(this, blob, "ArrayBuffer"); + } + /** + * @see https://w3c.github.io/FileAPI/#readAsBinaryString + * @param {import('buffer').Blob} blob + */ + readAsBinaryString(blob) { + webidl.brandCheck(this, _FileReader); + webidl.argumentLengthCheck(arguments, 1, { header: "FileReader.readAsBinaryString" }); + blob = webidl.converters.Blob(blob, { strict: false }); + readOperation(this, blob, "BinaryString"); + } + /** + * @see https://w3c.github.io/FileAPI/#readAsDataText + * @param {import('buffer').Blob} blob + * @param {string?} encoding + */ + readAsText(blob, encoding = void 0) { + webidl.brandCheck(this, _FileReader); + webidl.argumentLengthCheck(arguments, 1, { header: "FileReader.readAsText" }); + blob = webidl.converters.Blob(blob, { strict: false }); + if (encoding !== void 0) { + encoding = webidl.converters.DOMString(encoding); } - comp26 = comp26.trim().split(/\s+/).join(" "); - debug3("comparator", comp26, options); - this.options = options; - this.loose = !!options.loose; - this.parse(comp26); - if (this.semver === ANY) { - this.value = ""; - } else { - this.value = this.operator + this.semver.version; + readOperation(this, blob, "Text", encoding); + } + /** + * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL + * @param {import('buffer').Blob} blob + */ + readAsDataURL(blob) { + webidl.brandCheck(this, _FileReader); + webidl.argumentLengthCheck(arguments, 1, { header: "FileReader.readAsDataURL" }); + blob = webidl.converters.Blob(blob, { strict: false }); + readOperation(this, blob, "DataURL"); + } + /** + * @see https://w3c.github.io/FileAPI/#dfn-abort + */ + abort() { + if (this[kState] === "empty" || this[kState] === "done") { + this[kResult] = null; + return; + } + if (this[kState] === "loading") { + this[kState] = "done"; + this[kResult] = null; + } + this[kAborted] = true; + fireAProgressEvent("abort", this); + if (this[kState] !== "loading") { + fireAProgressEvent("loadend", this); } - debug3("comp", this); } - parse(comp26) { - const r2 = this.options.loose ? re3[t2.COMPARATORLOOSE] : re3[t2.COMPARATOR]; - const m3 = comp26.match(r2); - if (!m3) { - throw new TypeError(`Invalid comparator: ${comp26}`); + /** + * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate + */ + get readyState() { + webidl.brandCheck(this, _FileReader); + switch (this[kState]) { + case "empty": + return this.EMPTY; + case "loading": + return this.LOADING; + case "done": + return this.DONE; } - this.operator = m3[1] !== void 0 ? m3[1] : ""; - if (this.operator === "=") { - this.operator = ""; + } + /** + * @see https://w3c.github.io/FileAPI/#dom-filereader-result + */ + get result() { + webidl.brandCheck(this, _FileReader); + return this[kResult]; + } + /** + * @see https://w3c.github.io/FileAPI/#dom-filereader-error + */ + get error() { + webidl.brandCheck(this, _FileReader); + return this[kError]; + } + get onloadend() { + webidl.brandCheck(this, _FileReader); + return this[kEvents].loadend; + } + set onloadend(fn2) { + webidl.brandCheck(this, _FileReader); + if (this[kEvents].loadend) { + this.removeEventListener("loadend", this[kEvents].loadend); } - if (!m3[2]) { - this.semver = ANY; + if (typeof fn2 === "function") { + this[kEvents].loadend = fn2; + this.addEventListener("loadend", fn2); } else { - this.semver = new SemVer(m3[2], this.options.loose); + this[kEvents].loadend = null; } } - toString() { - return this.value; + get onerror() { + webidl.brandCheck(this, _FileReader); + return this[kEvents].error; } - test(version4) { - debug3("Comparator.test", version4, this.options.loose); - if (this.semver === ANY || version4 === ANY) { - return true; + set onerror(fn2) { + webidl.brandCheck(this, _FileReader); + if (this[kEvents].error) { + this.removeEventListener("error", this[kEvents].error); } - if (typeof version4 === "string") { - try { - version4 = new SemVer(version4, this.options); - } catch (er2) { - return false; - } + if (typeof fn2 === "function") { + this[kEvents].error = fn2; + this.addEventListener("error", fn2); + } else { + this[kEvents].error = null; } - return cmp(version4, this.operator, this.semver, this.options); } - intersects(comp26, options) { - if (!(comp26 instanceof _Comparator)) { - throw new TypeError("a Comparator is required"); - } - if (this.operator === "") { - if (this.value === "") { - return true; - } - return new Range3(comp26.value, options).test(this.value); - } else if (comp26.operator === "") { - if (comp26.value === "") { - return true; - } - return new Range3(this.value, options).test(comp26.semver); - } - options = parseOptions(options); - if (options.includePrerelease && (this.value === "<0.0.0-0" || comp26.value === "<0.0.0-0")) { - return false; + get onloadstart() { + webidl.brandCheck(this, _FileReader); + return this[kEvents].loadstart; + } + set onloadstart(fn2) { + webidl.brandCheck(this, _FileReader); + if (this[kEvents].loadstart) { + this.removeEventListener("loadstart", this[kEvents].loadstart); } - if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp26.value.startsWith("<0.0.0"))) { - return false; + if (typeof fn2 === "function") { + this[kEvents].loadstart = fn2; + this.addEventListener("loadstart", fn2); + } else { + this[kEvents].loadstart = null; } - if (this.operator.startsWith(">") && comp26.operator.startsWith(">")) { - return true; + } + get onprogress() { + webidl.brandCheck(this, _FileReader); + return this[kEvents].progress; + } + set onprogress(fn2) { + webidl.brandCheck(this, _FileReader); + if (this[kEvents].progress) { + this.removeEventListener("progress", this[kEvents].progress); } - if (this.operator.startsWith("<") && comp26.operator.startsWith("<")) { - return true; + if (typeof fn2 === "function") { + this[kEvents].progress = fn2; + this.addEventListener("progress", fn2); + } else { + this[kEvents].progress = null; } - if (this.semver.version === comp26.semver.version && this.operator.includes("=") && comp26.operator.includes("=")) { - return true; + } + get onload() { + webidl.brandCheck(this, _FileReader); + return this[kEvents].load; + } + set onload(fn2) { + webidl.brandCheck(this, _FileReader); + if (this[kEvents].load) { + this.removeEventListener("load", this[kEvents].load); } - if (cmp(this.semver, "<", comp26.semver, options) && this.operator.startsWith(">") && comp26.operator.startsWith("<")) { - return true; + if (typeof fn2 === "function") { + this[kEvents].load = fn2; + this.addEventListener("load", fn2); + } else { + this[kEvents].load = null; } - if (cmp(this.semver, ">", comp26.semver, options) && this.operator.startsWith("<") && comp26.operator.startsWith(">")) { - return true; + } + get onabort() { + webidl.brandCheck(this, _FileReader); + return this[kEvents].abort; + } + set onabort(fn2) { + webidl.brandCheck(this, _FileReader); + if (this[kEvents].abort) { + this.removeEventListener("abort", this[kEvents].abort); } - return false; + if (typeof fn2 === "function") { + this[kEvents].abort = fn2; + this.addEventListener("abort", fn2); + } else { + this[kEvents].abort = null; + } + } + }; + FileReader.EMPTY = FileReader.prototype.EMPTY = 0; + FileReader.LOADING = FileReader.prototype.LOADING = 1; + FileReader.DONE = FileReader.prototype.DONE = 2; + Object.defineProperties(FileReader.prototype, { + EMPTY: staticPropertyDescriptors, + LOADING: staticPropertyDescriptors, + DONE: staticPropertyDescriptors, + readAsArrayBuffer: kEnumerableProperty, + readAsBinaryString: kEnumerableProperty, + readAsText: kEnumerableProperty, + readAsDataURL: kEnumerableProperty, + abort: kEnumerableProperty, + readyState: kEnumerableProperty, + result: kEnumerableProperty, + error: kEnumerableProperty, + onloadstart: kEnumerableProperty, + onprogress: kEnumerableProperty, + onload: kEnumerableProperty, + onabort: kEnumerableProperty, + onerror: kEnumerableProperty, + onloadend: kEnumerableProperty, + [Symbol.toStringTag]: { + value: "FileReader", + writable: false, + enumerable: false, + configurable: true } + }); + Object.defineProperties(FileReader, { + EMPTY: staticPropertyDescriptors, + LOADING: staticPropertyDescriptors, + DONE: staticPropertyDescriptors + }); + module.exports = { + FileReader }; - module.exports = Comparator; - var parseOptions = require_parse_options(); - var { safeRe: re3, t: t2 } = require_re(); - var cmp = require_cmp(); - var debug3 = require_debug(); - var SemVer = require_semver(); - var Range3 = require_range(); } }); -// node_modules/semver/functions/satisfies.js -var require_satisfies = __commonJS({ - "node_modules/semver/functions/satisfies.js"(exports, module) { - var Range3 = require_range(); - var satisfies = (version4, range2, options) => { - try { - range2 = new Range3(range2, options); - } catch (er2) { - return false; - } - return range2.test(version4); +// node_modules/undici/lib/cache/symbols.js +var require_symbols4 = __commonJS({ + "node_modules/undici/lib/cache/symbols.js"(exports, module) { + "use strict"; + module.exports = { + kConstruct: Symbol("constructable") }; - module.exports = satisfies; } }); -// node_modules/semver/ranges/to-comparators.js -var require_to_comparators = __commonJS({ - "node_modules/semver/ranges/to-comparators.js"(exports, module) { - var Range3 = require_range(); - var toComparators = (range2, options) => new Range3(range2, options).set.map((comp26) => comp26.map((c2) => c2.value).join(" ").trim().split(" ")); - module.exports = toComparators; +// node_modules/undici/lib/cache/util.js +var require_util5 = __commonJS({ + "node_modules/undici/lib/cache/util.js"(exports, module) { + "use strict"; + var assert = __require("assert"); + var { URLSerializer } = require_dataURL(); + var { isValidHeaderName } = require_util2(); + function urlEquals(A2, B2, excludeFragment = false) { + const serializedA = URLSerializer(A2, excludeFragment); + const serializedB = URLSerializer(B2, excludeFragment); + return serializedA === serializedB; + } + function fieldValues(header) { + assert(header !== null); + const values = []; + for (let value of header.split(",")) { + value = value.trim(); + if (!value.length) { + continue; + } else if (!isValidHeaderName(value)) { + continue; + } + values.push(value); + } + return values; + } + module.exports = { + urlEquals, + fieldValues + }; } }); -// node_modules/semver/ranges/max-satisfying.js -var require_max_satisfying = __commonJS({ - "node_modules/semver/ranges/max-satisfying.js"(exports, module) { - var SemVer = require_semver(); - var Range3 = require_range(); - var maxSatisfying = (versions, range2, options) => { - let max = null; - let maxSV = null; - let rangeObj = null; - try { - rangeObj = new Range3(range2, options); - } catch (er2) { - return null; +// node_modules/undici/lib/cache/cache.js +var require_cache = __commonJS({ + "node_modules/undici/lib/cache/cache.js"(exports, module) { + "use strict"; + var { kConstruct } = require_symbols4(); + var { urlEquals, fieldValues: getFieldValues } = require_util5(); + var { kEnumerableProperty, isDisturbed } = require_util(); + var { kHeadersList } = require_symbols(); + var { webidl } = require_webidl(); + var { Response: Response2, cloneResponse } = require_response(); + var { Request: Request2 } = require_request2(); + var { kState, kHeaders, kGuard, kRealm } = require_symbols2(); + var { fetching } = require_fetch(); + var { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require_util2(); + var assert = __require("assert"); + var { getGlobalDispatcher } = require_global3(); + var Cache = class _Cache { + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list + * @type {requestResponseList} + */ + #relevantRequestResponseList; + constructor() { + if (arguments[0] !== kConstruct) { + webidl.illegalConstructor(); + } + this.#relevantRequestResponseList = arguments[1]; + } + async match(request, options = {}) { + webidl.brandCheck(this, _Cache); + webidl.argumentLengthCheck(arguments, 1, { header: "Cache.match" }); + request = webidl.converters.RequestInfo(request); + options = webidl.converters.CacheQueryOptions(options); + const p2 = await this.matchAll(request, options); + if (p2.length === 0) { + return; + } + return p2[0]; } - versions.forEach((v2) => { - if (rangeObj.test(v2)) { - if (!max || maxSV.compare(v2) === -1) { - max = v2; - maxSV = new SemVer(max, options); + async matchAll(request = void 0, options = {}) { + webidl.brandCheck(this, _Cache); + if (request !== void 0) + request = webidl.converters.RequestInfo(request); + options = webidl.converters.CacheQueryOptions(options); + let r2 = null; + if (request !== void 0) { + if (request instanceof Request2) { + r2 = request[kState]; + if (r2.method !== "GET" && !options.ignoreMethod) { + return []; + } + } else if (typeof request === "string") { + r2 = new Request2(request)[kState]; } } - }); - return max; - }; - module.exports = maxSatisfying; - } -}); - -// node_modules/semver/ranges/min-satisfying.js -var require_min_satisfying = __commonJS({ - "node_modules/semver/ranges/min-satisfying.js"(exports, module) { - var SemVer = require_semver(); - var Range3 = require_range(); - var minSatisfying = (versions, range2, options) => { - let min = null; - let minSV = null; - let rangeObj = null; - try { - rangeObj = new Range3(range2, options); - } catch (er2) { - return null; + const responses = []; + if (request === void 0) { + for (const requestResponse of this.#relevantRequestResponseList) { + responses.push(requestResponse[1]); + } + } else { + const requestResponses = this.#queryCache(r2, options); + for (const requestResponse of requestResponses) { + responses.push(requestResponse[1]); + } + } + const responseList = []; + for (const response of responses) { + const responseObject = new Response2(response.body?.source ?? null); + const body2 = responseObject[kState].body; + responseObject[kState] = response; + responseObject[kState].body = body2; + responseObject[kHeaders][kHeadersList] = response.headersList; + responseObject[kHeaders][kGuard] = "immutable"; + responseList.push(responseObject); + } + return Object.freeze(responseList); + } + async add(request) { + webidl.brandCheck(this, _Cache); + webidl.argumentLengthCheck(arguments, 1, { header: "Cache.add" }); + request = webidl.converters.RequestInfo(request); + const requests = [request]; + const responseArrayPromise = this.addAll(requests); + return await responseArrayPromise; + } + async addAll(requests) { + webidl.brandCheck(this, _Cache); + webidl.argumentLengthCheck(arguments, 1, { header: "Cache.addAll" }); + requests = webidl.converters["sequence"](requests); + const responsePromises = []; + const requestList = []; + for (const request of requests) { + if (typeof request === "string") { + continue; + } + const r2 = request[kState]; + if (!urlIsHttpHttpsScheme(r2.url) || r2.method !== "GET") { + throw webidl.errors.exception({ + header: "Cache.addAll", + message: "Expected http/s scheme when method is not GET." + }); + } + } + const fetchControllers = []; + for (const request of requests) { + const r2 = new Request2(request)[kState]; + if (!urlIsHttpHttpsScheme(r2.url)) { + throw webidl.errors.exception({ + header: "Cache.addAll", + message: "Expected http/s scheme." + }); + } + r2.initiator = "fetch"; + r2.destination = "subresource"; + requestList.push(r2); + const responsePromise = createDeferredPromise(); + fetchControllers.push(fetching({ + request: r2, + dispatcher: getGlobalDispatcher(), + processResponse(response) { + if (response.type === "error" || response.status === 206 || response.status < 200 || response.status > 299) { + responsePromise.reject(webidl.errors.exception({ + header: "Cache.addAll", + message: "Received an invalid status code or the request failed." + })); + } else if (response.headersList.contains("vary")) { + const fieldValues = getFieldValues(response.headersList.get("vary")); + for (const fieldValue of fieldValues) { + if (fieldValue === "*") { + responsePromise.reject(webidl.errors.exception({ + header: "Cache.addAll", + message: "invalid vary field value" + })); + for (const controller of fetchControllers) { + controller.abort(); + } + return; + } + } + } + }, + processResponseEndOfBody(response) { + if (response.aborted) { + responsePromise.reject(new DOMException("aborted", "AbortError")); + return; + } + responsePromise.resolve(response); + } + })); + responsePromises.push(responsePromise.promise); + } + const p2 = Promise.all(responsePromises); + const responses = await p2; + const operations = []; + let index = 0; + for (const response of responses) { + const operation = { + type: "put", + // 7.3.2 + request: requestList[index], + // 7.3.3 + response + // 7.3.4 + }; + operations.push(operation); + index++; + } + const cacheJobPromise = createDeferredPromise(); + let errorData = null; + try { + this.#batchCacheOperations(operations); + } catch (e2) { + errorData = e2; + } + queueMicrotask(() => { + if (errorData === null) { + cacheJobPromise.resolve(void 0); + } else { + cacheJobPromise.reject(errorData); + } + }); + return cacheJobPromise.promise; + } + async put(request, response) { + webidl.brandCheck(this, _Cache); + webidl.argumentLengthCheck(arguments, 2, { header: "Cache.put" }); + request = webidl.converters.RequestInfo(request); + response = webidl.converters.Response(response); + let innerRequest = null; + if (request instanceof Request2) { + innerRequest = request[kState]; + } else { + innerRequest = new Request2(request)[kState]; + } + if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== "GET") { + throw webidl.errors.exception({ + header: "Cache.put", + message: "Expected an http/s scheme when method is not GET" + }); + } + const innerResponse = response[kState]; + if (innerResponse.status === 206) { + throw webidl.errors.exception({ + header: "Cache.put", + message: "Got 206 status" + }); + } + if (innerResponse.headersList.contains("vary")) { + const fieldValues = getFieldValues(innerResponse.headersList.get("vary")); + for (const fieldValue of fieldValues) { + if (fieldValue === "*") { + throw webidl.errors.exception({ + header: "Cache.put", + message: "Got * vary field value" + }); + } + } + } + if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) { + throw webidl.errors.exception({ + header: "Cache.put", + message: "Response body is locked or disturbed" + }); + } + const clonedResponse = cloneResponse(innerResponse); + const bodyReadPromise = createDeferredPromise(); + if (innerResponse.body != null) { + const stream = innerResponse.body.stream; + const reader = stream.getReader(); + readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject); + } else { + bodyReadPromise.resolve(void 0); + } + const operations = []; + const operation = { + type: "put", + // 14. + request: innerRequest, + // 15. + response: clonedResponse + // 16. + }; + operations.push(operation); + const bytes = await bodyReadPromise.promise; + if (clonedResponse.body != null) { + clonedResponse.body.source = bytes; + } + const cacheJobPromise = createDeferredPromise(); + let errorData = null; + try { + this.#batchCacheOperations(operations); + } catch (e2) { + errorData = e2; + } + queueMicrotask(() => { + if (errorData === null) { + cacheJobPromise.resolve(); + } else { + cacheJobPromise.reject(errorData); + } + }); + return cacheJobPromise.promise; + } + async delete(request, options = {}) { + webidl.brandCheck(this, _Cache); + webidl.argumentLengthCheck(arguments, 1, { header: "Cache.delete" }); + request = webidl.converters.RequestInfo(request); + options = webidl.converters.CacheQueryOptions(options); + let r2 = null; + if (request instanceof Request2) { + r2 = request[kState]; + if (r2.method !== "GET" && !options.ignoreMethod) { + return false; + } + } else { + assert(typeof request === "string"); + r2 = new Request2(request)[kState]; + } + const operations = []; + const operation = { + type: "delete", + request: r2, + options + }; + operations.push(operation); + const cacheJobPromise = createDeferredPromise(); + let errorData = null; + let requestResponses; + try { + requestResponses = this.#batchCacheOperations(operations); + } catch (e2) { + errorData = e2; + } + queueMicrotask(() => { + if (errorData === null) { + cacheJobPromise.resolve(!!requestResponses?.length); + } else { + cacheJobPromise.reject(errorData); + } + }); + return cacheJobPromise.promise; } - versions.forEach((v2) => { - if (rangeObj.test(v2)) { - if (!min || minSV.compare(v2) === 1) { - min = v2; - minSV = new SemVer(min, options); + /** + * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys + * @param {any} request + * @param {import('../../types/cache').CacheQueryOptions} options + * @returns {readonly Request[]} + */ + async keys(request = void 0, options = {}) { + webidl.brandCheck(this, _Cache); + if (request !== void 0) + request = webidl.converters.RequestInfo(request); + options = webidl.converters.CacheQueryOptions(options); + let r2 = null; + if (request !== void 0) { + if (request instanceof Request2) { + r2 = request[kState]; + if (r2.method !== "GET" && !options.ignoreMethod) { + return []; + } + } else if (typeof request === "string") { + r2 = new Request2(request)[kState]; } } - }); - return min; + const promise = createDeferredPromise(); + const requests = []; + if (request === void 0) { + for (const requestResponse of this.#relevantRequestResponseList) { + requests.push(requestResponse[0]); + } + } else { + const requestResponses = this.#queryCache(r2, options); + for (const requestResponse of requestResponses) { + requests.push(requestResponse[0]); + } + } + queueMicrotask(() => { + const requestList = []; + for (const request2 of requests) { + const requestObject = new Request2("https://a"); + requestObject[kState] = request2; + requestObject[kHeaders][kHeadersList] = request2.headersList; + requestObject[kHeaders][kGuard] = "immutable"; + requestObject[kRealm] = request2.client; + requestList.push(requestObject); + } + promise.resolve(Object.freeze(requestList)); + }); + return promise.promise; + } + /** + * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm + * @param {CacheBatchOperation[]} operations + * @returns {requestResponseList} + */ + #batchCacheOperations(operations) { + const cache = this.#relevantRequestResponseList; + const backupCache = [...cache]; + const addedItems = []; + const resultList = []; + try { + for (const operation of operations) { + if (operation.type !== "delete" && operation.type !== "put") { + throw webidl.errors.exception({ + header: "Cache.#batchCacheOperations", + message: 'operation type does not match "delete" or "put"' + }); + } + if (operation.type === "delete" && operation.response != null) { + throw webidl.errors.exception({ + header: "Cache.#batchCacheOperations", + message: "delete operation should not have an associated response" + }); + } + if (this.#queryCache(operation.request, operation.options, addedItems).length) { + throw new DOMException("???", "InvalidStateError"); + } + let requestResponses; + if (operation.type === "delete") { + requestResponses = this.#queryCache(operation.request, operation.options); + if (requestResponses.length === 0) { + return []; + } + for (const requestResponse of requestResponses) { + const idx = cache.indexOf(requestResponse); + assert(idx !== -1); + cache.splice(idx, 1); + } + } else if (operation.type === "put") { + if (operation.response == null) { + throw webidl.errors.exception({ + header: "Cache.#batchCacheOperations", + message: "put operation should have an associated response" + }); + } + const r2 = operation.request; + if (!urlIsHttpHttpsScheme(r2.url)) { + throw webidl.errors.exception({ + header: "Cache.#batchCacheOperations", + message: "expected http or https scheme" + }); + } + if (r2.method !== "GET") { + throw webidl.errors.exception({ + header: "Cache.#batchCacheOperations", + message: "not get method" + }); + } + if (operation.options != null) { + throw webidl.errors.exception({ + header: "Cache.#batchCacheOperations", + message: "options must not be defined" + }); + } + requestResponses = this.#queryCache(operation.request); + for (const requestResponse of requestResponses) { + const idx = cache.indexOf(requestResponse); + assert(idx !== -1); + cache.splice(idx, 1); + } + cache.push([operation.request, operation.response]); + addedItems.push([operation.request, operation.response]); + } + resultList.push([operation.request, operation.response]); + } + return resultList; + } catch (e2) { + this.#relevantRequestResponseList.length = 0; + this.#relevantRequestResponseList = backupCache; + throw e2; + } + } + /** + * @see https://w3c.github.io/ServiceWorker/#query-cache + * @param {any} requestQuery + * @param {import('../../types/cache').CacheQueryOptions} options + * @param {requestResponseList} targetStorage + * @returns {requestResponseList} + */ + #queryCache(requestQuery, options, targetStorage) { + const resultList = []; + const storage = targetStorage ?? this.#relevantRequestResponseList; + for (const requestResponse of storage) { + const [cachedRequest, cachedResponse] = requestResponse; + if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) { + resultList.push(requestResponse); + } + } + return resultList; + } + /** + * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm + * @param {any} requestQuery + * @param {any} request + * @param {any | null} response + * @param {import('../../types/cache').CacheQueryOptions | undefined} options + * @returns {boolean} + */ + #requestMatchesCachedItem(requestQuery, request, response = null, options) { + const queryURL = new URL(requestQuery.url); + const cachedURL = new URL(request.url); + if (options?.ignoreSearch) { + cachedURL.search = ""; + queryURL.search = ""; + } + if (!urlEquals(queryURL, cachedURL, true)) { + return false; + } + if (response == null || options?.ignoreVary || !response.headersList.contains("vary")) { + return true; + } + const fieldValues = getFieldValues(response.headersList.get("vary")); + for (const fieldValue of fieldValues) { + if (fieldValue === "*") { + return false; + } + const requestValue = request.headersList.get(fieldValue); + const queryValue = requestQuery.headersList.get(fieldValue); + if (requestValue !== queryValue) { + return false; + } + } + return true; + } + }; + Object.defineProperties(Cache.prototype, { + [Symbol.toStringTag]: { + value: "Cache", + configurable: true + }, + match: kEnumerableProperty, + matchAll: kEnumerableProperty, + add: kEnumerableProperty, + addAll: kEnumerableProperty, + put: kEnumerableProperty, + delete: kEnumerableProperty, + keys: kEnumerableProperty + }); + var cacheQueryOptionConverters = [ + { + key: "ignoreSearch", + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: "ignoreMethod", + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: "ignoreVary", + converter: webidl.converters.boolean, + defaultValue: false + } + ]; + webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters); + webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([ + ...cacheQueryOptionConverters, + { + key: "cacheName", + converter: webidl.converters.DOMString + } + ]); + webidl.converters.Response = webidl.interfaceConverter(Response2); + webidl.converters["sequence"] = webidl.sequenceConverter( + webidl.converters.RequestInfo + ); + module.exports = { + Cache }; - module.exports = minSatisfying; } }); -// node_modules/semver/ranges/min-version.js -var require_min_version = __commonJS({ - "node_modules/semver/ranges/min-version.js"(exports, module) { - var SemVer = require_semver(); - var Range3 = require_range(); - var gt2 = require_gt(); - var minVersion = (range2, loose) => { - range2 = new Range3(range2, loose); - let minver = new SemVer("0.0.0"); - if (range2.test(minver)) { - return minver; - } - minver = new SemVer("0.0.0-0"); - if (range2.test(minver)) { - return minver; +// node_modules/undici/lib/cache/cachestorage.js +var require_cachestorage = __commonJS({ + "node_modules/undici/lib/cache/cachestorage.js"(exports, module) { + "use strict"; + var { kConstruct } = require_symbols4(); + var { Cache } = require_cache(); + var { webidl } = require_webidl(); + var { kEnumerableProperty } = require_util(); + var CacheStorage = class _CacheStorage { + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map + * @type {Map { - const compver = new SemVer(comparator.semver.version); - switch (comparator.operator) { - case ">": - if (compver.prerelease.length === 0) { - compver.patch++; - } else { - compver.prerelease.push(0); - } - compver.raw = compver.format(); - case "": - case ">=": - if (!setMin || gt2(compver, setMin)) { - setMin = compver; - } - break; - case "<": - case "<=": - break; - default: - throw new Error(`Unexpected operation: ${comparator.operator}`); + async match(request, options = {}) { + webidl.brandCheck(this, _CacheStorage); + webidl.argumentLengthCheck(arguments, 1, { header: "CacheStorage.match" }); + request = webidl.converters.RequestInfo(request); + options = webidl.converters.MultiCacheQueryOptions(options); + if (options.cacheName != null) { + if (this.#caches.has(options.cacheName)) { + const cacheList = this.#caches.get(options.cacheName); + const cache = new Cache(kConstruct, cacheList); + return await cache.match(request, options); + } + } else { + for (const cacheList of this.#caches.values()) { + const cache = new Cache(kConstruct, cacheList); + const response = await cache.match(request, options); + if (response !== void 0) { + return response; + } } - }); - if (setMin && (!minver || gt2(minver, setMin))) { - minver = setMin; } } - if (minver && range2.test(minver)) { - return minver; + /** + * @see https://w3c.github.io/ServiceWorker/#cache-storage-has + * @param {string} cacheName + * @returns {Promise} + */ + async has(cacheName) { + webidl.brandCheck(this, _CacheStorage); + webidl.argumentLengthCheck(arguments, 1, { header: "CacheStorage.has" }); + cacheName = webidl.converters.DOMString(cacheName); + return this.#caches.has(cacheName); + } + /** + * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open + * @param {string} cacheName + * @returns {Promise} + */ + async open(cacheName) { + webidl.brandCheck(this, _CacheStorage); + webidl.argumentLengthCheck(arguments, 1, { header: "CacheStorage.open" }); + cacheName = webidl.converters.DOMString(cacheName); + if (this.#caches.has(cacheName)) { + const cache2 = this.#caches.get(cacheName); + return new Cache(kConstruct, cache2); + } + const cache = []; + this.#caches.set(cacheName, cache); + return new Cache(kConstruct, cache); + } + /** + * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete + * @param {string} cacheName + * @returns {Promise} + */ + async delete(cacheName) { + webidl.brandCheck(this, _CacheStorage); + webidl.argumentLengthCheck(arguments, 1, { header: "CacheStorage.delete" }); + cacheName = webidl.converters.DOMString(cacheName); + return this.#caches.delete(cacheName); + } + /** + * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys + * @returns {string[]} + */ + async keys() { + webidl.brandCheck(this, _CacheStorage); + const keys = this.#caches.keys(); + return [...keys]; } - return null; }; - module.exports = minVersion; + Object.defineProperties(CacheStorage.prototype, { + [Symbol.toStringTag]: { + value: "CacheStorage", + configurable: true + }, + match: kEnumerableProperty, + has: kEnumerableProperty, + open: kEnumerableProperty, + delete: kEnumerableProperty, + keys: kEnumerableProperty + }); + module.exports = { + CacheStorage + }; } }); -// node_modules/semver/ranges/valid.js -var require_valid2 = __commonJS({ - "node_modules/semver/ranges/valid.js"(exports, module) { - var Range3 = require_range(); - var validRange = (range2, options) => { - try { - return new Range3(range2, options).range || "*"; - } catch (er2) { - return null; - } +// node_modules/undici/lib/cookies/constants.js +var require_constants3 = __commonJS({ + "node_modules/undici/lib/cookies/constants.js"(exports, module) { + "use strict"; + var maxAttributeValueSize = 1024; + var maxNameValuePairSize = 4096; + module.exports = { + maxAttributeValueSize, + maxNameValuePairSize }; - module.exports = validRange; } }); -// node_modules/semver/ranges/outside.js -var require_outside = __commonJS({ - "node_modules/semver/ranges/outside.js"(exports, module) { - var SemVer = require_semver(); - var Comparator = require_comparator(); - var { ANY } = Comparator; - var Range3 = require_range(); - var satisfies = require_satisfies(); - var gt2 = require_gt(); - var lt2 = require_lt(); - var lte = require_lte(); - var gte = require_gte(); - var outside = (version4, range2, hilo, options) => { - version4 = new SemVer(version4, options); - range2 = new Range3(range2, options); - let gtfn, ltefn, ltfn, comp26, ecomp; - switch (hilo) { - case ">": - gtfn = gt2; - ltefn = lte; - ltfn = lt2; - comp26 = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt2; - ltefn = gte; - ltfn = gt2; - comp26 = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } - if (satisfies(version4, range2, options)) { +// node_modules/undici/lib/cookies/util.js +var require_util6 = __commonJS({ + "node_modules/undici/lib/cookies/util.js"(exports, module) { + "use strict"; + var assert = __require("assert"); + var { kHeadersList } = require_symbols(); + function isCTLExcludingHtab(value) { + if (value.length === 0) { return false; } - for (let i2 = 0; i2 < range2.set.length; ++i2) { - const comparators = range2.set[i2]; - let high = null; - let low = null; - comparators.forEach((comparator) => { - if (comparator.semver === ANY) { - comparator = new Comparator(">=0.0.0"); - } - high = high || comparator; - low = low || comparator; - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator; - } - }); - if (high.operator === comp26 || high.operator === ecomp) { + for (const char of value) { + const code = char.charCodeAt(0); + if (code >= 0 || code <= 8 || (code >= 10 || code <= 31) || code === 127) { return false; } - if ((!low.operator || low.operator === comp26) && ltefn(version4, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version4, low.semver)) { - return false; + } + } + function validateCookieName(name2) { + for (const char of name2) { + const code = char.charCodeAt(0); + if (code <= 32 || code > 127 || char === "(" || char === ")" || char === ">" || char === "<" || char === "@" || char === "," || char === ";" || char === ":" || char === "\\" || char === '"' || char === "/" || char === "[" || char === "]" || char === "?" || char === "=" || char === "{" || char === "}") { + throw new Error("Invalid cookie name"); } } - return true; + } + function validateCookieValue(value) { + for (const char of value) { + const code = char.charCodeAt(0); + if (code < 33 || // exclude CTLs (0-31) + code === 34 || code === 44 || code === 59 || code === 92 || code > 126) { + throw new Error("Invalid header value"); + } + } + } + function validateCookiePath(path14) { + for (const char of path14) { + const code = char.charCodeAt(0); + if (code < 33 || char === ";") { + throw new Error("Invalid cookie path"); + } + } + } + function validateCookieDomain(domain) { + if (domain.startsWith("-") || domain.endsWith(".") || domain.endsWith("-")) { + throw new Error("Invalid cookie domain"); + } + } + function toIMFDate(date) { + if (typeof date === "number") { + date = new Date(date); + } + const days = [ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat" + ]; + const months = [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" + ]; + const dayName = days[date.getUTCDay()]; + const day = date.getUTCDate().toString().padStart(2, "0"); + const month = months[date.getUTCMonth()]; + const year = date.getUTCFullYear(); + const hour = date.getUTCHours().toString().padStart(2, "0"); + const minute = date.getUTCMinutes().toString().padStart(2, "0"); + const second = date.getUTCSeconds().toString().padStart(2, "0"); + return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`; + } + function validateCookieMaxAge(maxAge) { + if (maxAge < 0) { + throw new Error("Invalid cookie max-age"); + } + } + function stringify3(cookie) { + if (cookie.name.length === 0) { + return null; + } + validateCookieName(cookie.name); + validateCookieValue(cookie.value); + const out = [`${cookie.name}=${cookie.value}`]; + if (cookie.name.startsWith("__Secure-")) { + cookie.secure = true; + } + if (cookie.name.startsWith("__Host-")) { + cookie.secure = true; + cookie.domain = null; + cookie.path = "/"; + } + if (cookie.secure) { + out.push("Secure"); + } + if (cookie.httpOnly) { + out.push("HttpOnly"); + } + if (typeof cookie.maxAge === "number") { + validateCookieMaxAge(cookie.maxAge); + out.push(`Max-Age=${cookie.maxAge}`); + } + if (cookie.domain) { + validateCookieDomain(cookie.domain); + out.push(`Domain=${cookie.domain}`); + } + if (cookie.path) { + validateCookiePath(cookie.path); + out.push(`Path=${cookie.path}`); + } + if (cookie.expires && cookie.expires.toString() !== "Invalid Date") { + out.push(`Expires=${toIMFDate(cookie.expires)}`); + } + if (cookie.sameSite) { + out.push(`SameSite=${cookie.sameSite}`); + } + for (const part of cookie.unparsed) { + if (!part.includes("=")) { + throw new Error("Invalid unparsed"); + } + const [key, ...value] = part.split("="); + out.push(`${key.trim()}=${value.join("=")}`); + } + return out.join("; "); + } + var kHeadersListNode; + function getHeadersList(headers) { + if (headers[kHeadersList]) { + return headers[kHeadersList]; + } + if (!kHeadersListNode) { + kHeadersListNode = Object.getOwnPropertySymbols(headers).find( + (symbol) => symbol.description === "headers list" + ); + assert(kHeadersListNode, "Headers cannot be parsed"); + } + const headersList = headers[kHeadersListNode]; + assert(headersList); + return headersList; + } + module.exports = { + isCTLExcludingHtab, + stringify: stringify3, + getHeadersList }; - module.exports = outside; } }); -// node_modules/semver/ranges/gtr.js -var require_gtr = __commonJS({ - "node_modules/semver/ranges/gtr.js"(exports, module) { - var outside = require_outside(); - var gtr = (version4, range2, options) => outside(version4, range2, ">", options); - module.exports = gtr; +// node_modules/undici/lib/cookies/parse.js +var require_parse = __commonJS({ + "node_modules/undici/lib/cookies/parse.js"(exports, module) { + "use strict"; + var { maxNameValuePairSize, maxAttributeValueSize } = require_constants3(); + var { isCTLExcludingHtab } = require_util6(); + var { collectASequenceOfCodePointsFast } = require_dataURL(); + var assert = __require("assert"); + function parseSetCookie(header) { + if (isCTLExcludingHtab(header)) { + return null; + } + let nameValuePair = ""; + let unparsedAttributes = ""; + let name2 = ""; + let value = ""; + if (header.includes(";")) { + const position = { position: 0 }; + nameValuePair = collectASequenceOfCodePointsFast(";", header, position); + unparsedAttributes = header.slice(position.position); + } else { + nameValuePair = header; + } + if (!nameValuePair.includes("=")) { + value = nameValuePair; + } else { + const position = { position: 0 }; + name2 = collectASequenceOfCodePointsFast( + "=", + nameValuePair, + position + ); + value = nameValuePair.slice(position.position + 1); + } + name2 = name2.trim(); + value = value.trim(); + if (name2.length + value.length > maxNameValuePairSize) { + return null; + } + return { + name: name2, + value, + ...parseUnparsedAttributes(unparsedAttributes) + }; + } + function parseUnparsedAttributes(unparsedAttributes, cookieAttributeList = {}) { + if (unparsedAttributes.length === 0) { + return cookieAttributeList; + } + assert(unparsedAttributes[0] === ";"); + unparsedAttributes = unparsedAttributes.slice(1); + let cookieAv = ""; + if (unparsedAttributes.includes(";")) { + cookieAv = collectASequenceOfCodePointsFast( + ";", + unparsedAttributes, + { position: 0 } + ); + unparsedAttributes = unparsedAttributes.slice(cookieAv.length); + } else { + cookieAv = unparsedAttributes; + unparsedAttributes = ""; + } + let attributeName = ""; + let attributeValue = ""; + if (cookieAv.includes("=")) { + const position = { position: 0 }; + attributeName = collectASequenceOfCodePointsFast( + "=", + cookieAv, + position + ); + attributeValue = cookieAv.slice(position.position + 1); + } else { + attributeName = cookieAv; + } + attributeName = attributeName.trim(); + attributeValue = attributeValue.trim(); + if (attributeValue.length > maxAttributeValueSize) { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); + } + const attributeNameLowercase = attributeName.toLowerCase(); + if (attributeNameLowercase === "expires") { + const expiryTime = new Date(attributeValue); + cookieAttributeList.expires = expiryTime; + } else if (attributeNameLowercase === "max-age") { + const charCode = attributeValue.charCodeAt(0); + if ((charCode < 48 || charCode > 57) && attributeValue[0] !== "-") { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); + } + if (!/^\d+$/.test(attributeValue)) { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); + } + const deltaSeconds = Number(attributeValue); + cookieAttributeList.maxAge = deltaSeconds; + } else if (attributeNameLowercase === "domain") { + let cookieDomain = attributeValue; + if (cookieDomain[0] === ".") { + cookieDomain = cookieDomain.slice(1); + } + cookieDomain = cookieDomain.toLowerCase(); + cookieAttributeList.domain = cookieDomain; + } else if (attributeNameLowercase === "path") { + let cookiePath = ""; + if (attributeValue.length === 0 || attributeValue[0] !== "/") { + cookiePath = "/"; + } else { + cookiePath = attributeValue; + } + cookieAttributeList.path = cookiePath; + } else if (attributeNameLowercase === "secure") { + cookieAttributeList.secure = true; + } else if (attributeNameLowercase === "httponly") { + cookieAttributeList.httpOnly = true; + } else if (attributeNameLowercase === "samesite") { + let enforcement = "Default"; + const attributeValueLowercase = attributeValue.toLowerCase(); + if (attributeValueLowercase.includes("none")) { + enforcement = "None"; + } + if (attributeValueLowercase.includes("strict")) { + enforcement = "Strict"; + } + if (attributeValueLowercase.includes("lax")) { + enforcement = "Lax"; + } + cookieAttributeList.sameSite = enforcement; + } else { + cookieAttributeList.unparsed ??= []; + cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`); + } + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); + } + module.exports = { + parseSetCookie, + parseUnparsedAttributes + }; } }); -// node_modules/semver/ranges/ltr.js -var require_ltr = __commonJS({ - "node_modules/semver/ranges/ltr.js"(exports, module) { - var outside = require_outside(); - var ltr = (version4, range2, options) => outside(version4, range2, "<", options); - module.exports = ltr; +// node_modules/undici/lib/cookies/index.js +var require_cookies = __commonJS({ + "node_modules/undici/lib/cookies/index.js"(exports, module) { + "use strict"; + var { parseSetCookie } = require_parse(); + var { stringify: stringify3, getHeadersList } = require_util6(); + var { webidl } = require_webidl(); + var { Headers: Headers2 } = require_headers(); + function getCookies(headers) { + webidl.argumentLengthCheck(arguments, 1, { header: "getCookies" }); + webidl.brandCheck(headers, Headers2, { strict: false }); + const cookie = headers.get("cookie"); + const out = {}; + if (!cookie) { + return out; + } + for (const piece of cookie.split(";")) { + const [name2, ...value] = piece.split("="); + out[name2.trim()] = value.join("="); + } + return out; + } + function deleteCookie(headers, name2, attributes) { + webidl.argumentLengthCheck(arguments, 2, { header: "deleteCookie" }); + webidl.brandCheck(headers, Headers2, { strict: false }); + name2 = webidl.converters.DOMString(name2); + attributes = webidl.converters.DeleteCookieAttributes(attributes); + setCookie(headers, { + name: name2, + value: "", + expires: /* @__PURE__ */ new Date(0), + ...attributes + }); + } + function getSetCookies(headers) { + webidl.argumentLengthCheck(arguments, 1, { header: "getSetCookies" }); + webidl.brandCheck(headers, Headers2, { strict: false }); + const cookies = getHeadersList(headers).cookies; + if (!cookies) { + return []; + } + return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair)); + } + function setCookie(headers, cookie) { + webidl.argumentLengthCheck(arguments, 2, { header: "setCookie" }); + webidl.brandCheck(headers, Headers2, { strict: false }); + cookie = webidl.converters.Cookie(cookie); + const str = stringify3(cookie); + if (str) { + headers.append("Set-Cookie", stringify3(cookie)); + } + } + webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([ + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: "path", + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: "domain", + defaultValue: null + } + ]); + webidl.converters.Cookie = webidl.dictionaryConverter([ + { + converter: webidl.converters.DOMString, + key: "name" + }, + { + converter: webidl.converters.DOMString, + key: "value" + }, + { + converter: webidl.nullableConverter((value) => { + if (typeof value === "number") { + return webidl.converters["unsigned long long"](value); + } + return new Date(value); + }), + key: "expires", + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters["long long"]), + key: "maxAge", + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: "domain", + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: "path", + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.boolean), + key: "secure", + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.boolean), + key: "httpOnly", + defaultValue: null + }, + { + converter: webidl.converters.USVString, + key: "sameSite", + allowedValues: ["Strict", "Lax", "None"] + }, + { + converter: webidl.sequenceConverter(webidl.converters.DOMString), + key: "unparsed", + defaultValue: [] + } + ]); + module.exports = { + getCookies, + deleteCookie, + getSetCookies, + setCookie + }; } }); -// node_modules/semver/ranges/intersects.js -var require_intersects = __commonJS({ - "node_modules/semver/ranges/intersects.js"(exports, module) { - var Range3 = require_range(); - var intersects = (r1, r2, options) => { - r1 = new Range3(r1, options); - r2 = new Range3(r2, options); - return r1.intersects(r2, options); +// node_modules/undici/lib/websocket/constants.js +var require_constants4 = __commonJS({ + "node_modules/undici/lib/websocket/constants.js"(exports, module) { + "use strict"; + var uid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; + var staticPropertyDescriptors = { + enumerable: true, + writable: false, + configurable: false + }; + var states = { + CONNECTING: 0, + OPEN: 1, + CLOSING: 2, + CLOSED: 3 + }; + var opcodes = { + CONTINUATION: 0, + TEXT: 1, + BINARY: 2, + CLOSE: 8, + PING: 9, + PONG: 10 + }; + var maxUnsigned16Bit = 2 ** 16 - 1; + var parserStates = { + INFO: 0, + PAYLOADLENGTH_16: 2, + PAYLOADLENGTH_64: 3, + READ_DATA: 4 + }; + var emptyBuffer = Buffer.allocUnsafe(0); + module.exports = { + uid, + staticPropertyDescriptors, + states, + opcodes, + maxUnsigned16Bit, + parserStates, + emptyBuffer }; - module.exports = intersects; } }); -// node_modules/semver/ranges/simplify.js -var require_simplify = __commonJS({ - "node_modules/semver/ranges/simplify.js"(exports, module) { - var satisfies = require_satisfies(); - var compare = require_compare(); - module.exports = (versions, range2, options) => { - const set2 = []; - let first = null; - let prev = null; - const v2 = versions.sort((a2, b2) => compare(a2, b2, options)); - for (const version4 of v2) { - const included = satisfies(version4, range2, options); - if (included) { - prev = version4; - if (!first) { - first = version4; - } +// node_modules/undici/lib/websocket/symbols.js +var require_symbols5 = __commonJS({ + "node_modules/undici/lib/websocket/symbols.js"(exports, module) { + "use strict"; + module.exports = { + kWebSocketURL: Symbol("url"), + kReadyState: Symbol("ready state"), + kController: Symbol("controller"), + kResponse: Symbol("response"), + kBinaryType: Symbol("binary type"), + kSentClose: Symbol("sent close"), + kReceivedClose: Symbol("received close"), + kByteParser: Symbol("byte parser") + }; + } +}); + +// node_modules/undici/lib/websocket/events.js +var require_events = __commonJS({ + "node_modules/undici/lib/websocket/events.js"(exports, module) { + "use strict"; + var { webidl } = require_webidl(); + var { kEnumerableProperty } = require_util(); + var { MessagePort } = __require("worker_threads"); + var MessageEvent = class _MessageEvent extends Event { + #eventInit; + constructor(type3, eventInitDict = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: "MessageEvent constructor" }); + type3 = webidl.converters.DOMString(type3); + eventInitDict = webidl.converters.MessageEventInit(eventInitDict); + super(type3, eventInitDict); + this.#eventInit = eventInitDict; + } + get data() { + webidl.brandCheck(this, _MessageEvent); + return this.#eventInit.data; + } + get origin() { + webidl.brandCheck(this, _MessageEvent); + return this.#eventInit.origin; + } + get lastEventId() { + webidl.brandCheck(this, _MessageEvent); + return this.#eventInit.lastEventId; + } + get source() { + webidl.brandCheck(this, _MessageEvent); + return this.#eventInit.source; + } + get ports() { + webidl.brandCheck(this, _MessageEvent); + if (!Object.isFrozen(this.#eventInit.ports)) { + Object.freeze(this.#eventInit.ports); + } + return this.#eventInit.ports; + } + initMessageEvent(type3, bubbles = false, cancelable = false, data = null, origin = "", lastEventId = "", source = null, ports = []) { + webidl.brandCheck(this, _MessageEvent); + webidl.argumentLengthCheck(arguments, 1, { header: "MessageEvent.initMessageEvent" }); + return new _MessageEvent(type3, { + bubbles, + cancelable, + data, + origin, + lastEventId, + source, + ports + }); + } + }; + var CloseEvent = class _CloseEvent extends Event { + #eventInit; + constructor(type3, eventInitDict = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: "CloseEvent constructor" }); + type3 = webidl.converters.DOMString(type3); + eventInitDict = webidl.converters.CloseEventInit(eventInitDict); + super(type3, eventInitDict); + this.#eventInit = eventInitDict; + } + get wasClean() { + webidl.brandCheck(this, _CloseEvent); + return this.#eventInit.wasClean; + } + get code() { + webidl.brandCheck(this, _CloseEvent); + return this.#eventInit.code; + } + get reason() { + webidl.brandCheck(this, _CloseEvent); + return this.#eventInit.reason; + } + }; + var ErrorEvent = class _ErrorEvent extends Event { + #eventInit; + constructor(type3, eventInitDict) { + webidl.argumentLengthCheck(arguments, 1, { header: "ErrorEvent constructor" }); + super(type3, eventInitDict); + type3 = webidl.converters.DOMString(type3); + eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {}); + this.#eventInit = eventInitDict; + } + get message() { + webidl.brandCheck(this, _ErrorEvent); + return this.#eventInit.message; + } + get filename() { + webidl.brandCheck(this, _ErrorEvent); + return this.#eventInit.filename; + } + get lineno() { + webidl.brandCheck(this, _ErrorEvent); + return this.#eventInit.lineno; + } + get colno() { + webidl.brandCheck(this, _ErrorEvent); + return this.#eventInit.colno; + } + get error() { + webidl.brandCheck(this, _ErrorEvent); + return this.#eventInit.error; + } + }; + Object.defineProperties(MessageEvent.prototype, { + [Symbol.toStringTag]: { + value: "MessageEvent", + configurable: true + }, + data: kEnumerableProperty, + origin: kEnumerableProperty, + lastEventId: kEnumerableProperty, + source: kEnumerableProperty, + ports: kEnumerableProperty, + initMessageEvent: kEnumerableProperty + }); + Object.defineProperties(CloseEvent.prototype, { + [Symbol.toStringTag]: { + value: "CloseEvent", + configurable: true + }, + reason: kEnumerableProperty, + code: kEnumerableProperty, + wasClean: kEnumerableProperty + }); + Object.defineProperties(ErrorEvent.prototype, { + [Symbol.toStringTag]: { + value: "ErrorEvent", + configurable: true + }, + message: kEnumerableProperty, + filename: kEnumerableProperty, + lineno: kEnumerableProperty, + colno: kEnumerableProperty, + error: kEnumerableProperty + }); + webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort); + webidl.converters["sequence"] = webidl.sequenceConverter( + webidl.converters.MessagePort + ); + var eventInit = [ + { + key: "bubbles", + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: "cancelable", + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: "composed", + converter: webidl.converters.boolean, + defaultValue: false + } + ]; + webidl.converters.MessageEventInit = webidl.dictionaryConverter([ + ...eventInit, + { + key: "data", + converter: webidl.converters.any, + defaultValue: null + }, + { + key: "origin", + converter: webidl.converters.USVString, + defaultValue: "" + }, + { + key: "lastEventId", + converter: webidl.converters.DOMString, + defaultValue: "" + }, + { + key: "source", + // Node doesn't implement WindowProxy or ServiceWorker, so the only + // valid value for source is a MessagePort. + converter: webidl.nullableConverter(webidl.converters.MessagePort), + defaultValue: null + }, + { + key: "ports", + converter: webidl.converters["sequence"], + get defaultValue() { + return []; + } + } + ]); + webidl.converters.CloseEventInit = webidl.dictionaryConverter([ + ...eventInit, + { + key: "wasClean", + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: "code", + converter: webidl.converters["unsigned short"], + defaultValue: 0 + }, + { + key: "reason", + converter: webidl.converters.USVString, + defaultValue: "" + } + ]); + webidl.converters.ErrorEventInit = webidl.dictionaryConverter([ + ...eventInit, + { + key: "message", + converter: webidl.converters.DOMString, + defaultValue: "" + }, + { + key: "filename", + converter: webidl.converters.USVString, + defaultValue: "" + }, + { + key: "lineno", + converter: webidl.converters["unsigned long"], + defaultValue: 0 + }, + { + key: "colno", + converter: webidl.converters["unsigned long"], + defaultValue: 0 + }, + { + key: "error", + converter: webidl.converters.any + } + ]); + module.exports = { + MessageEvent, + CloseEvent, + ErrorEvent + }; + } +}); + +// node_modules/undici/lib/websocket/util.js +var require_util7 = __commonJS({ + "node_modules/undici/lib/websocket/util.js"(exports, module) { + "use strict"; + var { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require_symbols5(); + var { states, opcodes } = require_constants4(); + var { MessageEvent, ErrorEvent } = require_events(); + function isEstablished(ws) { + return ws[kReadyState] === states.OPEN; + } + function isClosing(ws) { + return ws[kReadyState] === states.CLOSING; + } + function isClosed(ws) { + return ws[kReadyState] === states.CLOSED; + } + function fireEvent(e2, target, eventConstructor = Event, eventInitDict) { + const event = new eventConstructor(e2, eventInitDict); + target.dispatchEvent(event); + } + function websocketMessageReceived(ws, type3, data) { + if (ws[kReadyState] !== states.OPEN) { + return; + } + let dataForEvent; + if (type3 === opcodes.TEXT) { + try { + dataForEvent = new TextDecoder("utf-8", { fatal: true }).decode(data); + } catch { + failWebsocketConnection(ws, "Received invalid UTF-8 in text frame."); + return; + } + } else if (type3 === opcodes.BINARY) { + if (ws[kBinaryType] === "blob") { + dataForEvent = new Blob([data]); } else { - if (prev) { - set2.push([first, prev]); + dataForEvent = new Uint8Array(data).buffer; + } + } + fireEvent("message", ws, MessageEvent, { + origin: ws[kWebSocketURL].origin, + data: dataForEvent + }); + } + function isValidSubprotocol(protocol) { + if (protocol.length === 0) { + return false; + } + for (const char of protocol) { + const code = char.charCodeAt(0); + if (code < 33 || code > 126 || char === "(" || char === ")" || char === "<" || char === ">" || char === "@" || char === "," || char === ";" || char === ":" || char === "\\" || char === '"' || char === "/" || char === "[" || char === "]" || char === "?" || char === "=" || char === "{" || char === "}" || code === 32 || // SP + code === 9) { + return false; + } + } + return true; + } + function isValidStatusCode(code) { + if (code >= 1e3 && code < 1015) { + return code !== 1004 && // reserved + code !== 1005 && // "MUST NOT be set as a status code" + code !== 1006; + } + return code >= 3e3 && code <= 4999; + } + function failWebsocketConnection(ws, reason) { + const { [kController]: controller, [kResponse]: response } = ws; + controller.abort(); + if (response?.socket && !response.socket.destroyed) { + response.socket.destroy(); + } + if (reason) { + fireEvent("error", ws, ErrorEvent, { + error: new Error(reason) + }); + } + } + module.exports = { + isEstablished, + isClosing, + isClosed, + fireEvent, + isValidSubprotocol, + isValidStatusCode, + failWebsocketConnection, + websocketMessageReceived + }; + } +}); + +// node_modules/undici/lib/websocket/connection.js +var require_connection = __commonJS({ + "node_modules/undici/lib/websocket/connection.js"(exports, module) { + "use strict"; + var diagnosticsChannel = __require("diagnostics_channel"); + var { uid, states } = require_constants4(); + var { + kReadyState, + kSentClose, + kByteParser, + kReceivedClose + } = require_symbols5(); + var { fireEvent, failWebsocketConnection } = require_util7(); + var { CloseEvent } = require_events(); + var { makeRequest } = require_request2(); + var { fetching } = require_fetch(); + var { Headers: Headers2 } = require_headers(); + var { getGlobalDispatcher } = require_global3(); + var { kHeadersList } = require_symbols(); + var channels = {}; + channels.open = diagnosticsChannel.channel("undici:websocket:open"); + channels.close = diagnosticsChannel.channel("undici:websocket:close"); + channels.socketError = diagnosticsChannel.channel("undici:websocket:socket_error"); + var crypto5; + try { + crypto5 = __require("crypto"); + } catch { + } + function establishWebSocketConnection(url2, protocols, ws, onEstablish, options) { + const requestURL = url2; + requestURL.protocol = url2.protocol === "ws:" ? "http:" : "https:"; + const request = makeRequest({ + urlList: [requestURL], + serviceWorkers: "none", + referrer: "no-referrer", + mode: "websocket", + credentials: "include", + cache: "no-store", + redirect: "error" + }); + if (options.headers) { + const headersList = new Headers2(options.headers)[kHeadersList]; + request.headersList = headersList; + } + const keyValue = crypto5.randomBytes(16).toString("base64"); + request.headersList.append("sec-websocket-key", keyValue); + request.headersList.append("sec-websocket-version", "13"); + for (const protocol of protocols) { + request.headersList.append("sec-websocket-protocol", protocol); + } + const permessageDeflate = ""; + const controller = fetching({ + request, + useParallelQueue: true, + dispatcher: options.dispatcher ?? getGlobalDispatcher(), + processResponse(response) { + if (response.type === "error" || response.status !== 101) { + failWebsocketConnection(ws, "Received network error or non-101 status code."); + return; } - prev = null; - first = null; + if (protocols.length !== 0 && !response.headersList.get("Sec-WebSocket-Protocol")) { + failWebsocketConnection(ws, "Server did not respond with sent protocols."); + return; + } + if (response.headersList.get("Upgrade")?.toLowerCase() !== "websocket") { + failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".'); + return; + } + if (response.headersList.get("Connection")?.toLowerCase() !== "upgrade") { + failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".'); + return; + } + const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); + const digest2 = crypto5.createHash("sha1").update(keyValue + uid).digest("base64"); + if (secWSAccept !== digest2) { + failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); + return; + } + const secExtension = response.headersList.get("Sec-WebSocket-Extensions"); + if (secExtension !== null && secExtension !== permessageDeflate) { + failWebsocketConnection(ws, "Received different permessage-deflate than the one set."); + return; + } + const secProtocol = response.headersList.get("Sec-WebSocket-Protocol"); + if (secProtocol !== null && secProtocol !== request.headersList.get("Sec-WebSocket-Protocol")) { + failWebsocketConnection(ws, "Protocol was not set in the opening handshake."); + return; + } + response.socket.on("data", onSocketData); + response.socket.on("close", onSocketClose); + response.socket.on("error", onSocketError); + if (channels.open.hasSubscribers) { + channels.open.publish({ + address: response.socket.address(), + protocol: secProtocol, + extensions: secExtension + }); + } + onEstablish(response); } + }); + return controller; + } + function onSocketData(chunk) { + if (!this.ws[kByteParser].write(chunk)) { + this.pause(); } - if (first) { - set2.push([first, null]); + } + function onSocketClose() { + const { ws } = this; + const wasClean = ws[kSentClose] && ws[kReceivedClose]; + let code = 1005; + let reason = ""; + const result = ws[kByteParser].closingInfo; + if (result) { + code = result.code ?? 1005; + reason = result.reason; + } else if (!ws[kSentClose]) { + code = 1006; + } + ws[kReadyState] = states.CLOSED; + fireEvent("close", ws, CloseEvent, { + wasClean, + code, + reason + }); + if (channels.close.hasSubscribers) { + channels.close.publish({ + websocket: ws, + code, + reason + }); } - const ranges = []; - for (const [min, max] of set2) { - if (min === max) { - ranges.push(min); - } else if (!max && min === v2[0]) { - ranges.push("*"); - } else if (!max) { - ranges.push(`>=${min}`); - } else if (min === v2[0]) { - ranges.push(`<=${max}`); - } else { - ranges.push(`${min} - ${max}`); + } + function onSocketError(error) { + const { ws } = this; + ws[kReadyState] = states.CLOSING; + if (channels.socketError.hasSubscribers) { + channels.socketError.publish(error); + } + this.destroy(); + } + module.exports = { + establishWebSocketConnection + }; + } +}); + +// node_modules/undici/lib/websocket/frame.js +var require_frame = __commonJS({ + "node_modules/undici/lib/websocket/frame.js"(exports, module) { + "use strict"; + var { maxUnsigned16Bit } = require_constants4(); + var crypto5; + try { + crypto5 = __require("crypto"); + } catch { + } + var WebsocketFrameSend = class { + /** + * @param {Buffer|undefined} data + */ + constructor(data) { + this.frameData = data; + this.maskKey = crypto5.randomBytes(4); + } + createFrame(opcode) { + const bodyLength = this.frameData?.byteLength ?? 0; + let payloadLength = bodyLength; + let offset = 6; + if (bodyLength > maxUnsigned16Bit) { + offset += 8; + payloadLength = 127; + } else if (bodyLength > 125) { + offset += 2; + payloadLength = 126; + } + const buffer = Buffer.allocUnsafe(bodyLength + offset); + buffer[0] = buffer[1] = 0; + buffer[0] |= 128; + buffer[0] = (buffer[0] & 240) + opcode; + /*! ws. MIT License. Einar Otto Stangvik */ + buffer[offset - 4] = this.maskKey[0]; + buffer[offset - 3] = this.maskKey[1]; + buffer[offset - 2] = this.maskKey[2]; + buffer[offset - 1] = this.maskKey[3]; + buffer[1] = payloadLength; + if (payloadLength === 126) { + buffer.writeUInt16BE(bodyLength, 2); + } else if (payloadLength === 127) { + buffer[2] = buffer[3] = 0; + buffer.writeUIntBE(bodyLength, 4, 6); + } + buffer[1] |= 128; + for (let i2 = 0; i2 < bodyLength; i2++) { + buffer[offset + i2] = this.frameData[i2] ^ this.maskKey[i2 % 4]; } + return buffer; } - const simplified = ranges.join(" || "); - const original = typeof range2.raw === "string" ? range2.raw : String(range2); - return simplified.length < original.length ? simplified : range2; + }; + module.exports = { + WebsocketFrameSend }; } }); -// node_modules/semver/ranges/subset.js -var require_subset = __commonJS({ - "node_modules/semver/ranges/subset.js"(exports, module) { - var Range3 = require_range(); - var Comparator = require_comparator(); - var { ANY } = Comparator; - var satisfies = require_satisfies(); - var compare = require_compare(); - var subset = (sub, dom, options = {}) => { - if (sub === dom) { - return true; +// node_modules/undici/lib/websocket/receiver.js +var require_receiver = __commonJS({ + "node_modules/undici/lib/websocket/receiver.js"(exports, module) { + "use strict"; + var { Writable } = __require("stream"); + var diagnosticsChannel = __require("diagnostics_channel"); + var { parserStates, opcodes, states, emptyBuffer } = require_constants4(); + var { kReadyState, kSentClose, kResponse, kReceivedClose } = require_symbols5(); + var { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = require_util7(); + var { WebsocketFrameSend } = require_frame(); + var channels = {}; + channels.ping = diagnosticsChannel.channel("undici:websocket:ping"); + channels.pong = diagnosticsChannel.channel("undici:websocket:pong"); + var ByteParser = class extends Writable { + #buffers = []; + #byteOffset = 0; + #state = parserStates.INFO; + #info = {}; + #fragments = []; + constructor(ws) { + super(); + this.ws = ws; } - sub = new Range3(sub, options); - dom = new Range3(dom, options); - let sawNonNull = false; - OUTER: - for (const simpleSub of sub.set) { - for (const simpleDom of dom.set) { - const isSub = simpleSubset(simpleSub, simpleDom, options); - sawNonNull = sawNonNull || isSub !== null; - if (isSub) { - continue OUTER; + /** + * @param {Buffer} chunk + * @param {() => void} callback + */ + _write(chunk, _2, callback) { + this.#buffers.push(chunk); + this.#byteOffset += chunk.length; + this.run(callback); + } + /** + * Runs whenever a new chunk is received. + * Callback is called whenever there are no more chunks buffering, + * or not enough bytes are buffered to parse. + */ + run(callback) { + while (true) { + if (this.#state === parserStates.INFO) { + if (this.#byteOffset < 2) { + return callback(); + } + const buffer = this.consume(2); + this.#info.fin = (buffer[0] & 128) !== 0; + this.#info.opcode = buffer[0] & 15; + this.#info.originalOpcode ??= this.#info.opcode; + this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION; + if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) { + failWebsocketConnection(this.ws, "Invalid frame type was fragmented."); + return; + } + const payloadLength = buffer[1] & 127; + if (payloadLength <= 125) { + this.#info.payloadLength = payloadLength; + this.#state = parserStates.READ_DATA; + } else if (payloadLength === 126) { + this.#state = parserStates.PAYLOADLENGTH_16; + } else if (payloadLength === 127) { + this.#state = parserStates.PAYLOADLENGTH_64; + } + if (this.#info.fragmented && payloadLength > 125) { + failWebsocketConnection(this.ws, "Fragmented frame exceeded 125 bytes."); + return; + } else if ((this.#info.opcode === opcodes.PING || this.#info.opcode === opcodes.PONG || this.#info.opcode === opcodes.CLOSE) && payloadLength > 125) { + failWebsocketConnection(this.ws, "Payload length for control frame exceeded 125 bytes."); + return; + } else if (this.#info.opcode === opcodes.CLOSE) { + if (payloadLength === 1) { + failWebsocketConnection(this.ws, "Received close frame with a 1-byte body."); + return; + } + const body2 = this.consume(payloadLength); + this.#info.closeInfo = this.parseCloseBody(false, body2); + if (!this.ws[kSentClose]) { + const body3 = Buffer.allocUnsafe(2); + body3.writeUInt16BE(this.#info.closeInfo.code, 0); + const closeFrame = new WebsocketFrameSend(body3); + this.ws[kResponse].socket.write( + closeFrame.createFrame(opcodes.CLOSE), + (err) => { + if (!err) { + this.ws[kSentClose] = true; + } + } + ); + } + this.ws[kReadyState] = states.CLOSING; + this.ws[kReceivedClose] = true; + this.end(); + return; + } else if (this.#info.opcode === opcodes.PING) { + const body2 = this.consume(payloadLength); + if (!this.ws[kReceivedClose]) { + const frame = new WebsocketFrameSend(body2); + this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG)); + if (channels.ping.hasSubscribers) { + channels.ping.publish({ + payload: body2 + }); + } + } + this.#state = parserStates.INFO; + if (this.#byteOffset > 0) { + continue; + } else { + callback(); + return; + } + } else if (this.#info.opcode === opcodes.PONG) { + const body2 = this.consume(payloadLength); + if (channels.pong.hasSubscribers) { + channels.pong.publish({ + payload: body2 + }); + } + if (this.#byteOffset > 0) { + continue; + } else { + callback(); + return; + } + } + } else if (this.#state === parserStates.PAYLOADLENGTH_16) { + if (this.#byteOffset < 2) { + return callback(); + } + const buffer = this.consume(2); + this.#info.payloadLength = buffer.readUInt16BE(0); + this.#state = parserStates.READ_DATA; + } else if (this.#state === parserStates.PAYLOADLENGTH_64) { + if (this.#byteOffset < 8) { + return callback(); + } + const buffer = this.consume(8); + const upper = buffer.readUInt32BE(0); + if (upper > 2 ** 31 - 1) { + failWebsocketConnection(this.ws, "Received payload length > 2^31 bytes."); + return; + } + const lower = buffer.readUInt32BE(4); + this.#info.payloadLength = (upper << 8) + lower; + this.#state = parserStates.READ_DATA; + } else if (this.#state === parserStates.READ_DATA) { + if (this.#byteOffset < this.#info.payloadLength) { + return callback(); + } else if (this.#byteOffset >= this.#info.payloadLength) { + const body2 = this.consume(this.#info.payloadLength); + this.#fragments.push(body2); + if (!this.#info.fragmented || this.#info.fin && this.#info.opcode === opcodes.CONTINUATION) { + const fullMessage = Buffer.concat(this.#fragments); + websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage); + this.#info = {}; + this.#fragments.length = 0; + } + this.#state = parserStates.INFO; } } - if (sawNonNull) { - return false; + if (this.#byteOffset > 0) { + continue; + } else { + callback(); + break; } } - return true; - }; - var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")]; - var minimumVersion = [new Comparator(">=0.0.0")]; - var simpleSubset = (sub, dom, options) => { - if (sub === dom) { - return true; } - if (sub.length === 1 && sub[0].semver === ANY) { - if (dom.length === 1 && dom[0].semver === ANY) { - return true; - } else if (options.includePrerelease) { - sub = minimumVersionWithPreRelease; - } else { - sub = minimumVersion; + /** + * Take n bytes from the buffered Buffers + * @param {number} n + * @returns {Buffer|null} + */ + consume(n2) { + if (n2 > this.#byteOffset) { + return null; + } else if (n2 === 0) { + return emptyBuffer; } - } - if (dom.length === 1 && dom[0].semver === ANY) { - if (options.includePrerelease) { - return true; - } else { - dom = minimumVersion; + if (this.#buffers[0].length === n2) { + this.#byteOffset -= this.#buffers[0].length; + return this.#buffers.shift(); } - } - const eqSet = /* @__PURE__ */ new Set(); - let gt2, lt2; - for (const c2 of sub) { - if (c2.operator === ">" || c2.operator === ">=") { - gt2 = higherGT(gt2, c2, options); - } else if (c2.operator === "<" || c2.operator === "<=") { - lt2 = lowerLT(lt2, c2, options); - } else { - eqSet.add(c2.semver); + const buffer = Buffer.allocUnsafe(n2); + let offset = 0; + while (offset !== n2) { + const next = this.#buffers[0]; + const { length } = next; + if (length + offset === n2) { + buffer.set(this.#buffers.shift(), offset); + break; + } else if (length + offset > n2) { + buffer.set(next.subarray(0, n2 - offset), offset); + this.#buffers[0] = next.subarray(n2 - offset); + break; + } else { + buffer.set(this.#buffers.shift(), offset); + offset += next.length; + } } + this.#byteOffset -= n2; + return buffer; } - if (eqSet.size > 1) { - return null; - } - let gtltComp; - if (gt2 && lt2) { - gtltComp = compare(gt2.semver, lt2.semver, options); - if (gtltComp > 0) { + parseCloseBody(onlyCode, data) { + let code; + if (data.length >= 2) { + code = data.readUInt16BE(0); + } + if (onlyCode) { + if (!isValidStatusCode(code)) { + return null; + } + return { code }; + } + let reason = data.subarray(2); + if (reason[0] === 239 && reason[1] === 187 && reason[2] === 191) { + reason = reason.subarray(3); + } + if (code !== void 0 && !isValidStatusCode(code)) { return null; - } else if (gtltComp === 0 && (gt2.operator !== ">=" || lt2.operator !== "<=")) { + } + try { + reason = new TextDecoder("utf-8", { fatal: true }).decode(reason); + } catch { return null; } + return { code, reason }; } - for (const eq of eqSet) { - if (gt2 && !satisfies(eq, String(gt2), options)) { - return null; + get closingInfo() { + return this.#info.closeInfo; + } + }; + module.exports = { + ByteParser + }; + } +}); + +// node_modules/undici/lib/websocket/websocket.js +var require_websocket = __commonJS({ + "node_modules/undici/lib/websocket/websocket.js"(exports, module) { + "use strict"; + var { webidl } = require_webidl(); + var { DOMException: DOMException2 } = require_constants(); + var { URLSerializer } = require_dataURL(); + var { getGlobalOrigin } = require_global2(); + var { staticPropertyDescriptors, states, opcodes, emptyBuffer } = require_constants4(); + var { + kWebSocketURL, + kReadyState, + kController, + kBinaryType, + kResponse, + kSentClose, + kByteParser + } = require_symbols5(); + var { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = require_util7(); + var { establishWebSocketConnection } = require_connection(); + var { WebsocketFrameSend } = require_frame(); + var { ByteParser } = require_receiver(); + var { kEnumerableProperty, isBlobLike } = require_util(); + var { getGlobalDispatcher } = require_global3(); + var { types } = __require("util"); + var experimentalWarned = false; + var WebSocket = class _WebSocket extends EventTarget { + #events = { + open: null, + error: null, + close: null, + message: null + }; + #bufferedAmount = 0; + #protocol = ""; + #extensions = ""; + /** + * @param {string} url + * @param {string|string[]} protocols + */ + constructor(url2, protocols = []) { + super(); + webidl.argumentLengthCheck(arguments, 1, { header: "WebSocket constructor" }); + if (!experimentalWarned) { + experimentalWarned = true; + process.emitWarning("WebSockets are experimental, expect them to change at any time.", { + code: "UNDICI-WS" + }); } - if (lt2 && !satisfies(eq, String(lt2), options)) { - return null; + const options = webidl.converters["DOMString or sequence or WebSocketInit"](protocols); + url2 = webidl.converters.USVString(url2); + protocols = options.protocols; + const baseURL = getGlobalOrigin(); + let urlRecord; + try { + urlRecord = new URL(url2, baseURL); + } catch (e2) { + throw new DOMException2(e2, "SyntaxError"); } - for (const c2 of dom) { - if (!satisfies(eq, String(c2), options)) { - return false; - } + if (urlRecord.protocol === "http:") { + urlRecord.protocol = "ws:"; + } else if (urlRecord.protocol === "https:") { + urlRecord.protocol = "wss:"; } - return true; - } - let higher, lower; - let hasDomLT, hasDomGT; - let needDomLTPre = lt2 && !options.includePrerelease && lt2.semver.prerelease.length ? lt2.semver : false; - let needDomGTPre = gt2 && !options.includePrerelease && gt2.semver.prerelease.length ? gt2.semver : false; - if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt2.operator === "<" && needDomLTPre.prerelease[0] === 0) { - needDomLTPre = false; + if (urlRecord.protocol !== "ws:" && urlRecord.protocol !== "wss:") { + throw new DOMException2( + `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`, + "SyntaxError" + ); + } + if (urlRecord.hash || urlRecord.href.endsWith("#")) { + throw new DOMException2("Got fragment", "SyntaxError"); + } + if (typeof protocols === "string") { + protocols = [protocols]; + } + if (protocols.length !== new Set(protocols.map((p2) => p2.toLowerCase())).size) { + throw new DOMException2("Invalid Sec-WebSocket-Protocol value", "SyntaxError"); + } + if (protocols.length > 0 && !protocols.every((p2) => isValidSubprotocol(p2))) { + throw new DOMException2("Invalid Sec-WebSocket-Protocol value", "SyntaxError"); + } + this[kWebSocketURL] = new URL(urlRecord.href); + this[kController] = establishWebSocketConnection( + urlRecord, + protocols, + this, + (response) => this.#onConnectionEstablished(response), + options + ); + this[kReadyState] = _WebSocket.CONNECTING; + this[kBinaryType] = "blob"; } - for (const c2 of dom) { - hasDomGT = hasDomGT || c2.operator === ">" || c2.operator === ">="; - hasDomLT = hasDomLT || c2.operator === "<" || c2.operator === "<="; - if (gt2) { - if (needDomGTPre) { - if (c2.semver.prerelease && c2.semver.prerelease.length && c2.semver.major === needDomGTPre.major && c2.semver.minor === needDomGTPre.minor && c2.semver.patch === needDomGTPre.patch) { - needDomGTPre = false; - } + /** + * @see https://websockets.spec.whatwg.org/#dom-websocket-close + * @param {number|undefined} code + * @param {string|undefined} reason + */ + close(code = void 0, reason = void 0) { + webidl.brandCheck(this, _WebSocket); + if (code !== void 0) { + code = webidl.converters["unsigned short"](code, { clamp: true }); + } + if (reason !== void 0) { + reason = webidl.converters.USVString(reason); + } + if (code !== void 0) { + if (code !== 1e3 && (code < 3e3 || code > 4999)) { + throw new DOMException2("invalid code", "InvalidAccessError"); } - if (c2.operator === ">" || c2.operator === ">=") { - higher = higherGT(gt2, c2, options); - if (higher === c2 && higher !== gt2) { - return false; - } - } else if (gt2.operator === ">=" && !satisfies(gt2.semver, String(c2), options)) { - return false; + } + let reasonByteLength = 0; + if (reason !== void 0) { + reasonByteLength = Buffer.byteLength(reason); + if (reasonByteLength > 123) { + throw new DOMException2( + `Reason must be less than 123 bytes; received ${reasonByteLength}`, + "SyntaxError" + ); } } - if (lt2) { - if (needDomLTPre) { - if (c2.semver.prerelease && c2.semver.prerelease.length && c2.semver.major === needDomLTPre.major && c2.semver.minor === needDomLTPre.minor && c2.semver.patch === needDomLTPre.patch) { - needDomLTPre = false; - } + if (this[kReadyState] === _WebSocket.CLOSING || this[kReadyState] === _WebSocket.CLOSED) { + } else if (!isEstablished(this)) { + failWebsocketConnection(this, "Connection was closed before it was established."); + this[kReadyState] = _WebSocket.CLOSING; + } else if (!isClosing(this)) { + const frame = new WebsocketFrameSend(); + if (code !== void 0 && reason === void 0) { + frame.frameData = Buffer.allocUnsafe(2); + frame.frameData.writeUInt16BE(code, 0); + } else if (code !== void 0 && reason !== void 0) { + frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength); + frame.frameData.writeUInt16BE(code, 0); + frame.frameData.write(reason, 2, "utf-8"); + } else { + frame.frameData = emptyBuffer; } - if (c2.operator === "<" || c2.operator === "<=") { - lower = lowerLT(lt2, c2, options); - if (lower === c2 && lower !== lt2) { - return false; + const socket = this[kResponse].socket; + socket.write(frame.createFrame(opcodes.CLOSE), (err) => { + if (!err) { + this[kSentClose] = true; } - } else if (lt2.operator === "<=" && !satisfies(lt2.semver, String(c2), options)) { - return false; - } + }); + this[kReadyState] = states.CLOSING; + } else { + this[kReadyState] = _WebSocket.CLOSING; } - if (!c2.operator && (lt2 || gt2) && gtltComp !== 0) { - return false; + } + /** + * @see https://websockets.spec.whatwg.org/#dom-websocket-send + * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data + */ + send(data) { + webidl.brandCheck(this, _WebSocket); + webidl.argumentLengthCheck(arguments, 1, { header: "WebSocket.send" }); + data = webidl.converters.WebSocketSendData(data); + if (this[kReadyState] === _WebSocket.CONNECTING) { + throw new DOMException2("Sent before connected.", "InvalidStateError"); + } + if (!isEstablished(this) || isClosing(this)) { + return; + } + const socket = this[kResponse].socket; + if (typeof data === "string") { + const value = Buffer.from(data); + const frame = new WebsocketFrameSend(value); + const buffer = frame.createFrame(opcodes.TEXT); + this.#bufferedAmount += value.byteLength; + socket.write(buffer, () => { + this.#bufferedAmount -= value.byteLength; + }); + } else if (types.isArrayBuffer(data)) { + const value = Buffer.from(data); + const frame = new WebsocketFrameSend(value); + const buffer = frame.createFrame(opcodes.BINARY); + this.#bufferedAmount += value.byteLength; + socket.write(buffer, () => { + this.#bufferedAmount -= value.byteLength; + }); + } else if (ArrayBuffer.isView(data)) { + const ab = Buffer.from(data, data.byteOffset, data.byteLength); + const frame = new WebsocketFrameSend(ab); + const buffer = frame.createFrame(opcodes.BINARY); + this.#bufferedAmount += ab.byteLength; + socket.write(buffer, () => { + this.#bufferedAmount -= ab.byteLength; + }); + } else if (isBlobLike(data)) { + const frame = new WebsocketFrameSend(); + data.arrayBuffer().then((ab) => { + const value = Buffer.from(ab); + frame.frameData = value; + const buffer = frame.createFrame(opcodes.BINARY); + this.#bufferedAmount += value.byteLength; + socket.write(buffer, () => { + this.#bufferedAmount -= value.byteLength; + }); + }); } } - if (gt2 && hasDomLT && !lt2 && gtltComp !== 0) { - return false; + get readyState() { + webidl.brandCheck(this, _WebSocket); + return this[kReadyState]; } - if (lt2 && hasDomGT && !gt2 && gtltComp !== 0) { - return false; + get bufferedAmount() { + webidl.brandCheck(this, _WebSocket); + return this.#bufferedAmount; } - if (needDomGTPre || needDomLTPre) { - return false; + get url() { + webidl.brandCheck(this, _WebSocket); + return URLSerializer(this[kWebSocketURL]); } - return true; + get extensions() { + webidl.brandCheck(this, _WebSocket); + return this.#extensions; + } + get protocol() { + webidl.brandCheck(this, _WebSocket); + return this.#protocol; + } + get onopen() { + webidl.brandCheck(this, _WebSocket); + return this.#events.open; + } + set onopen(fn2) { + webidl.brandCheck(this, _WebSocket); + if (this.#events.open) { + this.removeEventListener("open", this.#events.open); + } + if (typeof fn2 === "function") { + this.#events.open = fn2; + this.addEventListener("open", fn2); + } else { + this.#events.open = null; + } + } + get onerror() { + webidl.brandCheck(this, _WebSocket); + return this.#events.error; + } + set onerror(fn2) { + webidl.brandCheck(this, _WebSocket); + if (this.#events.error) { + this.removeEventListener("error", this.#events.error); + } + if (typeof fn2 === "function") { + this.#events.error = fn2; + this.addEventListener("error", fn2); + } else { + this.#events.error = null; + } + } + get onclose() { + webidl.brandCheck(this, _WebSocket); + return this.#events.close; + } + set onclose(fn2) { + webidl.brandCheck(this, _WebSocket); + if (this.#events.close) { + this.removeEventListener("close", this.#events.close); + } + if (typeof fn2 === "function") { + this.#events.close = fn2; + this.addEventListener("close", fn2); + } else { + this.#events.close = null; + } + } + get onmessage() { + webidl.brandCheck(this, _WebSocket); + return this.#events.message; + } + set onmessage(fn2) { + webidl.brandCheck(this, _WebSocket); + if (this.#events.message) { + this.removeEventListener("message", this.#events.message); + } + if (typeof fn2 === "function") { + this.#events.message = fn2; + this.addEventListener("message", fn2); + } else { + this.#events.message = null; + } + } + get binaryType() { + webidl.brandCheck(this, _WebSocket); + return this[kBinaryType]; + } + set binaryType(type3) { + webidl.brandCheck(this, _WebSocket); + if (type3 !== "blob" && type3 !== "arraybuffer") { + this[kBinaryType] = "blob"; + } else { + this[kBinaryType] = type3; + } + } + /** + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol + */ + #onConnectionEstablished(response) { + this[kResponse] = response; + const parser = new ByteParser(this); + parser.on("drain", function onParserDrain() { + this.ws[kResponse].socket.resume(); + }); + response.socket.ws = this; + this[kByteParser] = parser; + this[kReadyState] = states.OPEN; + const extensions = response.headersList.get("sec-websocket-extensions"); + if (extensions !== null) { + this.#extensions = extensions; + } + const protocol = response.headersList.get("sec-websocket-protocol"); + if (protocol !== null) { + this.#protocol = protocol; + } + fireEvent("open", this); + } + }; + WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING; + WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN; + WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING; + WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED; + Object.defineProperties(WebSocket.prototype, { + CONNECTING: staticPropertyDescriptors, + OPEN: staticPropertyDescriptors, + CLOSING: staticPropertyDescriptors, + CLOSED: staticPropertyDescriptors, + url: kEnumerableProperty, + readyState: kEnumerableProperty, + bufferedAmount: kEnumerableProperty, + onopen: kEnumerableProperty, + onerror: kEnumerableProperty, + onclose: kEnumerableProperty, + close: kEnumerableProperty, + onmessage: kEnumerableProperty, + binaryType: kEnumerableProperty, + send: kEnumerableProperty, + extensions: kEnumerableProperty, + protocol: kEnumerableProperty, + [Symbol.toStringTag]: { + value: "WebSocket", + writable: false, + enumerable: false, + configurable: true + } + }); + Object.defineProperties(WebSocket, { + CONNECTING: staticPropertyDescriptors, + OPEN: staticPropertyDescriptors, + CLOSING: staticPropertyDescriptors, + CLOSED: staticPropertyDescriptors + }); + webidl.converters["sequence"] = webidl.sequenceConverter( + webidl.converters.DOMString + ); + webidl.converters["DOMString or sequence"] = function(V2) { + if (webidl.util.Type(V2) === "Object" && Symbol.iterator in V2) { + return webidl.converters["sequence"](V2); + } + return webidl.converters.DOMString(V2); }; - var higherGT = (a2, b2, options) => { - if (!a2) { - return b2; + webidl.converters.WebSocketInit = webidl.dictionaryConverter([ + { + key: "protocols", + converter: webidl.converters["DOMString or sequence"], + get defaultValue() { + return []; + } + }, + { + key: "dispatcher", + converter: (V2) => V2, + get defaultValue() { + return getGlobalDispatcher(); + } + }, + { + key: "headers", + converter: webidl.nullableConverter(webidl.converters.HeadersInit) } - const comp26 = compare(a2.semver, b2.semver, options); - return comp26 > 0 ? a2 : comp26 < 0 ? b2 : b2.operator === ">" && a2.operator === ">=" ? b2 : a2; + ]); + webidl.converters["DOMString or sequence or WebSocketInit"] = function(V2) { + if (webidl.util.Type(V2) === "Object" && !(Symbol.iterator in V2)) { + return webidl.converters.WebSocketInit(V2); + } + return { protocols: webidl.converters["DOMString or sequence"](V2) }; }; - var lowerLT = (a2, b2, options) => { - if (!a2) { - return b2; + webidl.converters.WebSocketSendData = function(V2) { + if (webidl.util.Type(V2) === "Object") { + if (isBlobLike(V2)) { + return webidl.converters.Blob(V2, { strict: false }); + } + if (ArrayBuffer.isView(V2) || types.isAnyArrayBuffer(V2)) { + return webidl.converters.BufferSource(V2); + } } - const comp26 = compare(a2.semver, b2.semver, options); - return comp26 < 0 ? a2 : comp26 > 0 ? b2 : b2.operator === "<" && a2.operator === "<=" ? b2 : a2; + return webidl.converters.USVString(V2); }; - module.exports = subset; - } -}); - -// node_modules/semver/index.js -var require_semver2 = __commonJS({ - "node_modules/semver/index.js"(exports, module) { - var internalRe = require_re(); - var constants = require_constants(); - var SemVer = require_semver(); - var identifiers = require_identifiers(); - var parse5 = require_parse(); - var valid = require_valid(); - var clean = require_clean(); - var inc = require_inc(); - var diff = require_diff(); - var major2 = require_major(); - var minor = require_minor(); - var patch2 = require_patch(); - var prerelease = require_prerelease(); - var compare = require_compare(); - var rcompare = require_rcompare(); - var compareLoose = require_compare_loose(); - var compareBuild = require_compare_build(); - var sort = require_sort(); - var rsort = require_rsort(); - var gt2 = require_gt(); - var lt2 = require_lt(); - var eq = require_eq(); - var neq = require_neq(); - var gte = require_gte(); - var lte = require_lte(); - var cmp = require_cmp(); - var coerce = require_coerce(); - var Comparator = require_comparator(); - var Range3 = require_range(); - var satisfies = require_satisfies(); - var toComparators = require_to_comparators(); - var maxSatisfying = require_max_satisfying(); - var minSatisfying = require_min_satisfying(); - var minVersion = require_min_version(); - var validRange = require_valid2(); - var outside = require_outside(); - var gtr = require_gtr(); - var ltr = require_ltr(); - var intersects = require_intersects(); - var simplifyRange = require_simplify(); - var subset = require_subset(); module.exports = { - parse: parse5, - valid, - clean, - inc, - diff, - major: major2, - minor, - patch: patch2, - prerelease, - compare, - rcompare, - compareLoose, - compareBuild, - sort, - rsort, - gt: gt2, - lt: lt2, - eq, - neq, - gte, - lte, - cmp, - coerce, - Comparator, - Range: Range3, - satisfies, - toComparators, - maxSatisfying, - minSatisfying, - minVersion, - validRange, - outside, - gtr, - ltr, - intersects, - simplifyRange, - subset, - SemVer, - re: internalRe.re, - src: internalRe.src, - tokens: internalRe.t, - SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, - RELEASE_TYPES: constants.RELEASE_TYPES, - compareIdentifiers: identifiers.compareIdentifiers, - rcompareIdentifiers: identifiers.rcompareIdentifiers - }; - } -}); - -// node_modules/uuid/lib/rng.js -var require_rng = __commonJS({ - "node_modules/uuid/lib/rng.js"(exports, module) { - var crypto5 = __require("crypto"); - module.exports = function nodeRNG() { - return crypto5.randomBytes(16); + WebSocket }; } }); -// node_modules/uuid/lib/bytesToUuid.js -var require_bytesToUuid = __commonJS({ - "node_modules/uuid/lib/bytesToUuid.js"(exports, module) { - var byteToHex3 = []; - for (i2 = 0; i2 < 256; ++i2) { - byteToHex3[i2] = (i2 + 256).toString(16).substr(1); +// node_modules/undici/index.js +var require_undici = __commonJS({ + "node_modules/undici/index.js"(exports, module) { + "use strict"; + var Client = require_client(); + var Dispatcher = require_dispatcher(); + var errors = require_errors(); + var Pool = require_pool(); + var BalancedPool = require_balanced_pool(); + var Agent3 = require_agent(); + var util3 = require_util(); + var { InvalidArgumentError } = errors; + var api = require_api(); + var buildConnector = require_connect(); + var MockClient = require_mock_client(); + var MockAgent = require_mock_agent(); + var MockPool = require_mock_pool(); + var mockErrors = require_mock_errors(); + var ProxyAgent = require_proxy_agent(); + var { getGlobalDispatcher, setGlobalDispatcher } = require_global3(); + var DecoratorHandler = require_DecoratorHandler(); + var RedirectHandler = require_RedirectHandler(); + var createRedirectInterceptor = require_redirectInterceptor(); + var hasCrypto; + try { + __require("crypto"); + hasCrypto = true; + } catch { + hasCrypto = false; } - var i2; - function bytesToUuid(buf, offset) { - var i3 = offset || 0; - var bth = byteToHex3; - return [ - bth[buf[i3++]], - bth[buf[i3++]], - bth[buf[i3++]], - bth[buf[i3++]], - "-", - bth[buf[i3++]], - bth[buf[i3++]], - "-", - bth[buf[i3++]], - bth[buf[i3++]], - "-", - bth[buf[i3++]], - bth[buf[i3++]], - "-", - bth[buf[i3++]], - bth[buf[i3++]], - bth[buf[i3++]], - bth[buf[i3++]], - bth[buf[i3++]], - bth[buf[i3++]] - ].join(""); + Object.assign(Dispatcher.prototype, api); + module.exports.Dispatcher = Dispatcher; + module.exports.Client = Client; + module.exports.Pool = Pool; + module.exports.BalancedPool = BalancedPool; + module.exports.Agent = Agent3; + module.exports.ProxyAgent = ProxyAgent; + module.exports.DecoratorHandler = DecoratorHandler; + module.exports.RedirectHandler = RedirectHandler; + module.exports.createRedirectInterceptor = createRedirectInterceptor; + module.exports.buildConnector = buildConnector; + module.exports.errors = errors; + function makeDispatcher(fn2) { + return (url2, opts, handler) => { + if (typeof opts === "function") { + handler = opts; + opts = null; + } + if (!url2 || typeof url2 !== "string" && typeof url2 !== "object" && !(url2 instanceof URL)) { + throw new InvalidArgumentError("invalid url"); + } + if (opts != null && typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + if (opts && opts.path != null) { + if (typeof opts.path !== "string") { + throw new InvalidArgumentError("invalid opts.path"); + } + let path14 = opts.path; + if (!opts.path.startsWith("/")) { + path14 = `/${path14}`; + } + url2 = new URL(util3.parseOrigin(url2).origin + path14); + } else { + if (!opts) { + opts = typeof url2 === "object" ? url2 : {}; + } + url2 = util3.parseURL(url2); + } + const { agent, dispatcher = getGlobalDispatcher() } = opts; + if (agent) { + throw new InvalidArgumentError("unsupported opts.agent. Did you mean opts.client?"); + } + return fn2.call(dispatcher, { + ...opts, + origin: url2.origin, + path: url2.search ? `${url2.pathname}${url2.search}` : url2.pathname, + method: opts.method || (opts.body ? "PUT" : "GET") + }, handler); + }; } - module.exports = bytesToUuid; - } -}); - -// node_modules/uuid/v1.js -var require_v1 = __commonJS({ - "node_modules/uuid/v1.js"(exports, module) { - var rng3 = require_rng(); - var bytesToUuid = require_bytesToUuid(); - var _nodeId2; - var _clockseq2; - var _lastMSecs2 = 0; - var _lastNSecs2 = 0; - function v12(options, buf, offset) { - var i2 = buf && offset || 0; - var b2 = buf || []; - options = options || {}; - var node = options.node || _nodeId2; - var clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq2; - if (node == null || clockseq == null) { - var seedBytes = rng3(); - if (node == null) { - node = _nodeId2 = [ - seedBytes[0] | 1, - seedBytes[1], - seedBytes[2], - seedBytes[3], - seedBytes[4], - seedBytes[5] - ]; + module.exports.setGlobalDispatcher = setGlobalDispatcher; + module.exports.getGlobalDispatcher = getGlobalDispatcher; + if (util3.nodeMajor > 16 || util3.nodeMajor === 16 && util3.nodeMinor >= 8) { + let fetchImpl = null; + module.exports.fetch = async function fetch2(resource) { + if (!fetchImpl) { + fetchImpl = require_fetch().fetch; } - if (clockseq == null) { - clockseq = _clockseq2 = (seedBytes[6] << 8 | seedBytes[7]) & 16383; + try { + return await fetchImpl(...arguments); + } catch (err) { + if (typeof err === "object") { + Error.captureStackTrace(err, this); + } + throw err; } - } - var msecs = options.msecs !== void 0 ? options.msecs : (/* @__PURE__ */ new Date()).getTime(); - var nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs2 + 1; - var dt2 = msecs - _lastMSecs2 + (nsecs - _lastNSecs2) / 1e4; - if (dt2 < 0 && options.clockseq === void 0) { - clockseq = clockseq + 1 & 16383; - } - if ((dt2 < 0 || msecs > _lastMSecs2) && options.nsecs === void 0) { - nsecs = 0; - } - if (nsecs >= 1e4) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - _lastMSecs2 = msecs; - _lastNSecs2 = nsecs; - _clockseq2 = clockseq; - msecs += 122192928e5; - var tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296; - b2[i2++] = tl >>> 24 & 255; - b2[i2++] = tl >>> 16 & 255; - b2[i2++] = tl >>> 8 & 255; - b2[i2++] = tl & 255; - var tmh = msecs / 4294967296 * 1e4 & 268435455; - b2[i2++] = tmh >>> 8 & 255; - b2[i2++] = tmh & 255; - b2[i2++] = tmh >>> 24 & 15 | 16; - b2[i2++] = tmh >>> 16 & 255; - b2[i2++] = clockseq >>> 8 | 128; - b2[i2++] = clockseq & 255; - for (var n2 = 0; n2 < 6; ++n2) { - b2[i2 + n2] = node[n2]; - } - return buf ? buf : bytesToUuid(b2); + }; + module.exports.Headers = require_headers().Headers; + module.exports.Response = require_response().Response; + module.exports.Request = require_request2().Request; + module.exports.FormData = require_formdata().FormData; + module.exports.File = require_file().File; + module.exports.FileReader = require_filereader().FileReader; + const { setGlobalOrigin, getGlobalOrigin } = require_global2(); + module.exports.setGlobalOrigin = setGlobalOrigin; + module.exports.getGlobalOrigin = getGlobalOrigin; + const { CacheStorage } = require_cachestorage(); + const { kConstruct } = require_symbols4(); + module.exports.caches = new CacheStorage(kConstruct); } - module.exports = v12; - } -}); - -// node_modules/uuid/v4.js -var require_v4 = __commonJS({ - "node_modules/uuid/v4.js"(exports, module) { - var rng3 = require_rng(); - var bytesToUuid = require_bytesToUuid(); - function v43(options, buf, offset) { - var i2 = buf && offset || 0; - if (typeof options == "string") { - buf = options === "binary" ? new Array(16) : null; - options = null; - } - options = options || {}; - var rnds = options.random || (options.rng || rng3)(); - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - for (var ii = 0; ii < 16; ++ii) { - buf[i2 + ii] = rnds[ii]; - } - } - return buf || bytesToUuid(rnds); + if (util3.nodeMajor >= 16) { + const { deleteCookie, getCookies, getSetCookies, setCookie } = require_cookies(); + module.exports.deleteCookie = deleteCookie; + module.exports.getCookies = getCookies; + module.exports.getSetCookies = getSetCookies; + module.exports.setCookie = setCookie; + const { parseMIMEType, serializeAMimeType } = require_dataURL(); + module.exports.parseMIMEType = parseMIMEType; + module.exports.serializeAMimeType = serializeAMimeType; } - module.exports = v43; - } -}); - -// node_modules/uuid/index.js -var require_uuid = __commonJS({ - "node_modules/uuid/index.js"(exports, module) { - var v12 = require_v1(); - var v43 = require_v4(); - var uuid = v43; - uuid.v1 = v12; - uuid.v4 = v43; - module.exports = uuid; - } -}); - -// node_modules/@actions/cache/lib/internal/constants.js -var require_constants2 = __commonJS({ - "node_modules/@actions/cache/lib/internal/constants.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ManifestFilename = exports.TarFilename = exports.SystemTarPathOnWindows = exports.GnuTarPathOnWindows = exports.SocketTimeout = exports.DefaultRetryDelay = exports.DefaultRetryAttempts = exports.ArchiveToolType = exports.CompressionMethod = exports.CacheFilename = void 0; - var CacheFilename; - (function(CacheFilename2) { - CacheFilename2["Gzip"] = "cache.tgz"; - CacheFilename2["Zstd"] = "cache.tzst"; - })(CacheFilename = exports.CacheFilename || (exports.CacheFilename = {})); - var CompressionMethod; - (function(CompressionMethod2) { - CompressionMethod2["Gzip"] = "gzip"; - CompressionMethod2["ZstdWithoutLong"] = "zstd-without-long"; - CompressionMethod2["Zstd"] = "zstd"; - })(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {})); - var ArchiveToolType; - (function(ArchiveToolType2) { - ArchiveToolType2["GNU"] = "gnu"; - ArchiveToolType2["BSD"] = "bsd"; - })(ArchiveToolType = exports.ArchiveToolType || (exports.ArchiveToolType = {})); - exports.DefaultRetryAttempts = 2; - exports.DefaultRetryDelay = 5e3; - exports.SocketTimeout = 5e3; - exports.GnuTarPathOnWindows = `${process.env["PROGRAMFILES"]}\\Git\\usr\\bin\\tar.exe`; - exports.SystemTarPathOnWindows = `${process.env["SYSTEMDRIVE"]}\\Windows\\System32\\tar.exe`; - exports.TarFilename = "cache.tar"; - exports.ManifestFilename = "manifest.txt"; + if (util3.nodeMajor >= 18 && hasCrypto) { + const { WebSocket } = require_websocket(); + module.exports.WebSocket = WebSocket; + } + module.exports.request = makeDispatcher(api.request); + module.exports.stream = makeDispatcher(api.stream); + module.exports.pipeline = makeDispatcher(api.pipeline); + module.exports.connect = makeDispatcher(api.connect); + module.exports.upgrade = makeDispatcher(api.upgrade); + module.exports.MockClient = MockClient; + module.exports.MockPool = MockPool; + module.exports.MockAgent = MockAgent; + module.exports.mockErrors = mockErrors; } }); -// node_modules/@actions/cache/lib/internal/cacheUtils.js -var require_cacheUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheUtils.js"(exports) { +// node_modules/@actions/http-client/lib/index.js +var require_lib = __commonJS({ + "node_modules/@actions/http-client/lib/index.js"(exports) { "use strict"; var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { if (k22 === void 0) @@ -8504,14231 +17334,19912 @@ var require_cacheUtils = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues2 = exports && exports.__asyncValues || function(o2) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var m3 = o2[Symbol.asyncIterator], i2; - return m3 ? m3.call(o2) : (o2 = typeof __values === "function" ? __values(o2) : o2[Symbol.iterator](), i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { - return this; - }, i2); - function verb(n2) { - i2[n2] = o2[n2] && function(v2) { - return new Promise(function(resolve2, reject) { - v2 = o2[n2](v2), settle(resolve2, reject, v2.done, v2.value); - }); - }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; + var http4 = __importStar(__require("http")); + var https3 = __importStar(__require("https")); + var pm = __importStar(require_proxy()); + var tunnel2 = __importStar(require_tunnel2()); + var undici_1 = require_undici(); + var HttpCodes2; + (function(HttpCodes3) { + HttpCodes3[HttpCodes3["OK"] = 200] = "OK"; + HttpCodes3[HttpCodes3["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes3[HttpCodes3["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes3[HttpCodes3["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes3[HttpCodes3["SeeOther"] = 303] = "SeeOther"; + HttpCodes3[HttpCodes3["NotModified"] = 304] = "NotModified"; + HttpCodes3[HttpCodes3["UseProxy"] = 305] = "UseProxy"; + HttpCodes3[HttpCodes3["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes3[HttpCodes3["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes3[HttpCodes3["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes3[HttpCodes3["BadRequest"] = 400] = "BadRequest"; + HttpCodes3[HttpCodes3["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes3[HttpCodes3["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes3[HttpCodes3["Forbidden"] = 403] = "Forbidden"; + HttpCodes3[HttpCodes3["NotFound"] = 404] = "NotFound"; + HttpCodes3[HttpCodes3["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes3[HttpCodes3["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes3[HttpCodes3["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes3[HttpCodes3["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes3[HttpCodes3["Conflict"] = 409] = "Conflict"; + HttpCodes3[HttpCodes3["Gone"] = 410] = "Gone"; + HttpCodes3[HttpCodes3["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes3[HttpCodes3["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes3[HttpCodes3["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes3[HttpCodes3["BadGateway"] = 502] = "BadGateway"; + HttpCodes3[HttpCodes3["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes3[HttpCodes3["GatewayTimeout"] = 504] = "GatewayTimeout"; + })(HttpCodes2 || (exports.HttpCodes = HttpCodes2 = {})); + var Headers2; + (function(Headers3) { + Headers3["Accept"] = "accept"; + Headers3["ContentType"] = "content-type"; + })(Headers2 || (exports.Headers = Headers2 = {})); + var MediaTypes; + (function(MediaTypes2) { + MediaTypes2["ApplicationJson"] = "application/json"; + })(MediaTypes || (exports.MediaTypes = MediaTypes = {})); + function getProxyUrl(serverUrl) { + const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); + return proxyUrl ? proxyUrl.href : ""; + } + exports.getProxyUrl = getProxyUrl; + var HttpRedirectCodes = [ + HttpCodes2.MovedPermanently, + HttpCodes2.ResourceMoved, + HttpCodes2.SeeOther, + HttpCodes2.TemporaryRedirect, + HttpCodes2.PermanentRedirect + ]; + var HttpResponseRetryCodes = [ + HttpCodes2.BadGateway, + HttpCodes2.ServiceUnavailable, + HttpCodes2.GatewayTimeout + ]; + var RetryableHttpVerbs = ["OPTIONS", "GET", "DELETE", "HEAD"]; + var ExponentialBackoffCeiling = 10; + var ExponentialBackoffTimeSlice = 5; + var HttpClientError2 = class _HttpClientError extends Error { + constructor(message, statusCode) { + super(message); + this.name = "HttpClientError"; + this.statusCode = statusCode; + Object.setPrototypeOf(this, _HttpClientError.prototype); } - function settle(resolve2, reject, d2, v2) { - Promise.resolve(v2).then(function(v6) { - resolve2({ value: v6, done: d2 }); - }, reject); + }; + exports.HttpClientError = HttpClientError2; + var HttpClientResponse = class { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter(this, void 0, void 0, function* () { + let output = Buffer.alloc(0); + this.message.on("data", (chunk) => { + output = Buffer.concat([output, chunk]); + }); + this.message.on("end", () => { + resolve2(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve2(Buffer.concat(chunks)); + }); + })); + }); } }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isGhes = exports.assertDefined = exports.getGnuTarPathOnWindows = exports.getCacheFileName = exports.getCompressionMethod = exports.unlinkFile = exports.resolvePaths = exports.getArchiveFileSizeInBytes = exports.createTempDirectory = void 0; - var core2 = __importStar(require_core()); - var exec2 = __importStar(require_exec()); - var glob = __importStar(require_glob()); - var io2 = __importStar(require_io()); - var fs3 = __importStar(__require("fs")); - var path15 = __importStar(__require("path")); - var semver2 = __importStar(require_semver2()); - var util3 = __importStar(__require("util")); - var uuid_1 = require_uuid(); - var constants_1 = require_constants2(); - function createTempDirectory() { - return __awaiter(this, void 0, void 0, function* () { - const IS_WINDOWS = process.platform === "win32"; - let tempDirectory = process.env["RUNNER_TEMP"] || ""; - if (!tempDirectory) { - let baseLocation; - if (IS_WINDOWS) { - baseLocation = process.env["USERPROFILE"] || "C:\\"; - } else { - if (process.platform === "darwin") { - baseLocation = "/Users"; - } else { - baseLocation = "/home"; - } - } - tempDirectory = path15.join(baseLocation, "actions", "temp"); - } - const dest = path15.join(tempDirectory, (0, uuid_1.v4)()); - yield io2.mkdirP(dest); - return dest; - }); - } - exports.createTempDirectory = createTempDirectory; - function getArchiveFileSizeInBytes(filePath) { - return fs3.statSync(filePath).size; + exports.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; } - exports.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; - function resolvePaths(patterns) { - var _a2, e_1, _b, _c; - var _d; - return __awaiter(this, void 0, void 0, function* () { - const paths = []; - const workspace = (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); - const globber = yield glob.create(patterns.join("\n"), { - implicitDescendants: false - }); - try { - for (var _e2 = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a2 = _g.done, !_a2; ) { - _c = _g.value; - _e2 = false; - try { - const file = _c; - const relativeFile = path15.relative(workspace, file).replace(new RegExp(`\\${path15.sep}`, "g"), "/"); - core2.debug(`Matched: ${relativeFile}`); - if (relativeFile === "") { - paths.push("."); - } else { - paths.push(`${relativeFile}`); - } - } finally { - _e2 = true; - } + exports.isHttps = isHttps; + var HttpClient2 = class { + constructor(userAgent, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_e2 && !_a2 && (_b = _f.return)) - yield _b.call(_f); - } finally { - if (e_1) - throw e_1.error; + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; } - } - return paths; - }); - } - exports.resolvePaths = resolvePaths; - function unlinkFile(filePath) { - return __awaiter(this, void 0, void 0, function* () { - return util3.promisify(fs3.unlink)(filePath); - }); - } - exports.unlinkFile = unlinkFile; - function getVersion(app, additionalArgs = []) { - return __awaiter(this, void 0, void 0, function* () { - let versionOutput = ""; - additionalArgs.push("--version"); - core2.debug(`Checking ${app} ${additionalArgs.join(" ")}`); - try { - yield exec2.exec(`${app}`, additionalArgs, { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => versionOutput += data.toString(), - stderr: (data) => versionOutput += data.toString() - } - }); - } catch (err) { - core2.debug(err.message); - } - versionOutput = versionOutput.trim(); - core2.debug(versionOutput); - return versionOutput; - }); - } - function getCompressionMethod() { - return __awaiter(this, void 0, void 0, function* () { - const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version4 = semver2.clean(versionOutput); - core2.debug(`zstd version: ${version4}`); - if (versionOutput === "") { - return constants_1.CompressionMethod.Gzip; - } else { - return constants_1.CompressionMethod.ZstdWithoutLong; - } - }); - } - exports.getCompressionMethod = getCompressionMethod; - function getCacheFileName(compressionMethod) { - return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; - } - exports.getCacheFileName = getCacheFileName; - function getGnuTarPathOnWindows() { - return __awaiter(this, void 0, void 0, function* () { - if (fs3.existsSync(constants_1.GnuTarPathOnWindows)) { - return constants_1.GnuTarPathOnWindows; - } - const versionOutput = yield getVersion("tar"); - return versionOutput.toLowerCase().includes("gnu tar") ? io2.which("tar") : ""; - }); - } - exports.getGnuTarPathOnWindows = getGnuTarPathOnWindows; - function assertDefined(name2, value) { - if (value === void 0) { - throw Error(`Expected ${name2} but value was undefiend`); - } - return value; - } - exports.assertDefined = assertDefined; - function isGhes() { - const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); - return ghUrl.hostname.toUpperCase() !== "GITHUB.COM"; - } - exports.isGhes = isGhes; - } -}); - -// node_modules/@azure/core-http/dist-esm/src/httpHeaders.js -function getHeaderKey(headerName) { - return headerName.toLowerCase(); -} -function isHttpHeadersLike(object) { - if (object && typeof object === "object") { - const castObject = object; - if (typeof castObject.rawHeaders === "function" && typeof castObject.clone === "function" && typeof castObject.get === "function" && typeof castObject.set === "function" && typeof castObject.contains === "function" && typeof castObject.remove === "function" && typeof castObject.headersArray === "function" && typeof castObject.headerValues === "function" && typeof castObject.headerNames === "function" && typeof castObject.toJson === "function") { - return true; - } - } - return false; -} -var HttpHeaders; -var init_httpHeaders = __esm({ - "node_modules/@azure/core-http/dist-esm/src/httpHeaders.js"() { - HttpHeaders = class _HttpHeaders { - constructor(rawHeaders) { - this._headersMap = {}; - if (rawHeaders) { - for (const headerName in rawHeaders) { - this.set(headerName, rawHeaders[headerName]); + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; } } } - /** - * Set a header in this collection with the provided name and value. The name is - * case-insensitive. - * @param headerName - The name of the header to set. This value is case-insensitive. - * @param headerValue - The value of the header to set. - */ - set(headerName, headerValue) { - this._headersMap[getHeaderKey(headerName)] = { - name: headerName, - value: headerValue.toString() - }; + options(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); + }); } - /** - * Get the header value for the provided header name, or undefined if no header exists in this - * collection with the provided name. - * @param headerName - The name of the header. - */ - get(headerName) { - const header = this._headersMap[getHeaderKey(headerName)]; - return !header ? void 0 : header.value; + get(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); } - /** - * Get whether or not this header collection contains a header entry for the provided header name. - */ - contains(headerName) { - return !!this._headersMap[getHeaderKey(headerName)]; + del(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); } - /** - * Remove the header with the provided headerName. Return whether or not the header existed and - * was removed. - * @param headerName - The name of the header to remove. - */ - remove(headerName) { - const result = this.contains(headerName); - delete this._headersMap[getHeaderKey(headerName)]; - return result; + post(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); + }); + } + patch(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); + } + put(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); + } + head(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, additionalHeaders); + }); } /** - * Get the headers that are contained this collection as an object. + * Gets a typed object from an endpoint + * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ - rawHeaders() { - return this.toJson({ preserveCase: true }); + getJson(requestUrl, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); + const res = yield this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + postJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.ContentType, MediaTypes.ApplicationJson); + const res = yield this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + putJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.ContentType, MediaTypes.ApplicationJson); + const res = yield this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + patchJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.ContentType, MediaTypes.ApplicationJson); + const res = yield this.patch(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); } /** - * Get the headers that are contained in this collection as an array. + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch */ - headersArray() { - const headers = []; - for (const headerKey in this._headersMap) { - headers.push(this._headersMap[headerKey]); - } - return headers; + request(verb, requestUrl, data, headers) { + return __awaiter(this, void 0, void 0, function* () { + if (this._disposed) { + throw new Error("Client has already been disposed."); + } + const parsedUrl = new URL(requestUrl); + let info3 = this._prepareRequest(verb, parsedUrl, headers); + const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; + let numTries = 0; + let response; + do { + response = yield this.requestRaw(info3, data); + if (response && response.message && response.message.statusCode === HttpCodes2.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info3, data); + } else { + return response; + } + } + let redirectsRemaining = this._maxRedirects; + while (response.message.statusCode && HttpRedirectCodes.includes(response.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) { + const redirectUrl = response.message.headers["location"]; + if (!redirectUrl) { + break; + } + const parsedRedirectUrl = new URL(redirectUrl); + if (parsedUrl.protocol === "https:" && parsedUrl.protocol !== parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { + throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); + } + yield response.readBody(); + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const header in headers) { + if (header.toLowerCase() === "authorization") { + delete headers[header]; + } + } + } + info3 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info3, data); + redirectsRemaining--; + } + if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { + return response; + } + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); + } + } while (numTries < maxTries); + return response; + }); } /** - * Get the header names that are contained in this collection. + * Needs to be called if keepAlive is set to true in request options. */ - headerNames() { - const headerNames = []; - const headers = this.headersArray(); - for (let i2 = 0; i2 < headers.length; ++i2) { - headerNames.push(headers[i2].name); + dispose() { + if (this._agent) { + this._agent.destroy(); } - return headerNames; + this._disposed = true; } /** - * Get the header values that are contained in this collection. + * Raw request. + * @param info + * @param data */ - headerValues() { - const headerValues = []; - const headers = this.headersArray(); - for (let i2 = 0; i2 < headers.length; ++i2) { - headerValues.push(headers[i2].value); - } - return headerValues; + requestRaw(info3, data) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve2(res); + } + } + this.requestRawWithCallback(info3, data, callbackForResult); + }); + }); } /** - * Get the JSON object representation of this HTTP header collection. + * Raw request with callback. + * @param info + * @param data + * @param onResult */ - toJson(options = {}) { - const result = {}; - if (options.preserveCase) { - for (const headerKey in this._headersMap) { - const header = this._headersMap[headerKey]; - result[header.name] = header.value; + requestRawWithCallback(info3, data, onResult) { + if (typeof data === "string") { + if (!info3.options.headers) { + info3.options.headers = {}; } - } else { - for (const headerKey in this._headersMap) { - const header = this._headersMap[headerKey]; - result[getHeaderKey(header.name)] = header.value; + info3.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); } } - return result; + const req = info3.httpModule.request(info3.options, (msg) => { + const res = new HttpClientResponse(msg); + handleResult(void 0, res); + }); + let socket; + req.on("socket", (sock) => { + socket = sock; + }); + req.setTimeout(this._socketTimeout || 3 * 6e4, () => { + if (socket) { + socket.end(); + } + handleResult(new Error(`Request timeout: ${info3.options.path}`)); + }); + req.on("error", function(err) { + handleResult(err); + }); + if (data && typeof data === "string") { + req.write(data, "utf8"); + } + if (data && typeof data !== "string") { + data.on("close", function() { + req.end(); + }); + data.pipe(req); + } else { + req.end(); + } } /** - * Get the string representation of this HTTP header collection. + * Gets an http agent. This function is useful when you need an http agent that handles + * routing through a proxy server - depending upon the url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ - toString() { - return JSON.stringify(this.toJson({ preserveCase: true })); + getAgent(serverUrl) { + const parsedUrl = new URL(serverUrl); + return this._getAgent(parsedUrl); } - /** - * Create a deep clone/copy of this HttpHeaders collection. - */ - clone() { - const resultPreservingCasing = {}; - for (const headerKey in this._headersMap) { - const header = this._headersMap[headerKey]; - resultPreservingCasing[header.name] = header.value; + getAgentDispatcher(serverUrl) { + const parsedUrl = new URL(serverUrl); + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (!useProxy) { + return; } - return new _HttpHeaders(resultPreservingCasing); + return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); } - }; - } -}); - -// node_modules/@azure/core-http/dist-esm/src/util/base64.js -function encodeByteArray(value) { - const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); -} -function decodeString(value) { - return Buffer.from(value, "base64"); -} -var init_base64 = __esm({ - "node_modules/@azure/core-http/dist-esm/src/util/base64.js"() { - } -}); - -// node_modules/@azure/core-http/dist-esm/src/util/constants.js -var Constants; -var init_constants = __esm({ - "node_modules/@azure/core-http/dist-esm/src/util/constants.js"() { - Constants = { - /** - * The core-http version - */ - coreHttpVersion: "3.0.2", - /** - * Specifies HTTP. - */ - HTTP: "http:", - /** - * Specifies HTTPS. - */ - HTTPS: "https:", - /** - * Specifies HTTP Proxy. - */ - HTTP_PROXY: "HTTP_PROXY", - /** - * Specifies HTTPS Proxy. - */ - HTTPS_PROXY: "HTTPS_PROXY", - /** - * Specifies NO Proxy. - */ - NO_PROXY: "NO_PROXY", - /** - * Specifies ALL Proxy. - */ - ALL_PROXY: "ALL_PROXY", - HttpConstants: { - /** - * Http Verbs - */ - HttpVerbs: { - PUT: "PUT", - GET: "GET", - DELETE: "DELETE", - POST: "POST", - MERGE: "MERGE", - HEAD: "HEAD", - PATCH: "PATCH" - }, - StatusCodes: { - TooManyRequests: 429, - ServiceUnavailable: 503 + _prepareRequest(method, requestUrl, headers) { + const info3 = {}; + info3.parsedUrl = requestUrl; + const usingSsl = info3.parsedUrl.protocol === "https:"; + info3.httpModule = usingSsl ? https3 : http4; + const defaultPort = usingSsl ? 443 : 80; + info3.options = {}; + info3.options.host = info3.parsedUrl.hostname; + info3.options.port = info3.parsedUrl.port ? parseInt(info3.parsedUrl.port) : defaultPort; + info3.options.path = (info3.parsedUrl.pathname || "") + (info3.parsedUrl.search || ""); + info3.options.method = method; + info3.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info3.options.headers["user-agent"] = this.userAgent; } - }, - /** - * Defines constants for use with HTTP headers. - */ - HeaderConstants: { - /** - * The Authorization header. - */ - AUTHORIZATION: "authorization", - AUTHORIZATION_SCHEME: "Bearer", - /** - * The Retry-After response-header field can be used with a 503 (Service - * Unavailable) or 349 (Too Many Requests) responses to indicate how long - * the service is expected to be unavailable to the requesting client. - */ - RETRY_AFTER: "Retry-After", - /** - * The UserAgent header. - */ - USER_AGENT: "User-Agent" + info3.options.agent = this._getAgent(info3.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info3.options); + } + } + return info3; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; + } + if (!useProxy) { + agent = this._agent; + } + if (agent) { + return agent; + } + const usingSsl = parsedUrl.protocol === "https:"; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http4.globalAgent.maxSockets; + } + if (proxyUrl && proxyUrl.hostname) { + const agentOptions = { + maxSockets, + keepAlive: this._keepAlive, + proxy: Object.assign(Object.assign({}, (proxyUrl.username || proxyUrl.password) && { + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` + }), { host: proxyUrl.hostname, port: proxyUrl.port }) + }; + let tunnelAgent; + const overHttps = proxyUrl.protocol === "https:"; + if (usingSsl) { + tunnelAgent = overHttps ? tunnel2.httpsOverHttps : tunnel2.httpsOverHttp; + } else { + tunnelAgent = overHttps ? tunnel2.httpOverHttps : tunnel2.httpOverHttp; + } + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https3.Agent(options) : new http4.Agent(options); + this._agent = agent; + } + if (usingSsl && this._ignoreSslError) { + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); + } + return agent; + } + _getProxyAgentDispatcher(parsedUrl, proxyUrl) { + let proxyAgent; + if (this._keepAlive) { + proxyAgent = this._proxyAgentDispatcher; + } + if (proxyAgent) { + return proxyAgent; + } + const usingSsl = parsedUrl.protocol === "https:"; + proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, (proxyUrl.username || proxyUrl.password) && { + token: `${proxyUrl.username}:${proxyUrl.password}` + })); + this._proxyAgentDispatcher = proxyAgent; + if (usingSsl && this._ignoreSslError) { + proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { + rejectUnauthorized: false + }); + } + return proxyAgent; + } + _performExponentialBackoff(retryNumber) { + return __awaiter(this, void 0, void 0, function* () { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes2.NotFound) { + resolve2(response); + } + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a2 = new Date(value); + if (!isNaN(a2.valueOf())) { + return a2; + } + } + return value; + } + let obj; + let contents; + try { + contents = yield res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, dateTimeDeserializer); + } else { + obj = JSON.parse(contents); + } + response.result = obj; + } + response.headers = res.message.headers; + } catch (err) { + } + if (statusCode > 299) { + let msg; + if (obj && obj.message) { + msg = obj.message; + } else if (contents && contents.length > 0) { + msg = contents; + } else { + msg = `Failed request: (${statusCode})`; + } + const err = new HttpClientError2(msg, statusCode); + err.result = response.result; + reject(err); + } else { + resolve2(response); + } + })); + }); } }; + exports.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c2, k2) => (c2[k2.toLowerCase()] = obj[k2], c2), {}); } }); -// node_modules/@azure/core-http/dist-esm/src/util/serializer.common.js -var XML_ATTRKEY, XML_CHARKEY; -var init_serializer_common = __esm({ - "node_modules/@azure/core-http/dist-esm/src/util/serializer.common.js"() { - XML_ATTRKEY = "$"; - XML_CHARKEY = "_"; - } -}); - -// node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/rng.js -import crypto4 from "crypto"; -function rng2() { - if (poolPtr2 > rnds8Pool2.length - 16) { - crypto4.randomFillSync(rnds8Pool2); - poolPtr2 = 0; - } - return rnds8Pool2.slice(poolPtr2, poolPtr2 += 16); -} -var rnds8Pool2, poolPtr2; -var init_rng2 = __esm({ - "node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/rng.js"() { - rnds8Pool2 = new Uint8Array(256); - poolPtr2 = rnds8Pool2.length; - } -}); - -// node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/regex.js -var regex_default2; -var init_regex2 = __esm({ - "node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/regex.js"() { - regex_default2 = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; - } -}); - -// node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/validate.js -function validate2(uuid) { - return typeof uuid === "string" && regex_default2.test(uuid); -} -var validate_default2; -var init_validate2 = __esm({ - "node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/validate.js"() { - init_regex2(); - validate_default2 = validate2; - } -}); - -// node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/stringify.js -function stringify2(arr, offset = 0) { - const uuid = (byteToHex2[arr[offset + 0]] + byteToHex2[arr[offset + 1]] + byteToHex2[arr[offset + 2]] + byteToHex2[arr[offset + 3]] + "-" + byteToHex2[arr[offset + 4]] + byteToHex2[arr[offset + 5]] + "-" + byteToHex2[arr[offset + 6]] + byteToHex2[arr[offset + 7]] + "-" + byteToHex2[arr[offset + 8]] + byteToHex2[arr[offset + 9]] + "-" + byteToHex2[arr[offset + 10]] + byteToHex2[arr[offset + 11]] + byteToHex2[arr[offset + 12]] + byteToHex2[arr[offset + 13]] + byteToHex2[arr[offset + 14]] + byteToHex2[arr[offset + 15]]).toLowerCase(); - if (!validate_default2(uuid)) { - throw TypeError("Stringified UUID is invalid"); - } - return uuid; -} -var byteToHex2, stringify_default2; -var init_stringify2 = __esm({ - "node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/stringify.js"() { - init_validate2(); - byteToHex2 = []; - for (let i2 = 0; i2 < 256; ++i2) { - byteToHex2.push((i2 + 256).toString(16).substr(1)); - } - stringify_default2 = stringify2; - } -}); - -// node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/v4.js -function v42(options, buf, offset) { - options = options || {}; - const rnds = options.random || (options.rng || rng2)(); - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - offset = offset || 0; - for (let i2 = 0; i2 < 16; ++i2) { - buf[offset + i2] = rnds[i2]; - } - return buf; - } - return stringify_default2(rnds); -} -var v4_default2; -var init_v42 = __esm({ - "node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/v4.js"() { - init_rng2(); - init_stringify2(); - v4_default2 = v42; - } -}); - -// node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/index.js -var init_esm_node2 = __esm({ - "node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/index.js"() { - init_v42(); - } -}); - -// node_modules/@azure/core-http/dist-esm/src/util/utils.js -function isValidUuid(uuid) { - return validUuidRegex.test(uuid); -} -function generateUuid() { - return v4_default2(); -} -function prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { - if (!Array.isArray(obj)) { - obj = [obj]; - } - if (!xmlNamespaceKey || !xmlNamespace) { - return { [elementName]: obj }; - } - const result = { [elementName]: obj }; - result[XML_ATTRKEY] = { [xmlNamespaceKey]: xmlNamespace }; - return result; -} -function isDuration(value) { - return validateISODuration.test(value); -} -function replaceAll(value, searchValue, replaceValue) { - return !value || !searchValue ? value : value.split(searchValue).join(replaceValue || ""); -} -function isPrimitiveType(value) { - return typeof value !== "object" && typeof value !== "function" || value === null; -} -function getEnvironmentValue(name2) { - if (process.env[name2]) { - return process.env[name2]; - } else if (process.env[name2.toLowerCase()]) { - return process.env[name2.toLowerCase()]; - } - return void 0; -} -function isObject(input) { - return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); -} -var validUuidRegex, validateISODuration; -var init_utils = __esm({ - "node_modules/@azure/core-http/dist-esm/src/util/utils.js"() { - init_serializer_common(); - init_esm_node2(); - validUuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i; - validateISODuration = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; - } -}); - -// node_modules/@azure/core-http/dist-esm/src/serializer.js -function trimEnd(str, ch) { - let len = str.length; - while (len - 1 >= 0 && str[len - 1] === ch) { - --len; - } - return str.substr(0, len); -} -function bufferToBase64Url(buffer) { - if (!buffer) { - return void 0; - } - if (!(buffer instanceof Uint8Array)) { - throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); - } - const str = encodeByteArray(buffer); - return trimEnd(str, "=").replace(/\+/g, "-").replace(/\//g, "_"); -} -function base64UrlToByteArray(str) { - if (!str) { - return void 0; - } - if (str && typeof str.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); - } - str = str.replace(/-/g, "+").replace(/_/g, "/"); - return decodeString(str); -} -function splitSerializeName(prop) { - const classes = []; - let partialclass = ""; - if (prop) { - const subwords = prop.split("."); - for (const item of subwords) { - if (item.charAt(item.length - 1) === "\\") { - partialclass += item.substr(0, item.length - 1) + "."; - } else { - partialclass += item; - classes.push(partialclass); - partialclass = ""; +// node_modules/@actions/http-client/lib/auth.js +var require_auth = __commonJS({ + "node_modules/@actions/http-client/lib/auth.js"(exports) { + "use strict"; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve2) { + resolve2(value); + }); } - } - } - return classes; -} -function dateToUnixTime(d2) { - if (!d2) { - return void 0; - } - if (typeof d2.valueOf() === "string") { - d2 = new Date(d2); - } - return Math.floor(d2.getTime() / 1e3); -} -function unixTimeToDate(n2) { - if (!n2) { - return void 0; - } - return new Date(n2 * 1e3); -} -function serializeBasicTypes(typeName, objectName, value) { - if (value !== null && value !== void 0) { - if (typeName.match(/^Number$/i) !== null) { - if (typeof value !== "number") { - throw new Error(`${objectName} with value ${value} must be of type number.`); + return new (P2 || (P2 = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; + var BasicCredentialHandler = class { + constructor(username, password) { + this.username = username; + this.password = password; } - } else if (typeName.match(/^String$/i) !== null) { - if (typeof value.valueOf() !== "string") { - throw new Error(`${objectName} with value "${value}" must be of type string.`); + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - } else if (typeName.match(/^Uuid$/i) !== null) { - if (!(typeof value.valueOf() === "string" && isValidUuid(value))) { - throw new Error(`${objectName} with value "${value}" must be of type string and a valid uuid.`); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - } else if (typeName.match(/^Boolean$/i) !== null) { - if (typeof value !== "boolean") { - throw new Error(`${objectName} with value ${value} must be of type boolean.`); + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - } else if (typeName.match(/^Stream$/i) !== null) { - const objectType = typeof value; - if (objectType !== "string" && objectType !== "function" && !(value instanceof ArrayBuffer) && !ArrayBuffer.isView(value) && !((typeof Blob === "function" || typeof Blob === "object") && value instanceof Blob)) { - throw new Error(`${objectName} must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream.`); + }; + exports.BasicCredentialHandler = BasicCredentialHandler; + var BearerCredentialHandler = class { + constructor(token) { + this.token = token; } - } - } - return value; -} -function serializeEnumType(objectName, allowedValues, value) { - if (!allowedValues) { - throw new Error(`Please provide a set of allowedValues to validate ${objectName} as an Enum Type.`); - } - const isPresent = allowedValues.some((item) => { - if (typeof item.valueOf() === "string") { - return item.toLowerCase() === value.toLowerCase(); - } - return item === value; - }); - if (!isPresent) { - throw new Error(`${value} is not a valid value for ${objectName}. The valid values are: ${JSON.stringify(allowedValues)}.`); - } - return value; -} -function serializeByteArrayType(objectName, value) { - let returnValue = ""; - if (value != void 0) { - if (!(value instanceof Uint8Array)) { - throw new Error(`${objectName} must be of type Uint8Array.`); - } - returnValue = encodeByteArray(value); - } - return returnValue; -} -function serializeBase64UrlType(objectName, value) { - let returnValue = ""; - if (value != void 0) { - if (!(value instanceof Uint8Array)) { - throw new Error(`${objectName} must be of type Uint8Array.`); - } - returnValue = bufferToBase64Url(value) || ""; - } - return returnValue; -} -function serializeDateTypes(typeName, value, objectName) { - if (value != void 0) { - if (typeName.match(/^Date$/i) !== null) { - if (!(value instanceof Date || typeof value.valueOf() === "string" && !isNaN(Date.parse(value)))) { - throw new Error(`${objectName} must be an instanceof Date or a string in ISO8601 format.`); + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Bearer ${this.token}`; } - value = value instanceof Date ? value.toISOString().substring(0, 10) : new Date(value).toISOString().substring(0, 10); - } else if (typeName.match(/^DateTime$/i) !== null) { - if (!(value instanceof Date || typeof value.valueOf() === "string" && !isNaN(Date.parse(value)))) { - throw new Error(`${objectName} must be an instanceof Date or a string in ISO8601 format.`); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - value = value instanceof Date ? value.toISOString() : new Date(value).toISOString(); - } else if (typeName.match(/^DateTimeRfc1123$/i) !== null) { - if (!(value instanceof Date || typeof value.valueOf() === "string" && !isNaN(Date.parse(value)))) { - throw new Error(`${objectName} must be an instanceof Date or a string in RFC-1123 format.`); + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - value = value instanceof Date ? value.toUTCString() : new Date(value).toUTCString(); - } else if (typeName.match(/^UnixTime$/i) !== null) { - if (!(value instanceof Date || typeof value.valueOf() === "string" && !isNaN(Date.parse(value)))) { - throw new Error(`${objectName} must be an instanceof Date or a string in RFC-1123/ISO8601 format for it to be serialized in UnixTime/Epoch format.`); + }; + exports.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - value = dateToUnixTime(value); - } else if (typeName.match(/^TimeSpan$/i) !== null) { - if (!isDuration(value)) { - throw new Error(`${objectName} must be a string in ISO 8601 format. Instead was "${value}".`); + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; } - } - } - return value; -} -function serializeSequenceType(serializer4, mapper, object, objectName, isXml, options) { - if (!Array.isArray(object)) { - throw new Error(`${objectName} must be of type Array.`); - } - const elementType = mapper.type.element; - if (!elementType || typeof elementType !== "object") { - throw new Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${objectName}.`); - } - const tempArray = []; - for (let i2 = 0; i2 < object.length; i2++) { - const serializedValue = serializer4.serialize(elementType, object[i2], objectName, options); - if (isXml && elementType.xmlNamespace) { - const xmlnsKey = elementType.xmlNamespacePrefix ? `xmlns:${elementType.xmlNamespacePrefix}` : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i2] = Object.assign({}, serializedValue); - tempArray[i2][XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; - } else { - tempArray[i2] = {}; - tempArray[i2][options.xmlCharKey] = serializedValue; - tempArray[i2][XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - } else { - tempArray[i2] = serializedValue; - } - } - return tempArray; -} -function serializeDictionaryType(serializer4, mapper, object, objectName, isXml, options) { - if (typeof object !== "object") { - throw new Error(`${objectName} must be of type object.`); - } - const valueType = mapper.type.value; - if (!valueType || typeof valueType !== "object") { - throw new Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${objectName}.`); - } - const tempDictionary = {}; - for (const key of Object.keys(object)) { - const serializedValue = serializer4.serialize(valueType, object[key], objectName, options); - tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); - } - if (isXml && mapper.xmlNamespace) { - const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; - const result = tempDictionary; - result[XML_ATTRKEY] = { [xmlnsKey]: mapper.xmlNamespace }; - return result; - } - return tempDictionary; -} -function resolveAdditionalProperties(serializer4, mapper, objectName) { - const additionalProperties = mapper.type.additionalProperties; - if (!additionalProperties && mapper.type.className) { - const modelMapper = resolveReferencedMapper(serializer4, mapper, objectName); - return modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; - } - return additionalProperties; -} -function resolveReferencedMapper(serializer4, mapper, objectName) { - const className = mapper.type.className; - if (!className) { - throw new Error(`Class name for model "${objectName}" is not provided in the mapper "${JSON.stringify(mapper, void 0, 2)}".`); - } - return serializer4.modelMappers[className]; -} -function resolveModelProperties(serializer4, mapper, objectName) { - let modelProps = mapper.type.modelProperties; - if (!modelProps) { - const modelMapper = resolveReferencedMapper(serializer4, mapper, objectName); - if (!modelMapper) { - throw new Error(`mapper() cannot be null or undefined for model "${mapper.type.className}".`); - } - modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.modelProperties; - if (!modelProps) { - throw new Error(`modelProperties cannot be null or undefined in the mapper "${JSON.stringify(modelMapper)}" of type "${mapper.type.className}" for object "${objectName}".`); - } - } - return modelProps; -} -function serializeCompositeType(serializer4, mapper, object, objectName, isXml, options) { - if (getPolymorphicDiscriminatorRecursively(serializer4, mapper)) { - mapper = getPolymorphicMapper(serializer4, mapper, object, "clientName"); + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); + } + }; + exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; } - if (object != void 0) { - const payload = {}; - const modelProps = resolveModelProperties(serializer4, mapper, objectName); - for (const key of Object.keys(modelProps)) { - const propertyMapper = modelProps[key]; - if (propertyMapper.readOnly) { - continue; +}); + +// node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils = __commonJS({ + "node_modules/@actions/core/lib/oidc-utils.js"(exports) { + "use strict"; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve2) { + resolve2(value); + }); } - let propName; - let parentObject = payload; - if (serializer4.isXML) { - if (propertyMapper.xmlIsWrapped) { - propName = propertyMapper.xmlName; - } else { - propName = propertyMapper.xmlElementName || propertyMapper.xmlName; - } - } else { - const paths = splitSerializeName(propertyMapper.serializedName); - propName = paths.pop(); - for (const pathName of paths) { - const childObject = parentObject[pathName]; - if (childObject == void 0 && (object[key] != void 0 || propertyMapper.defaultValue !== void 0)) { - parentObject[pathName] = {}; + return new (P2 || (P2 = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e2) { + reject(e2); } - parentObject = parentObject[pathName]; } - } - if (parentObject != void 0) { - if (isXml && mapper.xmlNamespace) { - const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; - parentObject[XML_ATTRKEY] = Object.assign(Object.assign({}, parentObject[XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace }); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); + } } - const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; - let toSerialize = object[key]; - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer4, mapper); - if (polymorphicDiscriminator && polymorphicDiscriminator.clientName === key && toSerialize == void 0) { - toSerialize = mapper.serializedName; - } - const serializedValue = serializer4.serialize(propertyMapper, toSerialize, propertyObjectName, options); - if (serializedValue !== void 0 && propName != void 0) { - const value = getXmlObjectValue(propertyMapper, serializedValue, isXml, options); - if (isXml && propertyMapper.xmlIsAttribute) { - parentObject[XML_ATTRKEY] = parentObject[XML_ATTRKEY] || {}; - parentObject[XML_ATTRKEY][propName] = serializedValue; - } else if (isXml && propertyMapper.xmlIsWrapped) { - parentObject[propName] = { [propertyMapper.xmlElementName]: value }; - } else { - parentObject[propName] = value; - } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OidcClient = void 0; + var http_client_1 = require_lib(); + var auth_1 = require_auth(); + var core_1 = require_core(); + var OidcClient = class _OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry + }; + return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(_OidcClient.getRequestToken())], requestOptions); } - } - const additionalPropertiesMapper = resolveAdditionalProperties(serializer4, mapper, objectName); - if (additionalPropertiesMapper) { - const propNames = Object.keys(modelProps); - for (const clientPropName in object) { - const isAdditionalProperty = propNames.every((pn2) => pn2 !== clientPropName); - if (isAdditionalProperty) { - payload[clientPropName] = serializer4.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + static getRequestToken() { + const token = process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"]; + if (!token) { + throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable"); } + return token; } - } - return payload; - } - return object; -} -function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { - if (!isXml || !propertyMapper.xmlNamespace) { - return serializedValue; - } - const xmlnsKey = propertyMapper.xmlNamespacePrefix ? `xmlns:${propertyMapper.xmlNamespacePrefix}` : "xmlns"; - const xmlNamespace = { [xmlnsKey]: propertyMapper.xmlNamespace }; - if (["Composite"].includes(propertyMapper.type.name)) { - if (serializedValue[XML_ATTRKEY]) { - return serializedValue; - } else { - const result2 = Object.assign({}, serializedValue); - result2[XML_ATTRKEY] = xmlNamespace; - return result2; - } - } - const result = {}; - result[options.xmlCharKey] = serializedValue; - result[XML_ATTRKEY] = xmlNamespace; - return result; -} -function isSpecialXmlProperty(propertyName, options) { - return [XML_ATTRKEY, options.xmlCharKey].includes(propertyName); -} -function deserializeCompositeType(serializer4, mapper, responseBody, objectName, options) { - var _a2, _b; - const xmlCharKey = (_a2 = options.xmlCharKey) !== null && _a2 !== void 0 ? _a2 : XML_CHARKEY; - if (getPolymorphicDiscriminatorRecursively(serializer4, mapper)) { - mapper = getPolymorphicMapper(serializer4, mapper, responseBody, "serializedName"); - } - const modelProps = resolveModelProperties(serializer4, mapper, objectName); - let instance = {}; - const handledPropertyNames = []; - for (const key of Object.keys(modelProps)) { - const propertyMapper = modelProps[key]; - const paths = splitSerializeName(modelProps[key].serializedName); - handledPropertyNames.push(paths[0]); - const { serializedName, xmlName, xmlElementName } = propertyMapper; - let propertyObjectName = objectName; - if (serializedName !== "" && serializedName !== void 0) { - propertyObjectName = objectName + "." + serializedName; - } - const headerCollectionPrefix = propertyMapper.headerCollectionPrefix; - if (headerCollectionPrefix) { - const dictionary = {}; - for (const headerKey of Object.keys(responseBody)) { - if (headerKey.startsWith(headerCollectionPrefix)) { - dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer4.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName, options); + static getIDTokenUrl() { + const runtimeUrl = process.env["ACTIONS_ID_TOKEN_REQUEST_URL"]; + if (!runtimeUrl) { + throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable"); } - handledPropertyNames.push(headerKey); + return runtimeUrl; } - instance[key] = dictionary; - } else if (serializer4.isXML) { - if (propertyMapper.xmlIsAttribute && responseBody[XML_ATTRKEY]) { - instance[key] = serializer4.deserialize(propertyMapper, responseBody[XML_ATTRKEY][xmlName], propertyObjectName, options); - } else if (propertyMapper.xmlIsMsText) { - if (responseBody[xmlCharKey] !== void 0) { - instance[key] = responseBody[xmlCharKey]; - } else if (typeof responseBody === "string") { - instance[key] = responseBody; - } - } else { - const propertyName = xmlElementName || xmlName || serializedName; - if (propertyMapper.xmlIsWrapped) { - const wrapped = responseBody[xmlName]; - const elementList = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : []; - instance[key] = serializer4.deserialize(propertyMapper, elementList, propertyObjectName, options); - handledPropertyNames.push(xmlName); - } else { - const property = responseBody[propertyName]; - instance[key] = serializer4.deserialize(propertyMapper, property, propertyObjectName, options); - handledPropertyNames.push(propertyName); - } + static getCall(id_token_url) { + var _a2; + return __awaiter(this, void 0, void 0, function* () { + const httpclient = _OidcClient.createHttpClient(); + const res = yield httpclient.getJson(id_token_url).catch((error) => { + throw new Error(`Failed to get ID Token. + + Error Code : ${error.statusCode} + + Error Message: ${error.message}`); + }); + const id_token = (_a2 = res.result) === null || _a2 === void 0 ? void 0 : _a2.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); + } + return id_token; + }); } - } else { - let propertyInstance; - let res = responseBody; - for (const item of paths) { - if (!res) - break; - res = res[item]; + static getIDToken(audience) { + return __awaiter(this, void 0, void 0, function* () { + try { + let id_token_url = _OidcClient.getIDTokenUrl(); + if (audience) { + const encodedAudience = encodeURIComponent(audience); + id_token_url = `${id_token_url}&audience=${encodedAudience}`; + } + core_1.debug(`ID token url is ${id_token_url}`); + const id_token = yield _OidcClient.getCall(id_token_url); + core_1.setSecret(id_token); + return id_token; + } catch (error) { + throw new Error(`Error message: ${error.message}`); + } + }); } - propertyInstance = res; - const polymorphicDiscriminator = mapper.type.polymorphicDiscriminator; - if (polymorphicDiscriminator && key === polymorphicDiscriminator.clientName && propertyInstance == void 0) { - propertyInstance = mapper.serializedName; + }; + exports.OidcClient = OidcClient; + } +}); + +// node_modules/@actions/core/lib/summary.js +var require_summary = __commonJS({ + "node_modules/@actions/core/lib/summary.js"(exports) { + "use strict"; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve2) { + resolve2(value); + }); } - let serializedValue; - if (Array.isArray(responseBody[key]) && modelProps[key].serializedName === "") { - propertyInstance = responseBody[key]; - const arrayInstance = serializer4.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); - for (const [k2, v2] of Object.entries(instance)) { - if (!Object.prototype.hasOwnProperty.call(arrayInstance, k2)) { - arrayInstance[k2] = v2; + return new (P2 || (P2 = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e2) { + reject(e2); } } - instance = arrayInstance; - } else if (propertyInstance !== void 0 || propertyMapper.defaultValue !== void 0) { - serializedValue = serializer4.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); - instance[key] = serializedValue; - } - } - } - const additionalPropertiesMapper = mapper.type.additionalProperties; - if (additionalPropertiesMapper) { - const isAdditionalProperty = (responsePropName) => { - for (const clientPropName in modelProps) { - const paths = splitSerializeName(modelProps[clientPropName].serializedName); - if (paths[0] === responsePropName) { - return false; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); + } } - } - return true; - }; - for (const responsePropName in responseBody) { - if (isAdditionalProperty(responsePropName)) { - instance[responsePropName] = serializer4.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '["' + responsePropName + '"]', options); - } - } - } else if (responseBody) { - for (const key of Object.keys(responseBody)) { - if (instance[key] === void 0 && !handledPropertyNames.includes(key) && !isSpecialXmlProperty(key, options)) { - instance[key] = responseBody[key]; - } - } - } - return instance; -} -function deserializeDictionaryType(serializer4, mapper, responseBody, objectName, options) { - const value = mapper.type.value; - if (!value || typeof value !== "object") { - throw new Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${objectName}`); - } - if (responseBody) { - const tempDictionary = {}; - for (const key of Object.keys(responseBody)) { - tempDictionary[key] = serializer4.deserialize(value, responseBody[key], objectName, options); - } - return tempDictionary; - } - return responseBody; -} -function deserializeSequenceType(serializer4, mapper, responseBody, objectName, options) { - const element = mapper.type.element; - if (!element || typeof element !== "object") { - throw new Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${objectName}`); - } - if (responseBody) { - if (!Array.isArray(responseBody)) { - responseBody = [responseBody]; - } - const tempArray = []; - for (let i2 = 0; i2 < responseBody.length; i2++) { - tempArray[i2] = serializer4.deserialize(element, responseBody[i2], `${objectName}[${i2}]`, options); - } - return tempArray; - } - return responseBody; -} -function getPolymorphicMapper(serializer4, mapper, object, polymorphicPropertyName) { - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer4, mapper); - if (polymorphicDiscriminator) { - const discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName != void 0) { - const discriminatorValue = object[discriminatorName]; - if (discriminatorValue != void 0) { - const typeName = mapper.type.uberParent || mapper.type.className; - const indexDiscriminator = discriminatorValue === typeName ? discriminatorValue : typeName + "." + discriminatorValue; - const polymorphicMapper = serializer4.modelMappers.discriminators[indexDiscriminator]; - if (polymorphicMapper) { - mapper = polymorphicMapper; + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - } - } - return mapper; -} -function getPolymorphicDiscriminatorRecursively(serializer4, mapper) { - return mapper.type.polymorphicDiscriminator || getPolymorphicDiscriminatorSafely(serializer4, mapper.type.uberParent) || getPolymorphicDiscriminatorSafely(serializer4, mapper.type.className); -} -function getPolymorphicDiscriminatorSafely(serializer4, typeName) { - return typeName && serializer4.modelMappers[typeName] && serializer4.modelMappers[typeName].type.polymorphicDiscriminator; -} -function strEnum(o2) { - const result = {}; - for (const key of o2) { - result[key] = key; - } - return result; -} -var Serializer, MapperType; -var init_serializer = __esm({ - "node_modules/@azure/core-http/dist-esm/src/serializer.js"() { - init_base64(); - init_utils(); - init_serializer_common(); - Serializer = class { - constructor(modelMappers = {}, isXML) { - this.modelMappers = modelMappers; - this.isXML = isXML; + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; + var os_1 = __require("os"); + var fs_1 = __require("fs"); + var { access: access2, appendFile, writeFile: writeFile3 } = fs_1.promises; + exports.SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; + exports.SUMMARY_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary"; + var Summary = class { + constructor() { + this._buffer = ""; } /** - * Validates constraints, if any. This function will throw if the provided value does not respect those constraints. - * @param mapper - The definition of data models. - * @param value - The value. - * @param objectName - Name of the object. Used in the error messages. - * @deprecated Removing the constraints validation on client side. + * Finds the summary file path from the environment, rejects if env var is not found or file does not exist + * Also checks r/w permissions. + * + * @returns step summary file path */ - validateConstraints(mapper, value, objectName) { - const failValidation = (constraintName, constraintValue) => { - throw new Error(`"${objectName}" with value "${value}" should satisfy the constraint "${constraintName}": ${constraintValue}.`); - }; - if (mapper.constraints && value != void 0) { - const valueAsNumber = value; - const { ExclusiveMaximum, ExclusiveMinimum, InclusiveMaximum, InclusiveMinimum, MaxItems, MaxLength, MinItems, MinLength, MultipleOf, Pattern, UniqueItems } = mapper.constraints; - if (ExclusiveMaximum != void 0 && valueAsNumber >= ExclusiveMaximum) { - failValidation("ExclusiveMaximum", ExclusiveMaximum); - } - if (ExclusiveMinimum != void 0 && valueAsNumber <= ExclusiveMinimum) { - failValidation("ExclusiveMinimum", ExclusiveMinimum); - } - if (InclusiveMaximum != void 0 && valueAsNumber > InclusiveMaximum) { - failValidation("InclusiveMaximum", InclusiveMaximum); - } - if (InclusiveMinimum != void 0 && valueAsNumber < InclusiveMinimum) { - failValidation("InclusiveMinimum", InclusiveMinimum); - } - const valueAsArray = value; - if (MaxItems != void 0 && valueAsArray.length > MaxItems) { - failValidation("MaxItems", MaxItems); - } - if (MaxLength != void 0 && valueAsArray.length > MaxLength) { - failValidation("MaxLength", MaxLength); - } - if (MinItems != void 0 && valueAsArray.length < MinItems) { - failValidation("MinItems", MinItems); - } - if (MinLength != void 0 && valueAsArray.length < MinLength) { - failValidation("MinLength", MinLength); - } - if (MultipleOf != void 0 && valueAsNumber % MultipleOf !== 0) { - failValidation("MultipleOf", MultipleOf); + filePath() { + return __awaiter(this, void 0, void 0, function* () { + if (this._filePath) { + return this._filePath; } - if (Pattern) { - const pattern = typeof Pattern === "string" ? new RegExp(Pattern) : Pattern; - if (typeof value !== "string" || value.match(pattern) === null) { - failValidation("Pattern", Pattern); - } + const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR]; + if (!pathFromEnv) { + throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); } - if (UniqueItems && valueAsArray.some((item, i2, ar2) => ar2.indexOf(item) !== i2)) { - failValidation("UniqueItems", UniqueItems); + try { + yield access2(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } catch (_a2) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); } - } + this._filePath = pathFromEnv; + return this._filePath; + }); } /** - * Serialize the given object based on its metadata defined in the mapper. + * Wraps content in an HTML tag, adding any HTML attributes * - * @param mapper - The mapper which defines the metadata of the serializable object. - * @param object - A valid Javascript object to be serialized. - * @param objectName - Name of the serialized object. - * @param options - additional options to deserialization. - * @returns A valid serialized Javascript object. + * @param {string} tag HTML tag to wrap + * @param {string | null} content content within the tag + * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add + * + * @returns {string} content wrapped in HTML element */ - serialize(mapper, object, objectName, options = {}) { - var _a2, _b, _c; - const updatedOptions = { - rootName: (_a2 = options.rootName) !== null && _a2 !== void 0 ? _a2 : "", - includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY - }; - let payload = {}; - const mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; - } - if (mapperType.match(/^Sequence$/i) !== null) { - payload = []; - } - if (mapper.isConstant) { - object = mapper.defaultValue; - } - const { required, nullable } = mapper; - if (required && nullable && object === void 0) { - throw new Error(`${objectName} cannot be undefined.`); - } - if (required && !nullable && object == void 0) { - throw new Error(`${objectName} cannot be null or undefined.`); - } - if (!required && nullable === false && object === null) { - throw new Error(`${objectName} cannot be null.`); - } - if (object == void 0) { - payload = object; - } else { - if (mapperType.match(/^any$/i) !== null) { - payload = object; - } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object); - } else if (mapperType.match(/^Enum$/i) !== null) { - const enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); - } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object, objectName); - } else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object); - } else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object); - } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } + wrap(tag, content, attrs = {}) { + const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join(""); + if (!content) { + return `<${tag}${htmlAttrs}>`; } - return payload; + return `<${tag}${htmlAttrs}>${content}`; } /** - * Deserialize the given object based on its metadata defined in the mapper. + * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. * - * @param mapper - The mapper which defines the metadata of the serializable object. - * @param responseBody - A valid Javascript entity to be deserialized. - * @param objectName - Name of the deserialized object. - * @param options - Controls behavior of XML parser and builder. - * @returns A valid deserialized Javascript object. + * @param {SummaryWriteOptions} [options] (optional) options for write operation + * + * @returns {Promise} summary instance */ - deserialize(mapper, responseBody, objectName, options = {}) { - var _a2, _b, _c; - const updatedOptions = { - rootName: (_a2 = options.rootName) !== null && _a2 !== void 0 ? _a2 : "", - includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY - }; - if (responseBody == void 0) { - if (this.isXML && mapper.type.name === "Sequence" && !mapper.xmlIsWrapped) { - responseBody = []; - } - if (mapper.defaultValue !== void 0) { - responseBody = mapper.defaultValue; - } - return responseBody; - } - let payload; - const mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; - } - if (mapperType.match(/^Composite$/i) !== null) { - payload = deserializeCompositeType(this, mapper, responseBody, objectName, updatedOptions); - } else { - if (this.isXML) { - const xmlCharKey = updatedOptions.xmlCharKey; - const castResponseBody = responseBody; - if (castResponseBody[XML_ATTRKEY] != void 0 && castResponseBody[xmlCharKey] != void 0) { - responseBody = castResponseBody[xmlCharKey]; - } - } - if (mapperType.match(/^Number$/i) !== null) { - payload = parseFloat(responseBody); - if (isNaN(payload)) { - payload = responseBody; - } - } else if (mapperType.match(/^Boolean$/i) !== null) { - if (responseBody === "true") { - payload = true; - } else if (responseBody === "false") { - payload = false; - } else { - payload = responseBody; - } - } else if (mapperType.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i) !== null) { - payload = responseBody; - } else if (mapperType.match(/^(Date|DateTime|DateTimeRfc1123)$/i) !== null) { - payload = new Date(responseBody); - } else if (mapperType.match(/^UnixTime$/i) !== null) { - payload = unixTimeToDate(responseBody); - } else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = decodeString(responseBody); - } else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = base64UrlToByteArray(responseBody); - } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = deserializeSequenceType(this, mapper, responseBody, objectName, updatedOptions); - } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = deserializeDictionaryType(this, mapper, responseBody, objectName, updatedOptions); - } - } - if (mapper.isConstant) { - payload = mapper.defaultValue; - } - return payload; + write(options) { + return __awaiter(this, void 0, void 0, function* () { + const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); + const filePath = yield this.filePath(); + const writeFunc = overwrite ? writeFile3 : appendFile; + yield writeFunc(filePath, this._buffer, { encoding: "utf8" }); + return this.emptyBuffer(); + }); } - }; - MapperType = strEnum([ - "Base64Url", - "Boolean", - "ByteArray", - "Composite", - "Date", - "DateTime", - "DateTimeRfc1123", - "Dictionary", - "Enum", - "Number", - "Object", - "Sequence", - "String", - "Stream", - "TimeSpan", - "UnixTime" - ]); - } -}); - -// node_modules/@azure/core-http/dist-esm/src/webResource.js -function isWebResourceLike(object) { - if (object && typeof object === "object") { - const castObject = object; - if (typeof castObject.url === "string" && typeof castObject.method === "string" && typeof castObject.headers === "object" && isHttpHeadersLike(castObject.headers) && typeof castObject.validateRequestProperties === "function" && typeof castObject.prepare === "function" && typeof castObject.clone === "function") { - return true; - } - } - return false; -} -var WebResource; -var init_webResource = __esm({ - "node_modules/@azure/core-http/dist-esm/src/webResource.js"() { - init_httpHeaders(); - init_serializer(); - init_utils(); - WebResource = class _WebResource { - constructor(url2, method, body2, query, headers, streamResponseBody, withCredentials, abortSignal, timeout, onUploadProgress, onDownloadProgress, proxySettings, keepAlive, decompressResponse, streamResponseStatusCodes) { - this.streamResponseBody = streamResponseBody; - this.streamResponseStatusCodes = streamResponseStatusCodes; - this.url = url2 || ""; - this.method = method || "GET"; - this.headers = isHttpHeadersLike(headers) ? headers : new HttpHeaders(headers); - this.body = body2; - this.query = query; - this.formData = void 0; - this.withCredentials = withCredentials || false; - this.abortSignal = abortSignal; - this.timeout = timeout || 0; - this.onUploadProgress = onUploadProgress; - this.onDownloadProgress = onDownloadProgress; - this.proxySettings = proxySettings; - this.keepAlive = keepAlive; - this.decompressResponse = decompressResponse; - this.requestId = this.headers.get("x-ms-client-request-id") || generateUuid(); + /** + * Clears the summary buffer and wipes the summary file + * + * @returns {Summary} summary instance + */ + clear() { + return __awaiter(this, void 0, void 0, function* () { + return this.emptyBuffer().write({ overwrite: true }); + }); } /** - * Validates that the required properties such as method, url, headers["Content-Type"], - * headers["accept-language"] are defined. It will throw an error if one of the above - * mentioned properties are not defined. + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer */ - validateRequestProperties() { - if (!this.method) { - throw new Error("WebResource.method is required."); - } - if (!this.url) { - throw new Error("WebResource.url is required."); - } + stringify() { + return this._buffer; } /** - * Prepares the request. - * @param options - Options to provide for preparing the request. - * @returns Returns the prepared WebResource (HTTP Request) object that needs to be given to the request pipeline. + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty */ - prepare(options) { - if (!options) { - throw new Error("options object is required"); - } - if (options.method === void 0 || options.method === null || typeof options.method.valueOf() !== "string") { - throw new Error("options.method must be a string."); - } - if (options.url && options.pathTemplate) { - throw new Error("options.url and options.pathTemplate are mutually exclusive. Please provide exactly one of them."); - } - if ((options.pathTemplate === void 0 || options.pathTemplate === null || typeof options.pathTemplate.valueOf() !== "string") && (options.url === void 0 || options.url === null || typeof options.url.valueOf() !== "string")) { - throw new Error("Please provide exactly one of options.pathTemplate or options.url."); - } - if (options.url) { - if (typeof options.url !== "string") { - throw new Error('options.url must be of type "string".'); - } - this.url = options.url; - } - if (options.method) { - const validMethods = ["GET", "PUT", "HEAD", "DELETE", "OPTIONS", "POST", "PATCH", "TRACE"]; - if (validMethods.indexOf(options.method.toUpperCase()) === -1) { - throw new Error('The provided method "' + options.method + '" is invalid. Supported HTTP methods are: ' + JSON.stringify(validMethods)); - } - } - this.method = options.method.toUpperCase(); - if (options.pathTemplate) { - const { pathTemplate, pathParameters } = options; - if (typeof pathTemplate !== "string") { - throw new Error('options.pathTemplate must be of type "string".'); - } - if (!options.baseUrl) { - options.baseUrl = "https://management.azure.com"; - } - const baseUrl = options.baseUrl; - let url2 = baseUrl + (baseUrl.endsWith("/") ? "" : "/") + (pathTemplate.startsWith("/") ? pathTemplate.slice(1) : pathTemplate); - const segments = url2.match(/({[\w-]*\s*[\w-]*})/gi); - if (segments && segments.length) { - if (!pathParameters) { - throw new Error(`pathTemplate: ${pathTemplate} has been provided. Hence, options.pathParameters must also be provided.`); - } - segments.forEach(function(item) { - const pathParamName = item.slice(1, -1); - const pathParam = pathParameters[pathParamName]; - if (pathParam === null || pathParam === void 0 || !(typeof pathParam === "string" || typeof pathParam === "object")) { - const stringifiedPathParameters = JSON.stringify(pathParameters, void 0, 2); - throw new Error(`pathTemplate: ${pathTemplate} contains the path parameter ${pathParamName} however, it is not present in parameters: ${stringifiedPathParameters}.The value of the path parameter can either be a "string" of the form { ${pathParamName}: "some sample value" } or it can be an "object" of the form { "${pathParamName}": { value: "some sample value", skipUrlEncoding: true } }.`); - } - if (typeof pathParam.valueOf() === "string") { - url2 = url2.replace(item, encodeURIComponent(pathParam)); - } - if (typeof pathParam.valueOf() === "object") { - if (!pathParam.value) { - throw new Error(`options.pathParameters[${pathParamName}] is of type "object" but it does not contain a "value" property.`); - } - if (pathParam.skipUrlEncoding) { - url2 = url2.replace(item, pathParam.value); - } else { - url2 = url2.replace(item, encodeURIComponent(pathParam.value)); - } - } - }); - } - this.url = url2; - } - if (options.queryParameters) { - const queryParameters = options.queryParameters; - if (typeof queryParameters !== "object") { - throw new Error(`options.queryParameters must be of type object. It should be a JSON object of "query-parameter-name" as the key and the "query-parameter-value" as the value. The "query-parameter-value" may be fo type "string" or an "object" of the form { value: "query-parameter-value", skipUrlEncoding: true }.`); - } - if (this.url && this.url.indexOf("?") === -1) { - this.url += "?"; - } - const queryParams = []; - this.query = {}; - for (const queryParamName in queryParameters) { - const queryParam = queryParameters[queryParamName]; - if (queryParam) { - if (typeof queryParam === "string") { - queryParams.push(queryParamName + "=" + encodeURIComponent(queryParam)); - this.query[queryParamName] = encodeURIComponent(queryParam); - } else if (typeof queryParam === "object") { - if (!queryParam.value) { - throw new Error(`options.queryParameters[${queryParamName}] is of type "object" but it does not contain a "value" property.`); - } - if (queryParam.skipUrlEncoding) { - queryParams.push(queryParamName + "=" + queryParam.value); - this.query[queryParamName] = queryParam.value; - } else { - queryParams.push(queryParamName + "=" + encodeURIComponent(queryParam.value)); - this.query[queryParamName] = encodeURIComponent(queryParam.value); - } - } - } - } - this.url += queryParams.join("&"); - } - if (options.headers) { - const headers = options.headers; - for (const headerName of Object.keys(options.headers)) { - this.headers.set(headerName, headers[headerName]); - } - } - if (!this.headers.get("accept-language")) { - this.headers.set("accept-language", "en-US"); - } - if (!this.headers.get("x-ms-client-request-id") && !options.disableClientRequestId) { - this.headers.set("x-ms-client-request-id", this.requestId); - } - if (!this.headers.get("Content-Type")) { - this.headers.set("Content-Type", "application/json; charset=utf-8"); - } - this.body = options.body; - if (options.body !== void 0 && options.body !== null) { - if (options.bodyIsStream) { - if (!this.headers.get("Transfer-Encoding")) { - this.headers.set("Transfer-Encoding", "chunked"); - } - if (this.headers.get("Content-Type") !== "application/octet-stream") { - this.headers.set("Content-Type", "application/octet-stream"); - } - } else { - if (options.serializationMapper) { - this.body = new Serializer(options.mappers).serialize(options.serializationMapper, options.body, "requestBody"); - } - if (!options.disableJsonStringifyOnBody) { - this.body = JSON.stringify(options.body); - } - } - } - if (options.spanOptions) { - this.spanOptions = options.spanOptions; - } - if (options.tracingContext) { - this.tracingContext = options.tracingContext; - } - this.abortSignal = options.abortSignal; - this.onDownloadProgress = options.onDownloadProgress; - this.onUploadProgress = options.onUploadProgress; + isEmptyBuffer() { + return this._buffer.length === 0; + } + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; return this; } /** - * Clone this WebResource HTTP request object. - * @returns The clone of this WebResource HTTP request object. + * Adds raw text to the summary buffer + * + * @param {string} text content to add + * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) + * + * @returns {Summary} summary instance */ - clone() { - const result = new _WebResource(this.url, this.method, this.body, this.query, this.headers && this.headers.clone(), this.streamResponseBody, this.withCredentials, this.abortSignal, this.timeout, this.onUploadProgress, this.onDownloadProgress, this.proxySettings, this.keepAlive, this.decompressResponse, this.streamResponseStatusCodes); - if (this.formData) { - result.formData = this.formData; - } - if (this.operationSpec) { - result.operationSpec = this.operationSpec; - } - if (this.shouldDeserialize) { - result.shouldDeserialize = this.shouldDeserialize; - } - if (this.operationResponseGetter) { - result.operationResponseGetter = this.operationResponseGetter; - } - return result; + addRaw(text, addEOL = false) { + this._buffer += text; + return addEOL ? this.addEOL() : this; + } + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); + } + /** + * Adds an HTML codeblock to the summary buffer + * + * @param {string} code content to render within fenced code block + * @param {string} lang (optional) language to syntax highlight code + * + * @returns {Summary} summary instance + */ + addCodeBlock(code, lang) { + const attrs = Object.assign({}, lang && { lang }); + const element = this.wrap("pre", this.wrap("code", code), attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML list to the summary buffer + * + * @param {string[]} items list of items to render + * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) + * + * @returns {Summary} summary instance + */ + addList(items, ordered = false) { + const tag = ordered ? "ol" : "ul"; + const listItems = items.map((item) => this.wrap("li", item)).join(""); + const element = this.wrap(tag, listItems); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML table to the summary buffer + * + * @param {SummaryTableCell[]} rows table rows + * + * @returns {Summary} summary instance + */ + addTable(rows) { + const tableBody = rows.map((row) => { + const cells = row.map((cell) => { + if (typeof cell === "string") { + return this.wrap("td", cell); + } + const { header, data, colspan, rowspan } = cell; + const tag = header ? "th" : "td"; + const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); + return this.wrap(tag, data, attrs); + }).join(""); + return this.wrap("tr", cells); + }).join(""); + const element = this.wrap("table", tableBody); + return this.addRaw(element).addEOL(); + } + /** + * Adds a collapsable HTML details element to the summary buffer + * + * @param {string} label text for the closed state + * @param {string} content collapsable content + * + * @returns {Summary} summary instance + */ + addDetails(label, content) { + const element = this.wrap("details", this.wrap("summary", label) + content); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML image tag to the summary buffer + * + * @param {string} src path to the image you to embed + * @param {string} alt text description of the image + * @param {SummaryImageOptions} options (optional) addition image attributes + * + * @returns {Summary} summary instance + */ + addImage(src, alt, options) { + const { width, height } = options || {}; + const attrs = Object.assign(Object.assign({}, width && { width }), height && { height }); + const element = this.wrap("img", null, Object.assign({ src, alt }, attrs)); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML section heading element + * + * @param {string} text heading text + * @param {number | string} [level=1] (optional) the heading level, default: 1 + * + * @returns {Summary} summary instance + */ + addHeading(text, level) { + const tag = `h${level}`; + const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag) ? tag : "h1"; + const element = this.wrap(allowedTag, text); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML thematic break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addSeparator() { + const element = this.wrap("hr", null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML line break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addBreak() { + const element = this.wrap("br", null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML blockquote to the summary buffer + * + * @param {string} text quote text + * @param {string} cite (optional) citation url + * + * @returns {Summary} summary instance + */ + addQuote(text, cite) { + const attrs = Object.assign({}, cite && { cite }); + const element = this.wrap("blockquote", text, attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML anchor tag to the summary buffer + * + * @param {string} text link text/content + * @param {string} href hyperlink + * + * @returns {Summary} summary instance + */ + addLink(text, href) { + const element = this.wrap("a", text, { href }); + return this.addRaw(element).addEOL(); } }; + var _summary = new Summary(); + exports.markdownSummary = _summary; + exports.summary = _summary; } }); -// node_modules/class-transformer/esm5/enums/transformation-type.enum.js -var TransformationType; -var init_transformation_type_enum = __esm({ - "node_modules/class-transformer/esm5/enums/transformation-type.enum.js"() { - (function(TransformationType2) { - TransformationType2[TransformationType2["PLAIN_TO_CLASS"] = 0] = "PLAIN_TO_CLASS"; - TransformationType2[TransformationType2["CLASS_TO_PLAIN"] = 1] = "CLASS_TO_PLAIN"; - TransformationType2[TransformationType2["CLASS_TO_CLASS"] = 2] = "CLASS_TO_CLASS"; - })(TransformationType || (TransformationType = {})); - } -}); - -// node_modules/class-transformer/esm5/enums/index.js -var init_enums = __esm({ - "node_modules/class-transformer/esm5/enums/index.js"() { - init_transformation_type_enum(); +// node_modules/@actions/core/lib/path-utils.js +var require_path_utils = __commonJS({ + "node_modules/@actions/core/lib/path-utils.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; + var path14 = __importStar(__require("path")); + function toPosixPath(pth) { + return pth.replace(/[\\]/g, "/"); + } + exports.toPosixPath = toPosixPath; + function toWin32Path(pth) { + return pth.replace(/[/]/g, "\\"); + } + exports.toWin32Path = toWin32Path; + function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path14.sep); + } + exports.toPlatformPath = toPlatformPath; } }); -// node_modules/class-transformer/esm5/MetadataStorage.js -var MetadataStorage; -var init_MetadataStorage = __esm({ - "node_modules/class-transformer/esm5/MetadataStorage.js"() { - init_enums(); - MetadataStorage = /** @class */ - function() { - function MetadataStorage2() { - this._typeMetadatas = /* @__PURE__ */ new Map(); - this._transformMetadatas = /* @__PURE__ */ new Map(); - this._exposeMetadatas = /* @__PURE__ */ new Map(); - this._excludeMetadatas = /* @__PURE__ */ new Map(); - this._ancestorsMap = /* @__PURE__ */ new Map(); - } - MetadataStorage2.prototype.addTypeMetadata = function(metadata3) { - if (!this._typeMetadatas.has(metadata3.target)) { - this._typeMetadatas.set(metadata3.target, /* @__PURE__ */ new Map()); - } - this._typeMetadatas.get(metadata3.target).set(metadata3.propertyName, metadata3); - }; - MetadataStorage2.prototype.addTransformMetadata = function(metadata3) { - if (!this._transformMetadatas.has(metadata3.target)) { - this._transformMetadatas.set(metadata3.target, /* @__PURE__ */ new Map()); - } - if (!this._transformMetadatas.get(metadata3.target).has(metadata3.propertyName)) { - this._transformMetadatas.get(metadata3.target).set(metadata3.propertyName, []); - } - this._transformMetadatas.get(metadata3.target).get(metadata3.propertyName).push(metadata3); - }; - MetadataStorage2.prototype.addExposeMetadata = function(metadata3) { - if (!this._exposeMetadatas.has(metadata3.target)) { - this._exposeMetadatas.set(metadata3.target, /* @__PURE__ */ new Map()); - } - this._exposeMetadatas.get(metadata3.target).set(metadata3.propertyName, metadata3); - }; - MetadataStorage2.prototype.addExcludeMetadata = function(metadata3) { - if (!this._excludeMetadatas.has(metadata3.target)) { - this._excludeMetadatas.set(metadata3.target, /* @__PURE__ */ new Map()); - } - this._excludeMetadatas.get(metadata3.target).set(metadata3.propertyName, metadata3); - }; - MetadataStorage2.prototype.findTransformMetadatas = function(target, propertyName, transformationType) { - return this.findMetadatas(this._transformMetadatas, target, propertyName).filter(function(metadata3) { - if (!metadata3.options) - return true; - if (metadata3.options.toClassOnly === true && metadata3.options.toPlainOnly === true) - return true; - if (metadata3.options.toClassOnly === true) { - return transformationType === TransformationType.CLASS_TO_CLASS || transformationType === TransformationType.PLAIN_TO_CLASS; - } - if (metadata3.options.toPlainOnly === true) { - return transformationType === TransformationType.CLASS_TO_PLAIN; - } - return true; - }); - }; - MetadataStorage2.prototype.findExcludeMetadata = function(target, propertyName) { - return this.findMetadata(this._excludeMetadatas, target, propertyName); - }; - MetadataStorage2.prototype.findExposeMetadata = function(target, propertyName) { - return this.findMetadata(this._exposeMetadatas, target, propertyName); - }; - MetadataStorage2.prototype.findExposeMetadataByCustomName = function(target, name2) { - return this.getExposedMetadatas(target).find(function(metadata3) { - return metadata3.options && metadata3.options.name === name2; - }); - }; - MetadataStorage2.prototype.findTypeMetadata = function(target, propertyName) { - return this.findMetadata(this._typeMetadatas, target, propertyName); - }; - MetadataStorage2.prototype.getStrategy = function(target) { - var excludeMap = this._excludeMetadatas.get(target); - var exclude = excludeMap && excludeMap.get(void 0); - var exposeMap = this._exposeMetadatas.get(target); - var expose = exposeMap && exposeMap.get(void 0); - if (exclude && expose || !exclude && !expose) - return "none"; - return exclude ? "excludeAll" : "exposeAll"; - }; - MetadataStorage2.prototype.getExposedMetadatas = function(target) { - return this.getMetadata(this._exposeMetadatas, target); - }; - MetadataStorage2.prototype.getExcludedMetadatas = function(target) { - return this.getMetadata(this._excludeMetadatas, target); - }; - MetadataStorage2.prototype.getExposedProperties = function(target, transformationType) { - return this.getExposedMetadatas(target).filter(function(metadata3) { - if (!metadata3.options) - return true; - if (metadata3.options.toClassOnly === true && metadata3.options.toPlainOnly === true) - return true; - if (metadata3.options.toClassOnly === true) { - return transformationType === TransformationType.CLASS_TO_CLASS || transformationType === TransformationType.PLAIN_TO_CLASS; - } - if (metadata3.options.toPlainOnly === true) { - return transformationType === TransformationType.CLASS_TO_PLAIN; - } - return true; - }).map(function(metadata3) { - return metadata3.propertyName; - }); - }; - MetadataStorage2.prototype.getExcludedProperties = function(target, transformationType) { - return this.getExcludedMetadatas(target).filter(function(metadata3) { - if (!metadata3.options) - return true; - if (metadata3.options.toClassOnly === true && metadata3.options.toPlainOnly === true) - return true; - if (metadata3.options.toClassOnly === true) { - return transformationType === TransformationType.CLASS_TO_CLASS || transformationType === TransformationType.PLAIN_TO_CLASS; - } - if (metadata3.options.toPlainOnly === true) { - return transformationType === TransformationType.CLASS_TO_PLAIN; - } - return true; - }).map(function(metadata3) { - return metadata3.propertyName; - }); - }; - MetadataStorage2.prototype.clear = function() { - this._typeMetadatas.clear(); - this._exposeMetadatas.clear(); - this._excludeMetadatas.clear(); - this._ancestorsMap.clear(); - }; - MetadataStorage2.prototype.getMetadata = function(metadatas, target) { - var metadataFromTargetMap = metadatas.get(target); - var metadataFromTarget; - if (metadataFromTargetMap) { - metadataFromTarget = Array.from(metadataFromTargetMap.values()).filter(function(meta) { - return meta.propertyName !== void 0; - }); - } - var metadataFromAncestors = []; - for (var _i = 0, _a2 = this.getAncestors(target); _i < _a2.length; _i++) { - var ancestor = _a2[_i]; - var ancestorMetadataMap = metadatas.get(ancestor); - if (ancestorMetadataMap) { - var metadataFromAncestor = Array.from(ancestorMetadataMap.values()).filter(function(meta) { - return meta.propertyName !== void 0; - }); - metadataFromAncestors.push.apply(metadataFromAncestors, metadataFromAncestor); - } - } - return metadataFromAncestors.concat(metadataFromTarget || []); - }; - MetadataStorage2.prototype.findMetadata = function(metadatas, target, propertyName) { - var metadataFromTargetMap = metadatas.get(target); - if (metadataFromTargetMap) { - var metadataFromTarget = metadataFromTargetMap.get(propertyName); - if (metadataFromTarget) { - return metadataFromTarget; +// node_modules/@actions/core/lib/core.js +var require_core = __commonJS({ + "node_modules/@actions/core/lib/core.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve2) { + resolve2(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e2) { + reject(e2); } } - for (var _i = 0, _a2 = this.getAncestors(target); _i < _a2.length; _i++) { - var ancestor = _a2[_i]; - var ancestorMetadataMap = metadatas.get(ancestor); - if (ancestorMetadataMap) { - var ancestorResult = ancestorMetadataMap.get(propertyName); - if (ancestorResult) { - return ancestorResult; - } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); } } - return void 0; - }; - MetadataStorage2.prototype.findMetadatas = function(metadatas, target, propertyName) { - var metadataFromTargetMap = metadatas.get(target); - var metadataFromTarget; - if (metadataFromTargetMap) { - metadataFromTarget = metadataFromTargetMap.get(propertyName); - } - var metadataFromAncestorsTarget = []; - for (var _i = 0, _a2 = this.getAncestors(target); _i < _a2.length; _i++) { - var ancestor = _a2[_i]; - var ancestorMetadataMap = metadatas.get(ancestor); - if (ancestorMetadataMap) { - if (ancestorMetadataMap.has(propertyName)) { - metadataFromAncestorsTarget.push.apply(metadataFromAncestorsTarget, ancestorMetadataMap.get(propertyName)); - } - } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - return metadataFromAncestorsTarget.slice().reverse().concat((metadataFromTarget || []).slice().reverse()); - }; - MetadataStorage2.prototype.getAncestors = function(target) { - if (!target) - return []; - if (!this._ancestorsMap.has(target)) { - var ancestors = []; - for (var baseClass = Object.getPrototypeOf(target.prototype.constructor); typeof baseClass.prototype !== "undefined"; baseClass = Object.getPrototypeOf(baseClass.prototype.constructor)) { - ancestors.push(baseClass); - } - this._ancestorsMap.set(target, ancestors); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; + var command_1 = require_command(); + var file_command_1 = require_file_command(); + var utils_1 = require_utils(); + var os3 = __importStar(__require("os")); + var path14 = __importStar(__require("path")); + var oidc_utils_1 = require_oidc_utils(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode = exports.ExitCode || (exports.ExitCode = {})); + function exportVariable2(name2, val) { + const convertedVal = utils_1.toCommandValue(val); + process.env[name2] = convertedVal; + const filePath = process.env["GITHUB_ENV"] || ""; + if (filePath) { + return file_command_1.issueFileCommand("ENV", file_command_1.prepareKeyValueMessage(name2, val)); + } + command_1.issueCommand("set-env", { name: name2 }, convertedVal); + } + exports.exportVariable = exportVariable2; + function setSecret(secret) { + command_1.issueCommand("add-mask", {}, secret); + } + exports.setSecret = setSecret; + function addPath2(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + file_command_1.issueFileCommand("PATH", inputPath); + } else { + command_1.issueCommand("add-path", {}, inputPath); + } + process.env["PATH"] = `${inputPath}${path14.delimiter}${process.env["PATH"]}`; + } + exports.addPath = addPath2; + function getInput2(name2, options) { + const val = process.env[`INPUT_${name2.replace(/ /g, "_").toUpperCase()}`] || ""; + if (options && options.required && !val) { + throw new Error(`Input required and not supplied: ${name2}`); + } + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); + } + exports.getInput = getInput2; + function getMultilineInput(name2, options) { + const inputs = getInput2(name2, options).split("\n").filter((x2) => x2 !== ""); + if (options && options.trimWhitespace === false) { + return inputs; + } + return inputs.map((input) => input.trim()); + } + exports.getMultilineInput = getMultilineInput; + function getBooleanInput2(name2, options) { + const trueValue = ["true", "True", "TRUE"]; + const falseValue = ["false", "False", "FALSE"]; + const val = getInput2(name2, options); + if (trueValue.includes(val)) + return true; + if (falseValue.includes(val)) + return false; + throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name2} +Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); + } + exports.getBooleanInput = getBooleanInput2; + function setOutput3(name2, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return file_command_1.issueFileCommand("OUTPUT", file_command_1.prepareKeyValueMessage(name2, value)); + } + process.stdout.write(os3.EOL); + command_1.issueCommand("set-output", { name: name2 }, utils_1.toCommandValue(value)); + } + exports.setOutput = setOutput3; + function setCommandEcho(enabled2) { + command_1.issue("echo", enabled2 ? "on" : "off"); + } + exports.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error(message); + } + exports.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports.isDebug = isDebug2; + function debug3(message) { + command_1.issueCommand("debug", {}, message); + } + exports.debug = debug3; + function error(message, properties = {}) { + command_1.issueCommand("error", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + } + exports.error = error; + function warning2(message, properties = {}) { + command_1.issueCommand("warning", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + } + exports.warning = warning2; + function notice2(message, properties = {}) { + command_1.issueCommand("notice", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + } + exports.notice = notice2; + function info3(message) { + process.stdout.write(message + os3.EOL); + } + exports.info = info3; + function startGroup(name2) { + command_1.issue("group", name2); + } + exports.startGroup = startGroup; + function endGroup() { + command_1.issue("endgroup"); + } + exports.endGroup = endGroup; + function group2(name2, fn2) { + return __awaiter(this, void 0, void 0, function* () { + startGroup(name2); + let result; + try { + result = yield fn2(); + } finally { + endGroup(); } - return this._ancestorsMap.get(target); - }; - return MetadataStorage2; - }(); - } -}); - -// node_modules/class-transformer/esm5/storage.js -var defaultMetadataStorage; -var init_storage = __esm({ - "node_modules/class-transformer/esm5/storage.js"() { - init_MetadataStorage(); - defaultMetadataStorage = new MetadataStorage(); - } -}); - -// node_modules/class-transformer/esm5/utils/get-global.util.js -function getGlobal() { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof global !== "undefined") { - return global; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof self !== "undefined") { - return self; - } -} -var init_get_global_util = __esm({ - "node_modules/class-transformer/esm5/utils/get-global.util.js"() { - } -}); - -// node_modules/class-transformer/esm5/utils/is-promise.util.js -function isPromise(p2) { - return p2 !== null && typeof p2 === "object" && typeof p2.then === "function"; -} -var init_is_promise_util = __esm({ - "node_modules/class-transformer/esm5/utils/is-promise.util.js"() { - } -}); - -// node_modules/class-transformer/esm5/utils/index.js -var init_utils2 = __esm({ - "node_modules/class-transformer/esm5/utils/index.js"() { - init_get_global_util(); - init_is_promise_util(); + return result; + }); + } + exports.group = group2; + function saveState3(name2, value) { + const filePath = process.env["GITHUB_STATE"] || ""; + if (filePath) { + return file_command_1.issueFileCommand("STATE", file_command_1.prepareKeyValueMessage(name2, value)); + } + command_1.issueCommand("save-state", { name: name2 }, utils_1.toCommandValue(value)); + } + exports.saveState = saveState3; + function getState3(name2) { + return process.env[`STATE_${name2}`] || ""; + } + exports.getState = getState3; + function getIDToken(aud) { + return __awaiter(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); + } + exports.getIDToken = getIDToken; + var summary_1 = require_summary(); + Object.defineProperty(exports, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary(); + Object.defineProperty(exports, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils(); + Object.defineProperty(exports, "toPosixPath", { enumerable: true, get: function() { + return path_utils_1.toPosixPath; + } }); + Object.defineProperty(exports, "toWin32Path", { enumerable: true, get: function() { + return path_utils_1.toWin32Path; + } }); + Object.defineProperty(exports, "toPlatformPath", { enumerable: true, get: function() { + return path_utils_1.toPlatformPath; + } }); } }); -// node_modules/class-transformer/esm5/TransformOperationExecutor.js -function instantiateArrayType(arrayType) { - var array = new arrayType(); - if (!(array instanceof Set) && !("push" in array)) { - return []; - } - return array; -} -var __spreadArray, TransformOperationExecutor; -var init_TransformOperationExecutor = __esm({ - "node_modules/class-transformer/esm5/TransformOperationExecutor.js"() { - init_storage(); - init_enums(); - init_utils2(); - __spreadArray = function(to2, from, pack) { - if (pack || arguments.length === 2) - for (var i2 = 0, l2 = from.length, ar2; i2 < l2; i2++) { - if (ar2 || !(i2 in from)) { - if (!ar2) - ar2 = Array.prototype.slice.call(from, 0, i2); - ar2[i2] = from[i2]; +// node_modules/@actions/io/lib/io-util.js +var require_io_util = __commonJS({ + "node_modules/@actions/io/lib/io-util.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve2) { + resolve2(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e2) { + reject(e2); } } - return to2.concat(ar2 || Array.prototype.slice.call(from)); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - TransformOperationExecutor = /** @class */ - function() { - function TransformOperationExecutor2(transformationType, options) { - this.transformationType = transformationType; - this.options = options; - this.recursionStack = /* @__PURE__ */ new Set(); - } - TransformOperationExecutor2.prototype.transform = function(source, value, targetType, arrayType, isMap, level) { - var _this = this; - if (level === void 0) { - level = 0; - } - if (Array.isArray(value) || value instanceof Set) { - var newValue_1 = arrayType && this.transformationType === TransformationType.PLAIN_TO_CLASS ? instantiateArrayType(arrayType) : []; - value.forEach(function(subValue, index) { - var subSource = source ? source[index] : void 0; - if (!_this.options.enableCircularCheck || !_this.isCircular(subValue)) { - var realTargetType = void 0; - if (typeof targetType !== "function" && targetType && targetType.options && targetType.options.discriminator && targetType.options.discriminator.property && targetType.options.discriminator.subTypes) { - if (_this.transformationType === TransformationType.PLAIN_TO_CLASS) { - realTargetType = targetType.options.discriminator.subTypes.find(function(subType) { - return subType.name === subValue[targetType.options.discriminator.property]; - }); - var options = { newObject: newValue_1, object: subValue, property: void 0 }; - var newType = targetType.typeFunction(options); - realTargetType === void 0 ? realTargetType = newType : realTargetType = realTargetType.value; - if (!targetType.options.keepDiscriminatorProperty) - delete subValue[targetType.options.discriminator.property]; - } - if (_this.transformationType === TransformationType.CLASS_TO_CLASS) { - realTargetType = subValue.constructor; - } - if (_this.transformationType === TransformationType.CLASS_TO_PLAIN) { - subValue[targetType.options.discriminator.property] = targetType.options.discriminator.subTypes.find(function(subType) { - return subType.value === subValue.constructor; - }).name; - } - } else { - realTargetType = targetType; - } - var value_1 = _this.transform(subSource, subValue, realTargetType, void 0, subValue instanceof Map, level + 1); - if (newValue_1 instanceof Set) { - newValue_1.add(value_1); - } else { - newValue_1.push(value_1); - } - } else if (_this.transformationType === TransformationType.CLASS_TO_CLASS) { - if (newValue_1 instanceof Set) { - newValue_1.add(subValue); - } else { - newValue_1.push(subValue); - } - } - }); - return newValue_1; - } else if (targetType === String && !isMap) { - if (value === null || value === void 0) - return value; - return String(value); - } else if (targetType === Number && !isMap) { - if (value === null || value === void 0) - return value; - return Number(value); - } else if (targetType === Boolean && !isMap) { - if (value === null || value === void 0) - return value; - return Boolean(value); - } else if ((targetType === Date || value instanceof Date) && !isMap) { - if (value instanceof Date) { - return new Date(value.valueOf()); - } - if (value === null || value === void 0) - return value; - return new Date(value); - } else if (!!getGlobal().Buffer && (targetType === Buffer || value instanceof Buffer) && !isMap) { - if (value === null || value === void 0) - return value; - return Buffer.from(value); - } else if (isPromise(value) && !isMap) { - return new Promise(function(resolve2, reject) { - value.then(function(data) { - return resolve2(_this.transform(void 0, data, targetType, void 0, void 0, level + 1)); - }, reject); - }); - } else if (!isMap && value !== null && typeof value === "object" && typeof value.then === "function") { - return value; - } else if (typeof value === "object" && value !== null) { - if (!targetType && value.constructor !== Object) - if (!Array.isArray(value) && value.constructor === Array) { - } else { - targetType = value.constructor; - } - if (!targetType && source) - targetType = source.constructor; - if (this.options.enableCircularCheck) { - this.recursionStack.add(value); - } - var keys = this.getKeys(targetType, value, isMap); - var newValue = source ? source : {}; - if (!source && (this.transformationType === TransformationType.PLAIN_TO_CLASS || this.transformationType === TransformationType.CLASS_TO_CLASS)) { - if (isMap) { - newValue = /* @__PURE__ */ new Map(); - } else if (targetType) { - newValue = new targetType(); - } else { - newValue = {}; - } + var _a2; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; + var fs3 = __importStar(__require("fs")); + var path14 = __importStar(__require("path")); + _a2 = fs3.promises, exports.chmod = _a2.chmod, exports.copyFile = _a2.copyFile, exports.lstat = _a2.lstat, exports.mkdir = _a2.mkdir, exports.open = _a2.open, exports.readdir = _a2.readdir, exports.readlink = _a2.readlink, exports.rename = _a2.rename, exports.rm = _a2.rm, exports.rmdir = _a2.rmdir, exports.stat = _a2.stat, exports.symlink = _a2.symlink, exports.unlink = _a2.unlink; + exports.IS_WINDOWS = process.platform === "win32"; + exports.UV_FS_O_EXLOCK = 268435456; + exports.READONLY = fs3.constants.O_RDONLY; + function exists(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield exports.stat(fsPath); + } catch (err) { + if (err.code === "ENOENT") { + return false; } - var _loop_1 = function(key2) { - if (key2 === "__proto__" || key2 === "constructor") { - return "continue"; + throw err; + } + return true; + }); + } + exports.exists = exists; + function isDirectory(fsPath, useStat = false) { + return __awaiter(this, void 0, void 0, function* () { + const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); + return stats.isDirectory(); + }); + } + exports.isDirectory = isDirectory; + function isRooted(p2) { + p2 = normalizeSeparators(p2); + if (!p2) { + throw new Error('isRooted() parameter "p" cannot be empty'); + } + if (exports.IS_WINDOWS) { + return p2.startsWith("\\") || /^[A-Z]:/i.test(p2); + } + return p2.startsWith("/"); + } + exports.isRooted = isRooted; + function tryGetExecutablePath(filePath, extensions) { + return __awaiter(this, void 0, void 0, function* () { + let stats = void 0; + try { + stats = yield exports.stat(filePath); + } catch (err) { + if (err.code !== "ENOENT") { + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (exports.IS_WINDOWS) { + const upperExt = path14.extname(filePath).toUpperCase(); + if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { + return filePath; } - var valueKey = key2; - var newValueKey = key2, propertyName = key2; - if (!this_1.options.ignoreDecorators && targetType) { - if (this_1.transformationType === TransformationType.PLAIN_TO_CLASS) { - var exposeMetadata = defaultMetadataStorage.findExposeMetadataByCustomName(targetType, key2); - if (exposeMetadata) { - propertyName = exposeMetadata.propertyName; - newValueKey = exposeMetadata.propertyName; - } - } else if (this_1.transformationType === TransformationType.CLASS_TO_PLAIN || this_1.transformationType === TransformationType.CLASS_TO_CLASS) { - var exposeMetadata = defaultMetadataStorage.findExposeMetadata(targetType, key2); - if (exposeMetadata && exposeMetadata.options && exposeMetadata.options.name) { - newValueKey = exposeMetadata.options.name; - } - } + } else { + if (isUnixExecutable(stats)) { + return filePath; } - var subValue = void 0; - if (this_1.transformationType === TransformationType.PLAIN_TO_CLASS) { - subValue = value[valueKey]; - } else { - if (value instanceof Map) { - subValue = value.get(valueKey); - } else if (value[valueKey] instanceof Function) { - subValue = value[valueKey](); - } else { - subValue = value[valueKey]; - } + } + } + const originalFilePath = filePath; + for (const extension of extensions) { + filePath = originalFilePath + extension; + stats = void 0; + try { + stats = yield exports.stat(filePath); + } catch (err) { + if (err.code !== "ENOENT") { + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); } - var type3 = void 0, isSubValueMap = subValue instanceof Map; - if (targetType && isMap) { - type3 = targetType; - } else if (targetType) { - var metadata_1 = defaultMetadataStorage.findTypeMetadata(targetType, propertyName); - if (metadata_1) { - var options = { newObject: newValue, object: value, property: propertyName }; - var newType = metadata_1.typeFunction ? metadata_1.typeFunction(options) : metadata_1.reflectedType; - if (metadata_1.options && metadata_1.options.discriminator && metadata_1.options.discriminator.property && metadata_1.options.discriminator.subTypes) { - if (!(value[valueKey] instanceof Array)) { - if (this_1.transformationType === TransformationType.PLAIN_TO_CLASS) { - type3 = metadata_1.options.discriminator.subTypes.find(function(subType) { - if (subValue && subValue instanceof Object && metadata_1.options.discriminator.property in subValue) { - return subType.name === subValue[metadata_1.options.discriminator.property]; - } - }); - type3 === void 0 ? type3 = newType : type3 = type3.value; - if (!metadata_1.options.keepDiscriminatorProperty) { - if (subValue && subValue instanceof Object && metadata_1.options.discriminator.property in subValue) { - delete subValue[metadata_1.options.discriminator.property]; - } - } - } - if (this_1.transformationType === TransformationType.CLASS_TO_CLASS) { - type3 = subValue.constructor; - } - if (this_1.transformationType === TransformationType.CLASS_TO_PLAIN) { - if (subValue) { - subValue[metadata_1.options.discriminator.property] = metadata_1.options.discriminator.subTypes.find(function(subType) { - return subType.value === subValue.constructor; - }).name; - } - } - } else { - type3 = metadata_1; + } + if (stats && stats.isFile()) { + if (exports.IS_WINDOWS) { + try { + const directory = path14.dirname(filePath); + const upperName = path14.basename(filePath).toUpperCase(); + for (const actualName of yield exports.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path14.join(directory, actualName); + break; } - } else { - type3 = newType; - } - isSubValueMap = isSubValueMap || metadata_1.reflectedType === Map; - } else if (this_1.options.targetMaps) { - this_1.options.targetMaps.filter(function(map) { - return map.target === targetType && !!map.properties[propertyName]; - }).forEach(function(map) { - return type3 = map.properties[propertyName]; - }); - } else if (this_1.options.enableImplicitConversion && this_1.transformationType === TransformationType.PLAIN_TO_CLASS) { - var reflectedType = Reflect.getMetadata("design:type", targetType.prototype, propertyName); - if (reflectedType) { - type3 = reflectedType; - } - } - } - var arrayType_1 = Array.isArray(value[valueKey]) ? this_1.getReflectedType(targetType, propertyName) : void 0; - var subSource = source ? source[valueKey] : void 0; - if (newValue.constructor.prototype) { - var descriptor = Object.getOwnPropertyDescriptor(newValue.constructor.prototype, newValueKey); - if ((this_1.transformationType === TransformationType.PLAIN_TO_CLASS || this_1.transformationType === TransformationType.CLASS_TO_CLASS) && // eslint-disable-next-line @typescript-eslint/unbound-method - (descriptor && !descriptor.set || newValue[newValueKey] instanceof Function)) - return "continue"; - } - if (!this_1.options.enableCircularCheck || !this_1.isCircular(subValue)) { - var transformKey = this_1.transformationType === TransformationType.PLAIN_TO_CLASS ? newValueKey : key2; - var finalValue = void 0; - if (this_1.transformationType === TransformationType.CLASS_TO_PLAIN) { - finalValue = value[transformKey]; - finalValue = this_1.applyCustomTransformations(finalValue, targetType, transformKey, value, this_1.transformationType); - finalValue = value[transformKey] === finalValue ? subValue : finalValue; - finalValue = this_1.transform(subSource, finalValue, type3, arrayType_1, isSubValueMap, level + 1); - } else { - if (subValue === void 0 && this_1.options.exposeDefaultValues) { - finalValue = newValue[newValueKey]; - } else { - finalValue = this_1.transform(subSource, subValue, type3, arrayType_1, isSubValueMap, level + 1); - finalValue = this_1.applyCustomTransformations(finalValue, targetType, transformKey, value, this_1.transformationType); - } - } - if (finalValue !== void 0 || this_1.options.exposeUnsetFields) { - if (newValue instanceof Map) { - newValue.set(newValueKey, finalValue); - } else { - newValue[newValueKey] = finalValue; } + } catch (err) { + console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); } - } else if (this_1.transformationType === TransformationType.CLASS_TO_CLASS) { - var finalValue = subValue; - finalValue = this_1.applyCustomTransformations(finalValue, targetType, key2, value, this_1.transformationType); - if (finalValue !== void 0 || this_1.options.exposeUnsetFields) { - if (newValue instanceof Map) { - newValue.set(newValueKey, finalValue); - } else { - newValue[newValueKey] = finalValue; - } + return filePath; + } else { + if (isUnixExecutable(stats)) { + return filePath; } } - }; - var this_1 = this; - for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { - var key = keys_1[_i]; - _loop_1(key); - } - if (this.options.enableCircularCheck) { - this.recursionStack.delete(value); - } - return newValue; - } else { - return value; - } - }; - TransformOperationExecutor2.prototype.applyCustomTransformations = function(value, target, key, obj, transformationType) { - var _this = this; - var metadatas = defaultMetadataStorage.findTransformMetadatas(target, key, this.transformationType); - if (this.options.version !== void 0) { - metadatas = metadatas.filter(function(metadata3) { - if (!metadata3.options) - return true; - return _this.checkVersion(metadata3.options.since, metadata3.options.until); - }); - } - if (this.options.groups && this.options.groups.length) { - metadatas = metadatas.filter(function(metadata3) { - if (!metadata3.options) - return true; - return _this.checkGroups(metadata3.options.groups); - }); - } else { - metadatas = metadatas.filter(function(metadata3) { - return !metadata3.options || !metadata3.options.groups || !metadata3.options.groups.length; - }); - } - metadatas.forEach(function(metadata3) { - value = metadata3.transformFn({ value, key, obj, type: transformationType, options: _this.options }); - }); - return value; - }; - TransformOperationExecutor2.prototype.isCircular = function(object) { - return this.recursionStack.has(object); - }; - TransformOperationExecutor2.prototype.getReflectedType = function(target, propertyName) { - if (!target) - return void 0; - var meta = defaultMetadataStorage.findTypeMetadata(target, propertyName); - return meta ? meta.reflectedType : void 0; - }; - TransformOperationExecutor2.prototype.getKeys = function(target, object, isMap) { - var _this = this; - var strategy = defaultMetadataStorage.getStrategy(target); - if (strategy === "none") - strategy = this.options.strategy || "exposeAll"; - var keys = []; - if (strategy === "exposeAll" || isMap) { - if (object instanceof Map) { - keys = Array.from(object.keys()); - } else { - keys = Object.keys(object); - } - } - if (isMap) { - return keys; - } - if (this.options.ignoreDecorators && this.options.excludeExtraneousValues && target) { - var exposedProperties = defaultMetadataStorage.getExposedProperties(target, this.transformationType); - var excludedProperties = defaultMetadataStorage.getExcludedProperties(target, this.transformationType); - keys = __spreadArray(__spreadArray([], exposedProperties, true), excludedProperties, true); - } - if (!this.options.ignoreDecorators && target) { - var exposedProperties = defaultMetadataStorage.getExposedProperties(target, this.transformationType); - if (this.transformationType === TransformationType.PLAIN_TO_CLASS) { - exposedProperties = exposedProperties.map(function(key) { - var exposeMetadata = defaultMetadataStorage.findExposeMetadata(target, key); - if (exposeMetadata && exposeMetadata.options && exposeMetadata.options.name) { - return exposeMetadata.options.name; - } - return key; - }); - } - if (this.options.excludeExtraneousValues) { - keys = exposedProperties; - } else { - keys = keys.concat(exposedProperties); - } - var excludedProperties_1 = defaultMetadataStorage.getExcludedProperties(target, this.transformationType); - if (excludedProperties_1.length > 0) { - keys = keys.filter(function(key) { - return !excludedProperties_1.includes(key); - }); - } - if (this.options.version !== void 0) { - keys = keys.filter(function(key) { - var exposeMetadata = defaultMetadataStorage.findExposeMetadata(target, key); - if (!exposeMetadata || !exposeMetadata.options) - return true; - return _this.checkVersion(exposeMetadata.options.since, exposeMetadata.options.until); - }); } - if (this.options.groups && this.options.groups.length) { - keys = keys.filter(function(key) { - var exposeMetadata = defaultMetadataStorage.findExposeMetadata(target, key); - if (!exposeMetadata || !exposeMetadata.options) - return true; - return _this.checkGroups(exposeMetadata.options.groups); - }); - } else { - keys = keys.filter(function(key) { - var exposeMetadata = defaultMetadataStorage.findExposeMetadata(target, key); - return !exposeMetadata || !exposeMetadata.options || !exposeMetadata.options.groups || !exposeMetadata.options.groups.length; - }); - } - } - if (this.options.excludePrefixes && this.options.excludePrefixes.length) { - keys = keys.filter(function(key) { - return _this.options.excludePrefixes.every(function(prefix2) { - return key.substr(0, prefix2.length) !== prefix2; - }); - }); } - keys = keys.filter(function(key, index, self2) { - return self2.indexOf(key) === index; - }); - return keys; - }; - TransformOperationExecutor2.prototype.checkVersion = function(since, until) { - var decision = true; - if (decision && since) - decision = this.options.version >= since; - if (decision && until) - decision = this.options.version < until; - return decision; - }; - TransformOperationExecutor2.prototype.checkGroups = function(groups) { - if (!groups) - return true; - return this.options.groups.some(function(optionGroup) { - return groups.includes(optionGroup); - }); - }; - return TransformOperationExecutor2; - }(); - } -}); - -// node_modules/class-transformer/esm5/constants/default-options.constant.js -var defaultOptions; -var init_default_options_constant = __esm({ - "node_modules/class-transformer/esm5/constants/default-options.constant.js"() { - defaultOptions = { - enableCircularCheck: false, - enableImplicitConversion: false, - excludeExtraneousValues: false, - excludePrefixes: void 0, - exposeDefaultValues: false, - exposeUnsetFields: true, - groups: void 0, - ignoreDecorators: false, - strategy: void 0, - targetMaps: void 0, - version: void 0 - }; - } -}); - -// node_modules/class-transformer/esm5/ClassTransformer.js -var __assign, ClassTransformer; -var init_ClassTransformer = __esm({ - "node_modules/class-transformer/esm5/ClassTransformer.js"() { - init_TransformOperationExecutor(); - init_enums(); - init_default_options_constant(); - __assign = function() { - __assign = Object.assign || function(t2) { - for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { - s2 = arguments[i2]; - for (var p2 in s2) - if (Object.prototype.hasOwnProperty.call(s2, p2)) - t2[p2] = s2[p2]; - } - return t2; - }; - return __assign.apply(this, arguments); - }; - ClassTransformer = /** @class */ - function() { - function ClassTransformer2() { - } - ClassTransformer2.prototype.instanceToPlain = function(object, options) { - var executor = new TransformOperationExecutor(TransformationType.CLASS_TO_PLAIN, __assign(__assign({}, defaultOptions), options)); - return executor.transform(void 0, object, void 0, void 0, void 0, void 0); - }; - ClassTransformer2.prototype.classToPlainFromExist = function(object, plainObject, options) { - var executor = new TransformOperationExecutor(TransformationType.CLASS_TO_PLAIN, __assign(__assign({}, defaultOptions), options)); - return executor.transform(plainObject, object, void 0, void 0, void 0, void 0); - }; - ClassTransformer2.prototype.plainToInstance = function(cls, plain, options) { - var executor = new TransformOperationExecutor(TransformationType.PLAIN_TO_CLASS, __assign(__assign({}, defaultOptions), options)); - return executor.transform(void 0, plain, cls, void 0, void 0, void 0); - }; - ClassTransformer2.prototype.plainToClassFromExist = function(clsObject, plain, options) { - var executor = new TransformOperationExecutor(TransformationType.PLAIN_TO_CLASS, __assign(__assign({}, defaultOptions), options)); - return executor.transform(clsObject, plain, void 0, void 0, void 0, void 0); - }; - ClassTransformer2.prototype.instanceToInstance = function(object, options) { - var executor = new TransformOperationExecutor(TransformationType.CLASS_TO_CLASS, __assign(__assign({}, defaultOptions), options)); - return executor.transform(void 0, object, void 0, void 0, void 0, void 0); - }; - ClassTransformer2.prototype.classToClassFromExist = function(object, fromObject, options) { - var executor = new TransformOperationExecutor(TransformationType.CLASS_TO_CLASS, __assign(__assign({}, defaultOptions), options)); - return executor.transform(fromObject, object, void 0, void 0, void 0, void 0); - }; - ClassTransformer2.prototype.serialize = function(object, options) { - return JSON.stringify(this.instanceToPlain(object, options)); - }; - ClassTransformer2.prototype.deserialize = function(cls, json, options) { - var jsonObject = JSON.parse(json); - return this.plainToInstance(cls, jsonObject, options); - }; - ClassTransformer2.prototype.deserializeArray = function(cls, json, options) { - var jsonObject = JSON.parse(json); - return this.plainToInstance(cls, jsonObject, options); - }; - return ClassTransformer2; - }(); - } -}); - -// node_modules/class-transformer/esm5/decorators/exclude.decorator.js -function Exclude(options) { - if (options === void 0) { - options = {}; - } - return function(object, propertyName) { - defaultMetadataStorage.addExcludeMetadata({ - target: object instanceof Function ? object : object.constructor, - propertyName, - options - }); - }; -} -var init_exclude_decorator = __esm({ - "node_modules/class-transformer/esm5/decorators/exclude.decorator.js"() { - init_storage(); - } -}); - -// node_modules/class-transformer/esm5/decorators/expose.decorator.js -function Expose(options) { - if (options === void 0) { - options = {}; - } - return function(object, propertyName) { - defaultMetadataStorage.addExposeMetadata({ - target: object instanceof Function ? object : object.constructor, - propertyName, - options - }); - }; -} -var init_expose_decorator = __esm({ - "node_modules/class-transformer/esm5/decorators/expose.decorator.js"() { - init_storage(); - } -}); - -// node_modules/class-transformer/esm5/decorators/transform-instance-to-instance.decorator.js -var init_transform_instance_to_instance_decorator = __esm({ - "node_modules/class-transformer/esm5/decorators/transform-instance-to-instance.decorator.js"() { - } -}); - -// node_modules/class-transformer/esm5/decorators/transform-instance-to-plain.decorator.js -var init_transform_instance_to_plain_decorator = __esm({ - "node_modules/class-transformer/esm5/decorators/transform-instance-to-plain.decorator.js"() { - } -}); - -// node_modules/class-transformer/esm5/decorators/transform-plain-to-instance.decorator.js -var init_transform_plain_to_instance_decorator = __esm({ - "node_modules/class-transformer/esm5/decorators/transform-plain-to-instance.decorator.js"() { - } -}); - -// node_modules/class-transformer/esm5/decorators/transform.decorator.js -function Transform(transformFn, options) { - if (options === void 0) { - options = {}; - } - return function(target, propertyName) { - defaultMetadataStorage.addTransformMetadata({ - target: target.constructor, - propertyName, - transformFn, - options - }); - }; -} -var init_transform_decorator = __esm({ - "node_modules/class-transformer/esm5/decorators/transform.decorator.js"() { - init_storage(); - } -}); - -// node_modules/class-transformer/esm5/decorators/type.decorator.js -function Type(typeFunction, options) { - if (options === void 0) { - options = {}; - } - return function(target, propertyName) { - var reflectedType = Reflect.getMetadata("design:type", target, propertyName); - defaultMetadataStorage.addTypeMetadata({ - target: target.constructor, - propertyName, - reflectedType, - typeFunction, - options - }); - }; -} -var init_type_decorator = __esm({ - "node_modules/class-transformer/esm5/decorators/type.decorator.js"() { - init_storage(); - } -}); - -// node_modules/class-transformer/esm5/decorators/index.js -var init_decorators = __esm({ - "node_modules/class-transformer/esm5/decorators/index.js"() { - init_exclude_decorator(); - init_expose_decorator(); - init_transform_instance_to_instance_decorator(); - init_transform_instance_to_plain_decorator(); - init_transform_plain_to_instance_decorator(); - init_transform_decorator(); - init_type_decorator(); - } -}); - -// node_modules/class-transformer/esm5/interfaces/decorator-options/expose-options.interface.js -var init_expose_options_interface = __esm({ - "node_modules/class-transformer/esm5/interfaces/decorator-options/expose-options.interface.js"() { - } -}); - -// node_modules/class-transformer/esm5/interfaces/decorator-options/exclude-options.interface.js -var init_exclude_options_interface = __esm({ - "node_modules/class-transformer/esm5/interfaces/decorator-options/exclude-options.interface.js"() { - } -}); - -// node_modules/class-transformer/esm5/interfaces/decorator-options/transform-options.interface.js -var init_transform_options_interface = __esm({ - "node_modules/class-transformer/esm5/interfaces/decorator-options/transform-options.interface.js"() { - } -}); - -// node_modules/class-transformer/esm5/interfaces/decorator-options/type-discriminator-descriptor.interface.js -var init_type_discriminator_descriptor_interface = __esm({ - "node_modules/class-transformer/esm5/interfaces/decorator-options/type-discriminator-descriptor.interface.js"() { - } -}); - -// node_modules/class-transformer/esm5/interfaces/decorator-options/type-options.interface.js -var init_type_options_interface = __esm({ - "node_modules/class-transformer/esm5/interfaces/decorator-options/type-options.interface.js"() { - } -}); - -// node_modules/class-transformer/esm5/interfaces/metadata/exclude-metadata.interface.js -var init_exclude_metadata_interface = __esm({ - "node_modules/class-transformer/esm5/interfaces/metadata/exclude-metadata.interface.js"() { - } -}); - -// node_modules/class-transformer/esm5/interfaces/metadata/expose-metadata.interface.js -var init_expose_metadata_interface = __esm({ - "node_modules/class-transformer/esm5/interfaces/metadata/expose-metadata.interface.js"() { - } -}); - -// node_modules/class-transformer/esm5/interfaces/metadata/transform-metadata.interface.js -var init_transform_metadata_interface = __esm({ - "node_modules/class-transformer/esm5/interfaces/metadata/transform-metadata.interface.js"() { - } -}); - -// node_modules/class-transformer/esm5/interfaces/metadata/transform-fn-params.interface.js -var init_transform_fn_params_interface = __esm({ - "node_modules/class-transformer/esm5/interfaces/metadata/transform-fn-params.interface.js"() { - } -}); - -// node_modules/class-transformer/esm5/interfaces/metadata/type-metadata.interface.js -var init_type_metadata_interface = __esm({ - "node_modules/class-transformer/esm5/interfaces/metadata/type-metadata.interface.js"() { - } -}); - -// node_modules/class-transformer/esm5/interfaces/class-constructor.type.js -var init_class_constructor_type = __esm({ - "node_modules/class-transformer/esm5/interfaces/class-constructor.type.js"() { - } -}); - -// node_modules/class-transformer/esm5/interfaces/class-transformer-options.interface.js -var init_class_transformer_options_interface = __esm({ - "node_modules/class-transformer/esm5/interfaces/class-transformer-options.interface.js"() { - } -}); - -// node_modules/class-transformer/esm5/interfaces/target-map.interface.js -var init_target_map_interface = __esm({ - "node_modules/class-transformer/esm5/interfaces/target-map.interface.js"() { - } -}); - -// node_modules/class-transformer/esm5/interfaces/type-help-options.interface.js -var init_type_help_options_interface = __esm({ - "node_modules/class-transformer/esm5/interfaces/type-help-options.interface.js"() { - } -}); - -// node_modules/class-transformer/esm5/interfaces/index.js -var init_interfaces = __esm({ - "node_modules/class-transformer/esm5/interfaces/index.js"() { - init_expose_options_interface(); - init_exclude_options_interface(); - init_transform_options_interface(); - init_type_discriminator_descriptor_interface(); - init_type_options_interface(); - init_exclude_metadata_interface(); - init_expose_metadata_interface(); - init_transform_metadata_interface(); - init_transform_fn_params_interface(); - init_type_metadata_interface(); - init_class_constructor_type(); - init_class_transformer_options_interface(); - init_target_map_interface(); - init_type_help_options_interface(); - } -}); - -// node_modules/class-transformer/esm5/index.js -function instanceToPlain(object, options) { - return classTransformer.instanceToPlain(object, options); -} -function plainToInstance(cls, plain, options) { - return classTransformer.plainToInstance(cls, plain, options); -} -function instanceToInstance(object, options) { - return classTransformer.instanceToInstance(object, options); -} -var classTransformer; -var init_esm5 = __esm({ - "node_modules/class-transformer/esm5/index.js"() { - init_ClassTransformer(); - init_decorators(); - init_interfaces(); - init_enums(); - classTransformer = new ClassTransformer(); - } -}); - -// node_modules/scule/dist/index.mjs -function isUppercase(char = "") { - if (NUMBER_CHAR_RE.test(char)) { - return void 0; - } - return char.toUpperCase() === char; -} -function splitByCase(string_, separators) { - const splitters = separators ?? STR_SPLITTERS; - const parts = []; - if (!string_ || typeof string_ !== "string") { - return parts; - } - let buff = ""; - let previousUpper; - let previousSplitter; - for (const char of string_) { - const isSplitter = splitters.includes(char); - if (isSplitter === true) { - parts.push(buff); - buff = ""; - previousUpper = void 0; - continue; + return ""; + }); } - const isUpper = isUppercase(char); - if (previousSplitter === false) { - if (previousUpper === false && isUpper === true) { - parts.push(buff); - buff = char; - previousUpper = isUpper; - continue; - } - if (previousUpper === true && isUpper === false && buff.length > 1) { - const lastChar = buff[buff.length - 1]; - parts.push(buff.slice(0, Math.max(0, buff.length - 1))); - buff = lastChar + char; - previousUpper = isUpper; - continue; + exports.tryGetExecutablePath = tryGetExecutablePath; + function normalizeSeparators(p2) { + p2 = p2 || ""; + if (exports.IS_WINDOWS) { + p2 = p2.replace(/\//g, "\\"); + return p2.replace(/\\\\+/g, "\\"); } + return p2.replace(/\/\/+/g, "/"); } - buff += char; - previousUpper = isUpper; - previousSplitter = isSplitter; - } - parts.push(buff); - return parts; -} -function kebabCase(string_, joiner) { - return !string_ ? "" : (Array.isArray(string_) ? string_ : splitByCase(string_)).map((p2) => p2.toLowerCase()).join(joiner ?? "-"); -} -function snakeCase(string_) { - return kebabCase(string_, "_"); -} -var NUMBER_CHAR_RE, STR_SPLITTERS; -var init_dist = __esm({ - "node_modules/scule/dist/index.mjs"() { - NUMBER_CHAR_RE = /\d/; - STR_SPLITTERS = ["-", "_", "/", "."]; - } -}); - -// src/util/decorators.ts -import path from "node:path"; -import { env } from "node:process"; -function Exception(constructor) { - const name2 = constructor.name; - Object.defineProperties(constructor.prototype, { - name: { - value: name2 - }, - [Symbol.toStringTag]: { - get: function() { - return this.name; - } - }, - toJSON: { - value: function() { - return {}; - } + function isUnixExecutable(stats) { + return (stats.mode & 1) > 0 || (stats.mode & 8) > 0 && stats.gid === process.getgid() || (stats.mode & 64) > 0 && stats.uid === process.getuid(); } - }); -} -function Case(letterCase) { - function decorator(target, key) { - const metadatas = defaultMetadataStorage.getExposedMetadatas( - target instanceof Function ? target : target.constructor - ); - if (key !== void 0) { - const name2 = CASE[letterCase](key); - const metadata3 = metadatas.find((data) => data.propertyName === key); - if (metadata3 === void 0) { - Expose({ name: name2 })(target, key); - } else { - metadata3.options.name = name2; - } - } else { - for (const metadata3 of metadatas) { - if (metadata3.propertyName !== void 0) { - metadata3.options.name = CASE[letterCase](metadata3.propertyName); - } - } + function getCmdPath() { + var _a3; + return (_a3 = process.env["COMSPEC"]) !== null && _a3 !== void 0 ? _a3 : `cmd.exe`; } - } - return decorator; -} -function FromEnv(key) { - return Transform(({ value }) => env[key] ?? value); -} -var CASE, AsPath; -var init_decorators2 = __esm({ - "src/util/decorators.ts"() { - "use strict"; - init_esm5(); - init_storage(); - init_dist(); - CASE = { - kebab: kebabCase, - snake: snakeCase - }; - AsPath = Transform( - ({ value }) => value === void 0 ? void 0 : path.normalize(value) - ); + exports.getCmdPath = getCmdPath; } }); -// src/shim/abort-controller.ts -var abort_controller_exports = {}; -__export(abort_controller_exports, { - AbortController: () => AbortController, - AbortError: () => AbortError, - AbortSignal: () => AbortSignal -}); -var AbortError, AbortController, AbortSignal; -var init_abort_controller = __esm({ - "src/shim/abort-controller.ts"() { +// node_modules/@actions/io/lib/io.js +var require_io = __commonJS({ + "node_modules/@actions/io/lib/io.js"(exports) { "use strict"; - init_decorators2(); - AbortError = class extends Error { - type = "aborted"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; }; - AbortError = __decorateClass([ - Exception - ], AbortError); - ({ AbortController, AbortSignal } = globalThis); - } -}); - -// node_modules/@azure/core-http/dist-esm/src/url.js -function isAlphaNumericCharacter(character) { - const characterCode = character.charCodeAt(0); - return 48 <= characterCode && characterCode <= 57 || 65 <= characterCode && characterCode <= 90 || 97 <= characterCode && characterCode <= 122; -} -function readRemaining(tokenizer) { - let result = ""; - if (tokenizer._currentIndex < tokenizer._textLength) { - result = tokenizer._text.substring(tokenizer._currentIndex); - tokenizer._currentIndex = tokenizer._textLength; - } - return result; -} -function hasCurrentCharacter(tokenizer) { - return tokenizer._currentIndex < tokenizer._textLength; -} -function getCurrentCharacter(tokenizer) { - return tokenizer._text[tokenizer._currentIndex]; -} -function nextCharacter(tokenizer, step) { - if (hasCurrentCharacter(tokenizer)) { - if (!step) { - step = 1; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve2) { + resolve2(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; + var assert_1 = __require("assert"); + var path14 = __importStar(__require("path")); + var ioUtil = __importStar(require_io_util()); + function cp(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + const { force, recursive, copySourceDirectory } = readCopyOptions(options); + const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; + if (destStat && destStat.isFile() && !force) { + return; + } + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path14.join(dest, path14.basename(source)) : dest; + if (!(yield ioUtil.exists(source))) { + throw new Error(`no such file or directory: ${source}`); + } + const sourceStat = yield ioUtil.stat(source); + if (sourceStat.isDirectory()) { + if (!recursive) { + throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); + } else { + yield cpDirRecursive(source, newDest, 0, force); + } + } else { + if (path14.relative(source, newDest) === "") { + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(source, newDest, force); + } + }); } - tokenizer._currentIndex += step; - } -} -function peekCharacters(tokenizer, charactersToPeek) { - let endIndex = tokenizer._currentIndex + charactersToPeek; - if (tokenizer._textLength < endIndex) { - endIndex = tokenizer._textLength; - } - return tokenizer._text.substring(tokenizer._currentIndex, endIndex); -} -function readWhile(tokenizer, condition) { - let result = ""; - while (hasCurrentCharacter(tokenizer)) { - const currentCharacter = getCurrentCharacter(tokenizer); - if (!condition(currentCharacter)) { - break; - } else { - result += currentCharacter; - nextCharacter(tokenizer); + exports.cp = cp; + function mv(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + if (yield ioUtil.exists(dest)) { + let destExists = true; + if (yield ioUtil.isDirectory(dest)) { + dest = path14.join(dest, path14.basename(source)); + destExists = yield ioUtil.exists(dest); + } + if (destExists) { + if (options.force == null || options.force) { + yield rmRF2(dest); + } else { + throw new Error("Destination already exists"); + } + } + } + yield mkdirP(path14.dirname(dest)); + yield ioUtil.rename(source, dest); + }); } - } - return result; -} -function readWhileLetterOrDigit(tokenizer) { - return readWhile(tokenizer, (character) => isAlphaNumericCharacter(character)); -} -function readUntilCharacter(tokenizer, ...terminatingCharacters) { - return readWhile(tokenizer, (character) => terminatingCharacters.indexOf(character) === -1); -} -function nextScheme(tokenizer) { - const scheme = readWhileLetterOrDigit(tokenizer); - tokenizer._currentToken = URLToken.scheme(scheme); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentState = "DONE"; - } else { - tokenizer._currentState = "HOST"; - } -} -function nextSchemeOrHost(tokenizer) { - const schemeOrHost = readUntilCharacter(tokenizer, ":", "/", "?"); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentToken = URLToken.host(schemeOrHost); - tokenizer._currentState = "DONE"; - } else if (getCurrentCharacter(tokenizer) === ":") { - if (peekCharacters(tokenizer, 3) === "://") { - tokenizer._currentToken = URLToken.scheme(schemeOrHost); - tokenizer._currentState = "HOST"; - } else { - tokenizer._currentToken = URLToken.host(schemeOrHost); - tokenizer._currentState = "PORT"; + exports.mv = mv; + function rmRF2(inputPath) { + return __awaiter(this, void 0, void 0, function* () { + if (ioUtil.IS_WINDOWS) { + if (/[*"<>|]/.test(inputPath)) { + throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + } + } + try { + yield ioUtil.rm(inputPath, { + force: true, + maxRetries: 3, + recursive: true, + retryDelay: 300 + }); + } catch (err) { + throw new Error(`File was unable to be removed ${err}`); + } + }); } - } else { - tokenizer._currentToken = URLToken.host(schemeOrHost); - if (getCurrentCharacter(tokenizer) === "/") { - tokenizer._currentState = "PATH"; - } else { - tokenizer._currentState = "QUERY"; + exports.rmRF = rmRF2; + function mkdirP(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + assert_1.ok(fsPath, "a path argument must be provided"); + yield ioUtil.mkdir(fsPath, { recursive: true }); + }); } - } -} -function nextHost(tokenizer) { - if (peekCharacters(tokenizer, 3) === "://") { - nextCharacter(tokenizer, 3); - } - const host = readUntilCharacter(tokenizer, ":", "/", "?"); - tokenizer._currentToken = URLToken.host(host); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentState = "DONE"; - } else if (getCurrentCharacter(tokenizer) === ":") { - tokenizer._currentState = "PORT"; - } else if (getCurrentCharacter(tokenizer) === "/") { - tokenizer._currentState = "PATH"; - } else { - tokenizer._currentState = "QUERY"; - } -} -function nextPort(tokenizer) { - if (getCurrentCharacter(tokenizer) === ":") { - nextCharacter(tokenizer); - } - const port = readUntilCharacter(tokenizer, "/", "?"); - tokenizer._currentToken = URLToken.port(port); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentState = "DONE"; - } else if (getCurrentCharacter(tokenizer) === "/") { - tokenizer._currentState = "PATH"; - } else { - tokenizer._currentState = "QUERY"; - } -} -function nextPath(tokenizer) { - const path15 = readUntilCharacter(tokenizer, "?"); - tokenizer._currentToken = URLToken.path(path15); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentState = "DONE"; - } else { - tokenizer._currentState = "QUERY"; - } -} -function nextQuery(tokenizer) { - if (getCurrentCharacter(tokenizer) === "?") { - nextCharacter(tokenizer); - } - const query = readRemaining(tokenizer); - tokenizer._currentToken = URLToken.query(query); - tokenizer._currentState = "DONE"; -} -var URLQuery, URLBuilder, URLToken, URLTokenizer; -var init_url = __esm({ - "node_modules/@azure/core-http/dist-esm/src/url.js"() { - init_utils(); - URLQuery = class _URLQuery { - constructor() { - this._rawQuery = {}; - } - /** - * Get whether or not there any query parameters in this URLQuery. - */ - any() { - return Object.keys(this._rawQuery).length > 0; - } - /** - * Get the keys of the query string. - */ - keys() { - return Object.keys(this._rawQuery); - } - /** - * Set a query parameter with the provided name and value. If the parameterValue is undefined or - * empty, then this will attempt to remove an existing query parameter with the provided - * parameterName. - */ - set(parameterName, parameterValue) { - const caseParameterValue = parameterValue; - if (parameterName) { - if (caseParameterValue !== void 0 && caseParameterValue !== null) { - const newValue = Array.isArray(caseParameterValue) ? caseParameterValue : caseParameterValue.toString(); - this._rawQuery[parameterName] = newValue; - } else { - delete this._rawQuery[parameterName]; - } + exports.mkdirP = mkdirP; + function which(tool, check) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); } - } - /** - * Get the value of the query parameter with the provided name. If no parameter exists with the - * provided parameter name, then undefined will be returned. - */ - get(parameterName) { - return parameterName ? this._rawQuery[parameterName] : void 0; - } - /** - * Get the string representation of this query. The return value will not start with a "?". - */ - toString() { - let result = ""; - for (const parameterName in this._rawQuery) { - if (result) { - result += "&"; + if (check) { + const result = yield which(tool, false); + if (!result) { + if (ioUtil.IS_WINDOWS) { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); + } else { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); + } } - const parameterValue = this._rawQuery[parameterName]; - if (Array.isArray(parameterValue)) { - const parameterStrings = []; - for (const parameterValueElement of parameterValue) { - parameterStrings.push(`${parameterName}=${parameterValueElement}`); + return result; + } + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ""; + }); + } + exports.which = which; + function findInPath(tool) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + const extensions = []; + if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { + for (const extension of process.env["PATHEXT"].split(path14.delimiter)) { + if (extension) { + extensions.push(extension); } - result += parameterStrings.join("&"); - } else { - result += `${parameterName}=${parameterValue}`; } } - return result; - } - /** - * Parse a URLQuery from the provided text. - */ - static parse(text) { - const result = new _URLQuery(); - if (text) { - if (text.startsWith("?")) { - text = text.substring(1); + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; } - let currentState = "ParameterName"; - let parameterName = ""; - let parameterValue = ""; - for (let i2 = 0; i2 < text.length; ++i2) { - const currentCharacter = text[i2]; - switch (currentState) { - case "ParameterName": - switch (currentCharacter) { - case "=": - currentState = "ParameterValue"; - break; - case "&": - parameterName = ""; - parameterValue = ""; - break; - default: - parameterName += currentCharacter; - break; - } - break; - case "ParameterValue": - switch (currentCharacter) { - case "&": - result.set(parameterName, parameterValue); - parameterName = ""; - parameterValue = ""; - currentState = "ParameterName"; - break; - default: - parameterValue += currentCharacter; - break; - } - break; - default: - throw new Error("Unrecognized URLQuery parse state: " + currentState); + return []; + } + if (tool.includes(path14.sep)) { + return []; + } + const directories = []; + if (process.env.PATH) { + for (const p2 of process.env.PATH.split(path14.delimiter)) { + if (p2) { + directories.push(p2); } } - if (currentState === "ParameterValue") { - result.set(parameterName, parameterValue); + } + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path14.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); } } - return result; - } - }; - URLBuilder = class _URLBuilder { - /** - * Set the scheme/protocol for this URL. If the provided scheme contains other parts of a URL - * (such as a host, port, path, or query), those parts will be added to this URL as well. - */ - setScheme(scheme) { - if (!scheme) { - this._scheme = void 0; - } else { - this.set(scheme, "SCHEME"); + return matches; + }); + } + exports.findInPath = findInPath; + function readCopyOptions(options) { + const force = options.force == null ? true : options.force; + const recursive = Boolean(options.recursive); + const copySourceDirectory = options.copySourceDirectory == null ? true : Boolean(options.copySourceDirectory); + return { force, recursive, copySourceDirectory }; + } + function cpDirRecursive(sourceDir, destDir, currentDepth, force) { + return __awaiter(this, void 0, void 0, function* () { + if (currentDepth >= 255) + return; + currentDepth++; + yield mkdirP(destDir); + const files = yield ioUtil.readdir(sourceDir); + for (const fileName of files) { + const srcFile = `${sourceDir}/${fileName}`; + const destFile = `${destDir}/${fileName}`; + const srcFileStat = yield ioUtil.lstat(srcFile); + if (srcFileStat.isDirectory()) { + yield cpDirRecursive(srcFile, destFile, currentDepth, force); + } else { + yield copyFile(srcFile, destFile, force); + } } - } - /** - * Get the scheme that has been set in this URL. - */ - getScheme() { - return this._scheme; - } - /** - * Set the host for this URL. If the provided host contains other parts of a URL (such as a - * port, path, or query), those parts will be added to this URL as well. - */ - setHost(host) { - if (!host) { - this._host = void 0; - } else { - this.set(host, "SCHEME_OR_HOST"); + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); + } + function copyFile(srcFile, destFile, force) { + return __awaiter(this, void 0, void 0, function* () { + if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { + try { + yield ioUtil.lstat(destFile); + yield ioUtil.unlink(destFile); + } catch (e2) { + if (e2.code === "EPERM") { + yield ioUtil.chmod(destFile, "0666"); + yield ioUtil.unlink(destFile); + } + } + const symlinkFull = yield ioUtil.readlink(srcFile); + yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? "junction" : null); + } else if (!(yield ioUtil.exists(destFile)) || force) { + yield ioUtil.copyFile(srcFile, destFile); } + }); + } + } +}); + +// node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner = __commonJS({ + "node_modules/@actions/exec/lib/toolrunner.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); } - /** - * Get the host that has been set in this URL. - */ - getHost() { - return this._host; + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve2) { + resolve2(value); + }); } - /** - * Set the port for this URL. If the provided port contains other parts of a URL (such as a - * path or query), those parts will be added to this URL as well. - */ - setPort(port) { - if (port === void 0 || port === null || port === "") { - this._port = void 0; - } else { - this.set(port.toString(), "PORT"); + return new (P2 || (P2 = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e2) { + reject(e2); + } } - } - /** - * Get the port that has been set in this URL. - */ - getPort() { - return this._port; - } - /** - * Set the path for this URL. If the provided path contains a query, then it will be added to - * this URL as well. - */ - setPath(path15) { - if (!path15) { - this._path = void 0; - } else { - const schemeIndex = path15.indexOf("://"); - if (schemeIndex !== -1) { - const schemeStart = path15.lastIndexOf("/", schemeIndex); - this.set(schemeStart === -1 ? path15 : path15.substr(schemeStart + 1), "SCHEME"); - } else { - this.set(path15, "PATH"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); } } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.argStringToArray = exports.ToolRunner = void 0; + var os3 = __importStar(__require("os")); + var events = __importStar(__require("events")); + var child = __importStar(__require("child_process")); + var path14 = __importStar(__require("path")); + var io2 = __importStar(require_io()); + var ioUtil = __importStar(require_io_util()); + var timers_1 = __require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner = class extends events.EventEmitter { + constructor(toolPath, args, options) { + super(); + if (!toolPath) { + throw new Error("Parameter 'toolPath' cannot be null or empty."); + } + this.toolPath = toolPath; + this.args = args || []; + this.options = options || {}; } - /** - * Append the provided path to this URL's existing path. If the provided path contains a query, - * then it will be added to this URL as well. - */ - appendPath(path15) { - if (path15) { - let currentPath = this.getPath(); - if (currentPath) { - if (!currentPath.endsWith("/")) { - currentPath += "/"; + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } + } + _getCommandString(options, noPrefix) { + const toolPath = this._getSpawnFileName(); + const args = this._getSpawnArgs(options); + let cmd = noPrefix ? "" : "[command]"; + if (IS_WINDOWS) { + if (this._isCmdFile()) { + cmd += toolPath; + for (const a2 of args) { + cmd += ` ${a2}`; + } + } else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a2 of args) { + cmd += ` ${a2}`; } - if (path15.startsWith("/")) { - path15 = path15.substring(1); + } else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a2 of args) { + cmd += ` ${this._windowsQuoteCmdArg(a2)}`; } - path15 = currentPath + path15; } - this.set(path15, "PATH"); - } - } - /** - * Get the path that has been set in this URL. - */ - getPath() { - return this._path; - } - /** - * Set the query in this URL. - */ - setQuery(query) { - if (!query) { - this._query = void 0; } else { - this._query = URLQuery.parse(query); + cmd += toolPath; + for (const a2 of args) { + cmd += ` ${a2}`; + } } + return cmd; } - /** - * Set a query parameter with the provided name and value in this URL's query. If the provided - * query parameter value is undefined or empty, then the query parameter will be removed if it - * existed. - */ - setQueryParameter(queryParameterName, queryParameterValue) { - if (queryParameterName) { - if (!this._query) { - this._query = new URLQuery(); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s2 = strBuffer + data.toString(); + let n2 = s2.indexOf(os3.EOL); + while (n2 > -1) { + const line = s2.substring(0, n2); + onLine(line); + s2 = s2.substring(n2 + os3.EOL.length); + n2 = s2.indexOf(os3.EOL); } - this._query.set(queryParameterName, queryParameterValue); + return s2; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; } } - /** - * Get the value of the query parameter with the provided query parameter name. If no query - * parameter exists with the provided name, then undefined will be returned. - */ - getQueryParameterValue(queryParameterName) { - return this._query ? this._query.get(queryParameterName) : void 0; - } - /** - * Get the query in this URL. - */ - getQuery() { - return this._query ? this._query.toString() : void 0; + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } + } + return this.toolPath; } - /** - * Set the parts of this URL by parsing the provided text using the provided startState. - */ - set(text, startState) { - const tokenizer = new URLTokenizer(text, startState); - while (tokenizer.next()) { - const token = tokenizer.current(); - let tokenPath; - if (token) { - switch (token.type) { - case "SCHEME": - this._scheme = token.text || void 0; - break; - case "HOST": - this._host = token.text || void 0; - break; - case "PORT": - this._port = token.text || void 0; - break; - case "PATH": - tokenPath = token.text || void 0; - if (!this._path || this._path === "/" || tokenPath !== "/") { - this._path = tokenPath; - } - break; - case "QUERY": - this._query = URLQuery.parse(token.text); - break; - default: - throw new Error(`Unrecognized URLTokenType: ${token.type}`); + _getSpawnArgs(options) { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; + for (const a2 of this.args) { + argline += " "; + argline += options.windowsVerbatimArguments ? a2 : this._windowsQuoteCmdArg(a2); } + argline += '"'; + return [argline]; } } + return this.args; } - /** - * Serializes the URL as a string. - * @returns the URL as a string. - */ - toString() { - let result = ""; - if (this._scheme) { - result += `${this._scheme}://`; + _endsWith(str, end) { + return str.endsWith(end); + } + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); + } + _windowsQuoteCmdArg(arg) { + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - if (this._host) { - result += this._host; + if (!arg) { + return '""'; } - if (this._port) { - result += `:${this._port}`; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x2) => x2 === char)) { + needsQuotes = true; + break; + } } - if (this._path) { - if (!this._path.startsWith("/")) { - result += "/"; + if (!needsQuotes) { + return arg; + } + let reverse = '"'; + let quoteHit = true; + for (let i2 = arg.length; i2 > 0; i2--) { + reverse += arg[i2 - 1]; + if (quoteHit && arg[i2 - 1] === "\\") { + reverse += "\\"; + } else if (arg[i2 - 1] === '"') { + quoteHit = true; + reverse += '"'; + } else { + quoteHit = false; } - result += this._path; } - if (this._query && this._query.any()) { - result += `?${this._query.toString()}`; + reverse += '"'; + return reverse.split("").reverse().join(""); + } + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; + } + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; + } + if (!arg.includes('"') && !arg.includes("\\")) { + return `"${arg}"`; + } + let reverse = '"'; + let quoteHit = true; + for (let i2 = arg.length; i2 > 0; i2--) { + reverse += arg[i2 - 1]; + if (quoteHit && arg[i2 - 1] === "\\") { + reverse += "\\"; + } else if (arg[i2 - 1] === '"') { + quoteHit = true; + reverse += "\\"; + } else { + quoteHit = false; + } } + reverse += '"'; + return reverse.split("").reverse().join(""); + } + _cloneExecOptions(options) { + options = options || {}; + const result = { + cwd: options.cwd || process.cwd(), + env: options.env || process.env, + silent: options.silent || false, + windowsVerbatimArguments: options.windowsVerbatimArguments || false, + failOnStdErr: options.failOnStdErr || false, + ignoreReturnCode: options.ignoreReturnCode || false, + delay: options.delay || 1e4 + }; + result.outStream = options.outStream || process.stdout; + result.errStream = options.errStream || process.stderr; return result; } - /** - * If the provided searchValue is found in this URLBuilder, then replace it with the provided - * replaceValue. - */ - replaceAll(searchValue, replaceValue) { - if (searchValue) { - this.setScheme(replaceAll(this.getScheme(), searchValue, replaceValue)); - this.setHost(replaceAll(this.getHost(), searchValue, replaceValue)); - this.setPort(replaceAll(this.getPort(), searchValue, replaceValue)); - this.setPath(replaceAll(this.getPath(), searchValue, replaceValue)); - this.setQuery(replaceAll(this.getQuery(), searchValue, replaceValue)); + _getSpawnOptions(options, toolPath) { + options = options || {}; + const result = {}; + result.cwd = options.cwd; + result.env = options.env; + result["windowsVerbatimArguments"] = options.windowsVerbatimArguments || this._isCmdFile(); + if (options.windowsVerbatimArguments) { + result.argv0 = `"${toolPath}"`; } + return result; } /** - * Parses a given string URL into a new {@link URLBuilder}. + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See ExecOptions + * @returns number */ - static parse(text) { - const result = new _URLBuilder(); - result.set(text, "SCHEME_OR_HOST"); - return result; + exec() { + return __awaiter(this, void 0, void 0, function* () { + if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { + this.toolPath = path14.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io2.which(this.toolPath, true); + return new Promise((resolve2, reject) => __awaiter(this, void 0, void 0, function* () { + this._debug(`exec tool: ${this.toolPath}`); + this._debug("arguments:"); + for (const arg of this.args) { + this._debug(` ${arg}`); + } + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os3.EOL); + } + const state = new ExecState(optionsNonNull, this.toolPath); + state.on("debug", (message) => { + this._debug(message); + }); + if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { + return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); + } + const fileName = this._getSpawnFileName(); + const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); + let stdbuffer = ""; + if (cp.stdout) { + cp.stdout.on("data", (data) => { + if (this.options.listeners && this.options.listeners.stdout) { + this.options.listeners.stdout(data); + } + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(data); + } + stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { + if (this.options.listeners && this.options.listeners.stdline) { + this.options.listeners.stdline(line); + } + }); + }); + } + let errbuffer = ""; + if (cp.stderr) { + cp.stderr.on("data", (data) => { + state.processStderr = true; + if (this.options.listeners && this.options.listeners.stderr) { + this.options.listeners.stderr(data); + } + if (!optionsNonNull.silent && optionsNonNull.errStream && optionsNonNull.outStream) { + const s2 = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; + s2.write(data); + } + errbuffer = this._processLineBuffer(data, errbuffer, (line) => { + if (this.options.listeners && this.options.listeners.errline) { + this.options.listeners.errline(line); + } + }); + }); + } + cp.on("error", (err) => { + state.processError = err.message; + state.processExited = true; + state.processClosed = true; + state.CheckComplete(); + }); + cp.on("exit", (code) => { + state.processExitCode = code; + state.processExited = true; + this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); + state.CheckComplete(); + }); + cp.on("close", (code) => { + state.processExitCode = code; + state.processExited = true; + state.processClosed = true; + this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); + state.CheckComplete(); + }); + state.on("done", (error, exitCode) => { + if (stdbuffer.length > 0) { + this.emit("stdline", stdbuffer); + } + if (errbuffer.length > 0) { + this.emit("errline", errbuffer); + } + cp.removeAllListeners(); + if (error) { + reject(error); + } else { + resolve2(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } }; - URLToken = class _URLToken { - constructor(text, type3) { - this.text = text; - this.type = type3; - } - static scheme(text) { - return new _URLToken(text, "SCHEME"); - } - static host(text) { - return new _URLToken(text, "HOST"); + exports.ToolRunner = ToolRunner; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c2) { + if (escaped && c2 !== '"') { + arg += "\\"; + } + arg += c2; + escaped = false; } - static port(text) { - return new _URLToken(text, "PORT"); + for (let i2 = 0; i2 < argString.length; i2++) { + const c2 = argString.charAt(i2); + if (c2 === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } else { + append(c2); + } + continue; + } + if (c2 === "\\" && escaped) { + append(c2); + continue; + } + if (c2 === "\\" && inQuotes) { + escaped = true; + continue; + } + if (c2 === " " && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ""; + } + continue; + } + append(c2); } - static path(text) { - return new _URLToken(text, "PATH"); + if (arg.length > 0) { + args.push(arg.trim()); } - static query(text) { - return new _URLToken(text, "QUERY"); + return args; + } + exports.argStringToArray = argStringToArray; + var ExecState = class _ExecState extends events.EventEmitter { + constructor(options, toolPath) { + super(); + this.processClosed = false; + this.processError = ""; + this.processExitCode = 0; + this.processExited = false; + this.processStderr = false; + this.delay = 1e4; + this.done = false; + this.timeout = null; + if (!toolPath) { + throw new Error("toolPath must not be empty"); + } + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; + } } - }; - URLTokenizer = class { - constructor(_text, state) { - this._text = _text; - this._textLength = _text ? _text.length : 0; - this._currentState = state !== void 0 && state !== null ? state : "SCHEME_OR_HOST"; - this._currentIndex = 0; + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); + } } - /** - * Get the current URLToken this URLTokenizer is pointing at, or undefined if the URLTokenizer - * hasn't started or has finished tokenizing. - */ - current() { - return this._currentToken; + _debug(message) { + this.emit("debug", message); } - /** - * Advance to the next URLToken and return whether or not a URLToken was found. - */ - next() { - if (!hasCurrentCharacter(this)) { - this._currentToken = void 0; - } else { - switch (this._currentState) { - case "SCHEME": - nextScheme(this); - break; - case "SCHEME_OR_HOST": - nextSchemeOrHost(this); - break; - case "HOST": - nextHost(this); - break; - case "PORT": - nextPort(this); - break; - case "PATH": - nextPath(this); - break; - case "QUERY": - nextQuery(this); - break; - default: - throw new Error(`Unrecognized URLTokenizerState: ${this._currentState}`); + _setResult() { + let error; + if (this.processExited) { + if (this.processError) { + error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); + } else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { + error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + } else if (this.processStderr && this.options.failOnStdErr) { + error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } - return !!this._currentToken; + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.done = true; + this.emit("done", error, this.processExitCode); + } + static HandleTimeout(state) { + if (state.done) { + return; + } + if (!state.processClosed && state.processExited) { + const message = `The STDIO streams did not close within ${state.delay / 1e3} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; + state._debug(message); + } + state._setResult(); } }; } }); -// node_modules/@azure/core-http/dist-esm/src/proxyAgent.js -function createProxyAgent(requestUrl, proxySettings, headers) { - const host = URLBuilder.parse(proxySettings.host).getHost(); - if (!host) { - throw new Error("Expecting a non-empty host in proxy settings."); - } - if (!isValidPort(proxySettings.port)) { - throw new Error("Expecting a valid port number in the range of [0, 65535] in proxy settings."); - } - const tunnelOptions = { - proxy: { - host, - port: proxySettings.port, - headers: headers && headers.rawHeaders() || {} - } - }; - if (proxySettings.username && proxySettings.password) { - tunnelOptions.proxy.proxyAuth = `${proxySettings.username}:${proxySettings.password}`; - } else if (proxySettings.username) { - tunnelOptions.proxy.proxyAuth = `${proxySettings.username}`; - } - const isRequestHttps = isUrlHttps(requestUrl); - const isProxyHttps = isUrlHttps(proxySettings.host); - const proxyAgent = { - isHttps: isRequestHttps, - agent: createTunnel(isRequestHttps, isProxyHttps, tunnelOptions) - }; - return proxyAgent; -} -function isUrlHttps(url2) { - const urlScheme = URLBuilder.parse(url2).getScheme() || ""; - return urlScheme.toLowerCase() === "https"; -} -function createTunnel(isRequestHttps, isProxyHttps, tunnelOptions) { - if (isRequestHttps && isProxyHttps) { - return tunnel.httpsOverHttps(tunnelOptions); - } else if (isRequestHttps && !isProxyHttps) { - return tunnel.httpsOverHttp(tunnelOptions); - } else if (!isRequestHttps && isProxyHttps) { - return tunnel.httpOverHttps(tunnelOptions); - } else { - return tunnel.httpOverHttp(tunnelOptions); - } -} -function isValidPort(port) { - return 0 <= port && port <= 65535; -} -var tunnel; -var init_proxyAgent = __esm({ - "node_modules/@azure/core-http/dist-esm/src/proxyAgent.js"() { - tunnel = __toESM(require_tunnel2()); - init_url(); - } -}); - -// node_modules/delayed-stream/lib/delayed_stream.js -var require_delayed_stream = __commonJS({ - "node_modules/delayed-stream/lib/delayed_stream.js"(exports, module) { - var Stream2 = __require("stream").Stream; - var util3 = __require("util"); - module.exports = DelayedStream; - function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; - } - util3.inherits(DelayedStream, Stream2); - DelayedStream.create = function(source, options) { - var delayedStream = new this(); - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; - } - delayedStream.source = source; - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; - source.on("error", function() { - }); - if (delayedStream.pauseStream) { - source.pause(); +// node_modules/@actions/exec/lib/exec.js +var require_exec = __commonJS({ + "node_modules/@actions/exec/lib/exec.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); } - return delayedStream; + __setModuleDefault(result, mod); + return result; }; - Object.defineProperty(DelayedStream.prototype, "readable", { - configurable: true, - enumerable: true, - get: function() { - return this.source.readable; - } - }); - DelayedStream.prototype.setEncoding = function() { - return this.source.setEncoding.apply(this.source, arguments); - }; - DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); - } - this.source.resume(); - }; - DelayedStream.prototype.pause = function() { - this.source.pause(); - }; - DelayedStream.prototype.release = function() { - this._released = true; - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; - }; - DelayedStream.prototype.pipe = function() { - var r2 = Stream2.prototype.pipe.apply(this, arguments); - this.resume(); - return r2; - }; - DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; - } - if (args[0] === "data") { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); - } - this._bufferedEvents.push(args); - }; - DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; - } - if (this.dataSize <= this.maxDataSize) { - return; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve2) { + resolve2(value); + }); } - this._maxDataSizeExceeded = true; - var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; - this.emit("error", new Error(message)); + return new (P2 || (P2 = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getExecOutput = exports.exec = void 0; + var string_decoder_1 = __require("string_decoder"); + var tr2 = __importStar(require_toolrunner()); + function exec2(commandLine, args, options) { + return __awaiter(this, void 0, void 0, function* () { + const commandArgs = tr2.argStringToArray(commandLine); + if (commandArgs.length === 0) { + throw new Error(`Parameter 'commandLine' cannot be null or empty.`); + } + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr2.ToolRunner(toolPath, args, options); + return runner.exec(); + }); + } + exports.exec = exec2; + function getExecOutput2(commandLine, args, options) { + var _a2, _b2; + return __awaiter(this, void 0, void 0, function* () { + let stdout = ""; + let stderr = ""; + const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); + const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); + const originalStdoutListener = (_a2 = options === null || options === void 0 ? void 0 : options.listeners) === null || _a2 === void 0 ? void 0 : _a2.stdout; + const originalStdErrListener = (_b2 = options === null || options === void 0 ? void 0 : options.listeners) === null || _b2 === void 0 ? void 0 : _b2.stderr; + const stdErrListener = (data) => { + stderr += stderrDecoder.write(data); + if (originalStdErrListener) { + originalStdErrListener(data); + } + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); + } + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); + } + exports.getExecOutput = getExecOutput2; } }); -// node_modules/combined-stream/lib/combined_stream.js -var require_combined_stream = __commonJS({ - "node_modules/combined-stream/lib/combined_stream.js"(exports, module) { - var util3 = __require("util"); - var Stream2 = __require("stream").Stream; - var DelayedStream = require_delayed_stream(); - module.exports = CombinedStream; - function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; - this._released = false; - this._streams = []; - this._currentStream = null; - this._insideLoop = false; - this._pendingNext = false; - } - util3.inherits(CombinedStream, Stream2); - CombinedStream.create = function(options) { - var combinedStream = new this(); - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; +// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js +var require_internal_glob_options_helper = __commonJS({ + "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); } - return combinedStream; - }; - CombinedStream.isStreamLike = function(stream) { - return typeof stream !== "function" && typeof stream !== "string" && typeof stream !== "boolean" && typeof stream !== "number" && !Buffer.isBuffer(stream); + __setModuleDefault(result, mod); + return result; }; - CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - var newStream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams - }); - stream.on("data", this._checkDataSize.bind(this)); - stream = newStream; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getOptions = void 0; + var core2 = __importStar(require_core()); + function getOptions(copy) { + const result = { + followSymbolicLinks: true, + implicitDescendants: true, + omitBrokenSymbolicLinks: true + }; + if (copy) { + if (typeof copy.followSymbolicLinks === "boolean") { + result.followSymbolicLinks = copy.followSymbolicLinks; + core2.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } - this._handleErrors(stream); - if (this.pauseStreams) { - stream.pause(); + if (typeof copy.implicitDescendants === "boolean") { + result.implicitDescendants = copy.implicitDescendants; + core2.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === "boolean") { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core2.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); } } - this._streams.push(stream); - return this; + return result; + } + exports.getOptions = getOptions; + } +}); + +// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js +var require_internal_path_helper = __commonJS({ + "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; }; - CombinedStream.prototype.pipe = function(dest, options) { - Stream2.prototype.pipe.call(this, dest, options); - this.resume(); - return dest; + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; }; - CombinedStream.prototype._getNext = function() { - this._currentStream = null; - if (this._insideLoop) { - this._pendingNext = true; - return; - } - this._insideLoop = true; - try { - do { - this._pendingNext = false; - this._realGetNext(); - } while (this._pendingNext); - } finally { - this._insideLoop = false; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.safeTrimTrailingSeparator = exports.normalizeSeparators = exports.hasRoot = exports.hasAbsoluteRoot = exports.ensureAbsoluteRoot = exports.dirname = void 0; + var path14 = __importStar(__require("path")); + var assert_1 = __importDefault(__require("assert")); + var IS_WINDOWS = process.platform === "win32"; + function dirname(p2) { + p2 = safeTrimTrailingSeparator(p2); + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p2)) { + return p2; } - }; - CombinedStream.prototype._realGetNext = function() { - var stream = this._streams.shift(); - if (typeof stream == "undefined") { - this.end(); - return; + let result = path14.dirname(p2); + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); } - if (typeof stream !== "function") { - this._pipeNext(stream); - return; + return result; + } + exports.dirname = dirname; + function ensureAbsoluteRoot(root, itemPath) { + assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); + assert_1.default(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`); + if (hasAbsoluteRoot(itemPath)) { + return itemPath; } - var getStream = stream; - getStream(function(stream2) { - var isStreamLike = CombinedStream.isStreamLike(stream2); - if (isStreamLike) { - stream2.on("data", this._checkDataSize.bind(this)); - this._handleErrors(stream2); + if (IS_WINDOWS) { + if (itemPath.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)) { + let cwd = process.cwd(); + assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); + if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) { + if (itemPath.length === 2) { + return `${itemPath[0]}:\\${cwd.substr(3)}`; + } else { + if (!cwd.endsWith("\\")) { + cwd += "\\"; + } + return `${itemPath[0]}:\\${cwd.substr(3)}${itemPath.substr(2)}`; + } + } else { + return `${itemPath[0]}:\\${itemPath.substr(2)}`; + } + } else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) { + const cwd = process.cwd(); + assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); + return `${cwd[0]}:\\${itemPath.substr(1)}`; } - this._pipeNext(stream2); - }.bind(this)); - }; - CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on("end", this._getNext.bind(this)); - stream.pipe(this, { end: false }); - return; } - var value = stream; - this.write(value); - this._getNext(); - }; - CombinedStream.prototype._handleErrors = function(stream) { - var self2 = this; - stream.on("error", function(err) { - self2._emitError(err); - }); - }; - CombinedStream.prototype.write = function(data) { - this.emit("data", data); - }; - CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; + assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { + } else { + root += path14.sep; } - if (this.pauseStreams && this._currentStream && typeof this._currentStream.pause == "function") - this._currentStream.pause(); - this.emit("pause"); - }; - CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); + return root + itemPath; + } + exports.ensureAbsoluteRoot = ensureAbsoluteRoot; + function hasAbsoluteRoot(itemPath) { + assert_1.default(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`); + itemPath = normalizeSeparators(itemPath); + if (IS_WINDOWS) { + return itemPath.startsWith("\\\\") || /^[A-Z]:\\/i.test(itemPath); } - if (this.pauseStreams && this._currentStream && typeof this._currentStream.resume == "function") - this._currentStream.resume(); - this.emit("resume"); - }; - CombinedStream.prototype.end = function() { - this._reset(); - this.emit("end"); - }; - CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit("close"); - }; - CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; - }; - CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; + return itemPath.startsWith("/"); + } + exports.hasAbsoluteRoot = hasAbsoluteRoot; + function hasRoot(itemPath) { + assert_1.default(itemPath, `isRooted parameter 'itemPath' must not be empty`); + itemPath = normalizeSeparators(itemPath); + if (IS_WINDOWS) { + return itemPath.startsWith("\\") || /^[A-Z]:/i.test(itemPath); } - var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; - this._emitError(new Error(message)); - }; - CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; - var self2 = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; - } - self2.dataSize += stream.dataSize; - }); - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; + return itemPath.startsWith("/"); + } + exports.hasRoot = hasRoot; + function normalizeSeparators(p2) { + p2 = p2 || ""; + if (IS_WINDOWS) { + p2 = p2.replace(/\//g, "\\"); + const isUnc = /^\\\\+[^\\]/.test(p2); + return (isUnc ? "\\" : "") + p2.replace(/\\\\+/g, "\\"); } - }; - CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit("error", err); - }; + return p2.replace(/\/\/+/g, "/"); + } + exports.normalizeSeparators = normalizeSeparators; + function safeTrimTrailingSeparator(p2) { + if (!p2) { + return ""; + } + p2 = normalizeSeparators(p2); + if (!p2.endsWith(path14.sep)) { + return p2; + } + if (p2 === path14.sep) { + return p2; + } + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p2)) { + return p2; + } + return p2.substr(0, p2.length - 1); + } + exports.safeTrimTrailingSeparator = safeTrimTrailingSeparator; } }); -// node_modules/mime-db/db.json -var require_db = __commonJS({ - "node_modules/mime-db/db.json"(exports, module) { - module.exports = { - "application/1d-interleaved-parityfec": { - source: "iana" - }, - "application/3gpdash-qoe-report+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/3gpp-ims+xml": { - source: "iana", - compressible: true - }, - "application/3gpphal+json": { - source: "iana", - compressible: true - }, - "application/3gpphalforms+json": { - source: "iana", - compressible: true - }, - "application/a2l": { - source: "iana" - }, - "application/ace+cbor": { - source: "iana" - }, - "application/activemessage": { - source: "iana" - }, - "application/activity+json": { - source: "iana", - compressible: true - }, - "application/alto-costmap+json": { - source: "iana", - compressible: true - }, - "application/alto-costmapfilter+json": { - source: "iana", - compressible: true - }, - "application/alto-directory+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointcost+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointcostparams+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointprop+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointpropparams+json": { - source: "iana", - compressible: true - }, - "application/alto-error+json": { - source: "iana", - compressible: true - }, - "application/alto-networkmap+json": { - source: "iana", - compressible: true - }, - "application/alto-networkmapfilter+json": { - source: "iana", - compressible: true - }, - "application/alto-updatestreamcontrol+json": { - source: "iana", - compressible: true - }, - "application/alto-updatestreamparams+json": { - source: "iana", - compressible: true - }, - "application/aml": { - source: "iana" - }, - "application/andrew-inset": { - source: "iana", - extensions: ["ez"] - }, - "application/applefile": { - source: "iana" - }, - "application/applixware": { - source: "apache", - extensions: ["aw"] - }, - "application/at+jwt": { - source: "iana" - }, - "application/atf": { - source: "iana" - }, - "application/atfx": { - source: "iana" - }, - "application/atom+xml": { - source: "iana", - compressible: true, - extensions: ["atom"] - }, - "application/atomcat+xml": { - source: "iana", - compressible: true, - extensions: ["atomcat"] - }, - "application/atomdeleted+xml": { - source: "iana", - compressible: true, - extensions: ["atomdeleted"] - }, - "application/atomicmail": { - source: "iana" - }, - "application/atomsvc+xml": { - source: "iana", - compressible: true, - extensions: ["atomsvc"] - }, - "application/atsc-dwd+xml": { - source: "iana", - compressible: true, - extensions: ["dwd"] - }, - "application/atsc-dynamic-event-message": { - source: "iana" - }, - "application/atsc-held+xml": { - source: "iana", - compressible: true, - extensions: ["held"] - }, - "application/atsc-rdt+json": { - source: "iana", - compressible: true - }, - "application/atsc-rsat+xml": { - source: "iana", - compressible: true, - extensions: ["rsat"] - }, - "application/atxml": { - source: "iana" - }, - "application/auth-policy+xml": { - source: "iana", - compressible: true - }, - "application/bacnet-xdd+zip": { - source: "iana", - compressible: false - }, - "application/batch-smtp": { - source: "iana" - }, - "application/bdoc": { - compressible: false, - extensions: ["bdoc"] - }, - "application/beep+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/calendar+json": { - source: "iana", - compressible: true - }, - "application/calendar+xml": { - source: "iana", - compressible: true, - extensions: ["xcs"] - }, - "application/call-completion": { - source: "iana" - }, - "application/cals-1840": { - source: "iana" - }, - "application/captive+json": { - source: "iana", - compressible: true - }, - "application/cbor": { - source: "iana" - }, - "application/cbor-seq": { - source: "iana" - }, - "application/cccex": { - source: "iana" - }, - "application/ccmp+xml": { - source: "iana", - compressible: true - }, - "application/ccxml+xml": { - source: "iana", - compressible: true, - extensions: ["ccxml"] - }, - "application/cdfx+xml": { - source: "iana", - compressible: true, - extensions: ["cdfx"] - }, - "application/cdmi-capability": { - source: "iana", - extensions: ["cdmia"] - }, - "application/cdmi-container": { - source: "iana", - extensions: ["cdmic"] - }, - "application/cdmi-domain": { - source: "iana", - extensions: ["cdmid"] - }, - "application/cdmi-object": { - source: "iana", - extensions: ["cdmio"] - }, - "application/cdmi-queue": { - source: "iana", - extensions: ["cdmiq"] - }, - "application/cdni": { - source: "iana" - }, - "application/cea": { - source: "iana" - }, - "application/cea-2018+xml": { - source: "iana", - compressible: true - }, - "application/cellml+xml": { - source: "iana", - compressible: true - }, - "application/cfw": { - source: "iana" - }, - "application/city+json": { - source: "iana", - compressible: true - }, - "application/clr": { - source: "iana" - }, - "application/clue+xml": { - source: "iana", - compressible: true - }, - "application/clue_info+xml": { - source: "iana", - compressible: true - }, - "application/cms": { - source: "iana" - }, - "application/cnrp+xml": { - source: "iana", - compressible: true - }, - "application/coap-group+json": { - source: "iana", - compressible: true - }, - "application/coap-payload": { - source: "iana" - }, - "application/commonground": { - source: "iana" - }, - "application/conference-info+xml": { - source: "iana", - compressible: true - }, - "application/cose": { - source: "iana" - }, - "application/cose-key": { - source: "iana" - }, - "application/cose-key-set": { - source: "iana" - }, - "application/cpl+xml": { - source: "iana", - compressible: true, - extensions: ["cpl"] - }, - "application/csrattrs": { - source: "iana" - }, - "application/csta+xml": { - source: "iana", - compressible: true - }, - "application/cstadata+xml": { - source: "iana", - compressible: true - }, - "application/csvm+json": { - source: "iana", - compressible: true - }, - "application/cu-seeme": { - source: "apache", - extensions: ["cu"] - }, - "application/cwt": { - source: "iana" - }, - "application/cybercash": { - source: "iana" - }, - "application/dart": { - compressible: true - }, - "application/dash+xml": { - source: "iana", - compressible: true, - extensions: ["mpd"] - }, - "application/dash-patch+xml": { - source: "iana", - compressible: true, - extensions: ["mpp"] - }, - "application/dashdelta": { - source: "iana" - }, - "application/davmount+xml": { - source: "iana", - compressible: true, - extensions: ["davmount"] - }, - "application/dca-rft": { - source: "iana" - }, - "application/dcd": { - source: "iana" - }, - "application/dec-dx": { - source: "iana" - }, - "application/dialog-info+xml": { - source: "iana", - compressible: true - }, - "application/dicom": { - source: "iana" - }, - "application/dicom+json": { - source: "iana", - compressible: true - }, - "application/dicom+xml": { - source: "iana", - compressible: true - }, - "application/dii": { - source: "iana" - }, - "application/dit": { - source: "iana" - }, - "application/dns": { - source: "iana" - }, - "application/dns+json": { - source: "iana", - compressible: true - }, - "application/dns-message": { - source: "iana" - }, - "application/docbook+xml": { - source: "apache", - compressible: true, - extensions: ["dbk"] - }, - "application/dots+cbor": { - source: "iana" - }, - "application/dskpp+xml": { - source: "iana", - compressible: true - }, - "application/dssc+der": { - source: "iana", - extensions: ["dssc"] - }, - "application/dssc+xml": { - source: "iana", - compressible: true, - extensions: ["xdssc"] - }, - "application/dvcs": { - source: "iana" - }, - "application/ecmascript": { - source: "iana", - compressible: true, - extensions: ["es", "ecma"] - }, - "application/edi-consent": { - source: "iana" - }, - "application/edi-x12": { - source: "iana", - compressible: false - }, - "application/edifact": { - source: "iana", - compressible: false - }, - "application/efi": { - source: "iana" - }, - "application/elm+json": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/elm+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.cap+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/emergencycalldata.comment+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.control+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.deviceinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.ecall.msd": { - source: "iana" - }, - "application/emergencycalldata.providerinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.serviceinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.subscriberinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.veds+xml": { - source: "iana", - compressible: true - }, - "application/emma+xml": { - source: "iana", - compressible: true, - extensions: ["emma"] - }, - "application/emotionml+xml": { - source: "iana", - compressible: true, - extensions: ["emotionml"] - }, - "application/encaprtp": { - source: "iana" - }, - "application/epp+xml": { - source: "iana", - compressible: true - }, - "application/epub+zip": { - source: "iana", - compressible: false, - extensions: ["epub"] - }, - "application/eshop": { - source: "iana" - }, - "application/exi": { - source: "iana", - extensions: ["exi"] - }, - "application/expect-ct-report+json": { - source: "iana", - compressible: true - }, - "application/express": { - source: "iana", - extensions: ["exp"] - }, - "application/fastinfoset": { - source: "iana" - }, - "application/fastsoap": { - source: "iana" - }, - "application/fdt+xml": { - source: "iana", - compressible: true, - extensions: ["fdt"] - }, - "application/fhir+json": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/fhir+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/fido.trusted-apps+json": { - compressible: true - }, - "application/fits": { - source: "iana" - }, - "application/flexfec": { - source: "iana" - }, - "application/font-sfnt": { - source: "iana" - }, - "application/font-tdpfr": { - source: "iana", - extensions: ["pfr"] - }, - "application/font-woff": { - source: "iana", - compressible: false - }, - "application/framework-attributes+xml": { - source: "iana", - compressible: true - }, - "application/geo+json": { - source: "iana", - compressible: true, - extensions: ["geojson"] - }, - "application/geo+json-seq": { - source: "iana" - }, - "application/geopackage+sqlite3": { - source: "iana" - }, - "application/geoxacml+xml": { - source: "iana", - compressible: true - }, - "application/gltf-buffer": { - source: "iana" - }, - "application/gml+xml": { - source: "iana", - compressible: true, - extensions: ["gml"] - }, - "application/gpx+xml": { - source: "apache", - compressible: true, - extensions: ["gpx"] - }, - "application/gxf": { - source: "apache", - extensions: ["gxf"] - }, - "application/gzip": { - source: "iana", - compressible: false, - extensions: ["gz"] - }, - "application/h224": { - source: "iana" - }, - "application/held+xml": { - source: "iana", - compressible: true - }, - "application/hjson": { - extensions: ["hjson"] - }, - "application/http": { - source: "iana" - }, - "application/hyperstudio": { - source: "iana", - extensions: ["stk"] - }, - "application/ibe-key-request+xml": { - source: "iana", - compressible: true - }, - "application/ibe-pkg-reply+xml": { - source: "iana", - compressible: true - }, - "application/ibe-pp-data": { - source: "iana" - }, - "application/iges": { - source: "iana" - }, - "application/im-iscomposing+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/index": { - source: "iana" - }, - "application/index.cmd": { - source: "iana" - }, - "application/index.obj": { - source: "iana" - }, - "application/index.response": { - source: "iana" - }, - "application/index.vnd": { - source: "iana" - }, - "application/inkml+xml": { - source: "iana", - compressible: true, - extensions: ["ink", "inkml"] - }, - "application/iotp": { - source: "iana" - }, - "application/ipfix": { - source: "iana", - extensions: ["ipfix"] - }, - "application/ipp": { - source: "iana" - }, - "application/isup": { - source: "iana" - }, - "application/its+xml": { - source: "iana", - compressible: true, - extensions: ["its"] - }, - "application/java-archive": { - source: "apache", - compressible: false, - extensions: ["jar", "war", "ear"] - }, - "application/java-serialized-object": { - source: "apache", - compressible: false, - extensions: ["ser"] - }, - "application/java-vm": { - source: "apache", - compressible: false, - extensions: ["class"] - }, - "application/javascript": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["js", "mjs"] - }, - "application/jf2feed+json": { - source: "iana", - compressible: true - }, - "application/jose": { - source: "iana" - }, - "application/jose+json": { - source: "iana", - compressible: true - }, - "application/jrd+json": { - source: "iana", - compressible: true - }, - "application/jscalendar+json": { - source: "iana", - compressible: true - }, - "application/json": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["json", "map"] - }, - "application/json-patch+json": { - source: "iana", - compressible: true - }, - "application/json-seq": { - source: "iana" - }, - "application/json5": { - extensions: ["json5"] - }, - "application/jsonml+json": { - source: "apache", - compressible: true, - extensions: ["jsonml"] - }, - "application/jwk+json": { - source: "iana", - compressible: true - }, - "application/jwk-set+json": { - source: "iana", - compressible: true - }, - "application/jwt": { - source: "iana" - }, - "application/kpml-request+xml": { - source: "iana", - compressible: true - }, - "application/kpml-response+xml": { - source: "iana", - compressible: true - }, - "application/ld+json": { - source: "iana", - compressible: true, - extensions: ["jsonld"] - }, - "application/lgr+xml": { - source: "iana", - compressible: true, - extensions: ["lgr"] - }, - "application/link-format": { - source: "iana" - }, - "application/load-control+xml": { - source: "iana", - compressible: true - }, - "application/lost+xml": { - source: "iana", - compressible: true, - extensions: ["lostxml"] - }, - "application/lostsync+xml": { - source: "iana", - compressible: true - }, - "application/lpf+zip": { - source: "iana", - compressible: false - }, - "application/lxf": { - source: "iana" - }, - "application/mac-binhex40": { - source: "iana", - extensions: ["hqx"] - }, - "application/mac-compactpro": { - source: "apache", - extensions: ["cpt"] - }, - "application/macwriteii": { - source: "iana" - }, - "application/mads+xml": { - source: "iana", - compressible: true, - extensions: ["mads"] - }, - "application/manifest+json": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["webmanifest"] - }, - "application/marc": { - source: "iana", - extensions: ["mrc"] - }, - "application/marcxml+xml": { - source: "iana", - compressible: true, - extensions: ["mrcx"] - }, - "application/mathematica": { - source: "iana", - extensions: ["ma", "nb", "mb"] - }, - "application/mathml+xml": { - source: "iana", - compressible: true, - extensions: ["mathml"] - }, - "application/mathml-content+xml": { - source: "iana", - compressible: true - }, - "application/mathml-presentation+xml": { - source: "iana", - compressible: true - }, - "application/mbms-associated-procedure-description+xml": { - source: "iana", - compressible: true - }, - "application/mbms-deregister+xml": { - source: "iana", - compressible: true - }, - "application/mbms-envelope+xml": { - source: "iana", - compressible: true - }, - "application/mbms-msk+xml": { - source: "iana", - compressible: true - }, - "application/mbms-msk-response+xml": { - source: "iana", - compressible: true - }, - "application/mbms-protection-description+xml": { - source: "iana", - compressible: true - }, - "application/mbms-reception-report+xml": { - source: "iana", - compressible: true - }, - "application/mbms-register+xml": { - source: "iana", - compressible: true - }, - "application/mbms-register-response+xml": { - source: "iana", - compressible: true - }, - "application/mbms-schedule+xml": { - source: "iana", - compressible: true - }, - "application/mbms-user-service-description+xml": { - source: "iana", - compressible: true - }, - "application/mbox": { - source: "iana", - extensions: ["mbox"] - }, - "application/media-policy-dataset+xml": { - source: "iana", - compressible: true, - extensions: ["mpf"] - }, - "application/media_control+xml": { - source: "iana", - compressible: true - }, - "application/mediaservercontrol+xml": { - source: "iana", - compressible: true, - extensions: ["mscml"] - }, - "application/merge-patch+json": { - source: "iana", - compressible: true - }, - "application/metalink+xml": { - source: "apache", - compressible: true, - extensions: ["metalink"] - }, - "application/metalink4+xml": { - source: "iana", - compressible: true, - extensions: ["meta4"] - }, - "application/mets+xml": { - source: "iana", - compressible: true, - extensions: ["mets"] - }, - "application/mf4": { - source: "iana" - }, - "application/mikey": { - source: "iana" - }, - "application/mipc": { - source: "iana" - }, - "application/missing-blocks+cbor-seq": { - source: "iana" - }, - "application/mmt-aei+xml": { - source: "iana", - compressible: true, - extensions: ["maei"] - }, - "application/mmt-usd+xml": { - source: "iana", - compressible: true, - extensions: ["musd"] - }, - "application/mods+xml": { - source: "iana", - compressible: true, - extensions: ["mods"] - }, - "application/moss-keys": { - source: "iana" - }, - "application/moss-signature": { - source: "iana" - }, - "application/mosskey-data": { - source: "iana" - }, - "application/mosskey-request": { - source: "iana" - }, - "application/mp21": { - source: "iana", - extensions: ["m21", "mp21"] - }, - "application/mp4": { - source: "iana", - extensions: ["mp4s", "m4p"] - }, - "application/mpeg4-generic": { - source: "iana" - }, - "application/mpeg4-iod": { - source: "iana" - }, - "application/mpeg4-iod-xmt": { - source: "iana" - }, - "application/mrb-consumer+xml": { - source: "iana", - compressible: true - }, - "application/mrb-publish+xml": { - source: "iana", - compressible: true - }, - "application/msc-ivr+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/msc-mixer+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/msword": { - source: "iana", - compressible: false, - extensions: ["doc", "dot"] - }, - "application/mud+json": { - source: "iana", - compressible: true - }, - "application/multipart-core": { - source: "iana" - }, - "application/mxf": { - source: "iana", - extensions: ["mxf"] - }, - "application/n-quads": { - source: "iana", - extensions: ["nq"] - }, - "application/n-triples": { - source: "iana", - extensions: ["nt"] - }, - "application/nasdata": { - source: "iana" - }, - "application/news-checkgroups": { - source: "iana", - charset: "US-ASCII" - }, - "application/news-groupinfo": { - source: "iana", - charset: "US-ASCII" - }, - "application/news-transmission": { - source: "iana" - }, - "application/nlsml+xml": { - source: "iana", - compressible: true - }, - "application/node": { - source: "iana", - extensions: ["cjs"] - }, - "application/nss": { - source: "iana" - }, - "application/oauth-authz-req+jwt": { - source: "iana" - }, - "application/oblivious-dns-message": { - source: "iana" - }, - "application/ocsp-request": { - source: "iana" - }, - "application/ocsp-response": { - source: "iana" - }, - "application/octet-stream": { - source: "iana", - compressible: false, - extensions: ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"] - }, - "application/oda": { - source: "iana", - extensions: ["oda"] - }, - "application/odm+xml": { - source: "iana", - compressible: true - }, - "application/odx": { - source: "iana" - }, - "application/oebps-package+xml": { - source: "iana", - compressible: true, - extensions: ["opf"] - }, - "application/ogg": { - source: "iana", - compressible: false, - extensions: ["ogx"] - }, - "application/omdoc+xml": { - source: "apache", - compressible: true, - extensions: ["omdoc"] - }, - "application/onenote": { - source: "apache", - extensions: ["onetoc", "onetoc2", "onetmp", "onepkg"] - }, - "application/opc-nodeset+xml": { - source: "iana", - compressible: true - }, - "application/oscore": { - source: "iana" - }, - "application/oxps": { - source: "iana", - extensions: ["oxps"] - }, - "application/p21": { - source: "iana" - }, - "application/p21+zip": { - source: "iana", - compressible: false - }, - "application/p2p-overlay+xml": { - source: "iana", - compressible: true, - extensions: ["relo"] - }, - "application/parityfec": { - source: "iana" - }, - "application/passport": { - source: "iana" - }, - "application/patch-ops-error+xml": { - source: "iana", - compressible: true, - extensions: ["xer"] - }, - "application/pdf": { - source: "iana", - compressible: false, - extensions: ["pdf"] - }, - "application/pdx": { - source: "iana" - }, - "application/pem-certificate-chain": { - source: "iana" - }, - "application/pgp-encrypted": { - source: "iana", - compressible: false, - extensions: ["pgp"] - }, - "application/pgp-keys": { - source: "iana", - extensions: ["asc"] - }, - "application/pgp-signature": { - source: "iana", - extensions: ["asc", "sig"] - }, - "application/pics-rules": { - source: "apache", - extensions: ["prf"] - }, - "application/pidf+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/pidf-diff+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/pkcs10": { - source: "iana", - extensions: ["p10"] - }, - "application/pkcs12": { - source: "iana" - }, - "application/pkcs7-mime": { - source: "iana", - extensions: ["p7m", "p7c"] - }, - "application/pkcs7-signature": { - source: "iana", - extensions: ["p7s"] - }, - "application/pkcs8": { - source: "iana", - extensions: ["p8"] - }, - "application/pkcs8-encrypted": { - source: "iana" - }, - "application/pkix-attr-cert": { - source: "iana", - extensions: ["ac"] - }, - "application/pkix-cert": { - source: "iana", - extensions: ["cer"] - }, - "application/pkix-crl": { - source: "iana", - extensions: ["crl"] - }, - "application/pkix-pkipath": { - source: "iana", - extensions: ["pkipath"] - }, - "application/pkixcmp": { - source: "iana", - extensions: ["pki"] - }, - "application/pls+xml": { - source: "iana", - compressible: true, - extensions: ["pls"] - }, - "application/poc-settings+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/postscript": { - source: "iana", - compressible: true, - extensions: ["ai", "eps", "ps"] - }, - "application/ppsp-tracker+json": { - source: "iana", - compressible: true - }, - "application/problem+json": { - source: "iana", - compressible: true - }, - "application/problem+xml": { - source: "iana", - compressible: true - }, - "application/provenance+xml": { - source: "iana", - compressible: true, - extensions: ["provx"] - }, - "application/prs.alvestrand.titrax-sheet": { - source: "iana" - }, - "application/prs.cww": { - source: "iana", - extensions: ["cww"] - }, - "application/prs.cyn": { - source: "iana", - charset: "7-BIT" - }, - "application/prs.hpub+zip": { - source: "iana", - compressible: false - }, - "application/prs.nprend": { - source: "iana" - }, - "application/prs.plucker": { - source: "iana" - }, - "application/prs.rdf-xml-crypt": { - source: "iana" - }, - "application/prs.xsf+xml": { - source: "iana", - compressible: true - }, - "application/pskc+xml": { - source: "iana", - compressible: true, - extensions: ["pskcxml"] - }, - "application/pvd+json": { - source: "iana", - compressible: true - }, - "application/qsig": { - source: "iana" - }, - "application/raml+yaml": { - compressible: true, - extensions: ["raml"] - }, - "application/raptorfec": { - source: "iana" - }, - "application/rdap+json": { - source: "iana", - compressible: true - }, - "application/rdf+xml": { - source: "iana", - compressible: true, - extensions: ["rdf", "owl"] - }, - "application/reginfo+xml": { - source: "iana", - compressible: true, - extensions: ["rif"] - }, - "application/relax-ng-compact-syntax": { - source: "iana", - extensions: ["rnc"] - }, - "application/remote-printing": { - source: "iana" - }, - "application/reputon+json": { - source: "iana", - compressible: true - }, - "application/resource-lists+xml": { - source: "iana", - compressible: true, - extensions: ["rl"] - }, - "application/resource-lists-diff+xml": { - source: "iana", - compressible: true, - extensions: ["rld"] - }, - "application/rfc+xml": { - source: "iana", - compressible: true - }, - "application/riscos": { - source: "iana" - }, - "application/rlmi+xml": { - source: "iana", - compressible: true - }, - "application/rls-services+xml": { - source: "iana", - compressible: true, - extensions: ["rs"] - }, - "application/route-apd+xml": { - source: "iana", - compressible: true, - extensions: ["rapd"] - }, - "application/route-s-tsid+xml": { - source: "iana", - compressible: true, - extensions: ["sls"] - }, - "application/route-usd+xml": { - source: "iana", - compressible: true, - extensions: ["rusd"] - }, - "application/rpki-ghostbusters": { - source: "iana", - extensions: ["gbr"] - }, - "application/rpki-manifest": { - source: "iana", - extensions: ["mft"] - }, - "application/rpki-publication": { - source: "iana" - }, - "application/rpki-roa": { - source: "iana", - extensions: ["roa"] - }, - "application/rpki-updown": { - source: "iana" - }, - "application/rsd+xml": { - source: "apache", - compressible: true, - extensions: ["rsd"] - }, - "application/rss+xml": { - source: "apache", - compressible: true, - extensions: ["rss"] - }, - "application/rtf": { - source: "iana", - compressible: true, - extensions: ["rtf"] - }, - "application/rtploopback": { - source: "iana" - }, - "application/rtx": { - source: "iana" - }, - "application/samlassertion+xml": { - source: "iana", - compressible: true - }, - "application/samlmetadata+xml": { - source: "iana", - compressible: true - }, - "application/sarif+json": { - source: "iana", - compressible: true - }, - "application/sarif-external-properties+json": { - source: "iana", - compressible: true - }, - "application/sbe": { - source: "iana" - }, - "application/sbml+xml": { - source: "iana", - compressible: true, - extensions: ["sbml"] - }, - "application/scaip+xml": { - source: "iana", - compressible: true - }, - "application/scim+json": { - source: "iana", - compressible: true - }, - "application/scvp-cv-request": { - source: "iana", - extensions: ["scq"] - }, - "application/scvp-cv-response": { - source: "iana", - extensions: ["scs"] - }, - "application/scvp-vp-request": { - source: "iana", - extensions: ["spq"] - }, - "application/scvp-vp-response": { - source: "iana", - extensions: ["spp"] - }, - "application/sdp": { - source: "iana", - extensions: ["sdp"] - }, - "application/secevent+jwt": { - source: "iana" - }, - "application/senml+cbor": { - source: "iana" - }, - "application/senml+json": { - source: "iana", - compressible: true - }, - "application/senml+xml": { - source: "iana", - compressible: true, - extensions: ["senmlx"] - }, - "application/senml-etch+cbor": { - source: "iana" - }, - "application/senml-etch+json": { - source: "iana", - compressible: true - }, - "application/senml-exi": { - source: "iana" - }, - "application/sensml+cbor": { - source: "iana" - }, - "application/sensml+json": { - source: "iana", - compressible: true - }, - "application/sensml+xml": { - source: "iana", - compressible: true, - extensions: ["sensmlx"] - }, - "application/sensml-exi": { - source: "iana" - }, - "application/sep+xml": { - source: "iana", - compressible: true - }, - "application/sep-exi": { - source: "iana" - }, - "application/session-info": { - source: "iana" - }, - "application/set-payment": { - source: "iana" - }, - "application/set-payment-initiation": { - source: "iana", - extensions: ["setpay"] - }, - "application/set-registration": { - source: "iana" - }, - "application/set-registration-initiation": { - source: "iana", - extensions: ["setreg"] - }, - "application/sgml": { - source: "iana" - }, - "application/sgml-open-catalog": { - source: "iana" - }, - "application/shf+xml": { - source: "iana", - compressible: true, - extensions: ["shf"] - }, - "application/sieve": { - source: "iana", - extensions: ["siv", "sieve"] - }, - "application/simple-filter+xml": { - source: "iana", - compressible: true - }, - "application/simple-message-summary": { - source: "iana" - }, - "application/simplesymbolcontainer": { - source: "iana" - }, - "application/sipc": { - source: "iana" - }, - "application/slate": { - source: "iana" - }, - "application/smil": { - source: "iana" - }, - "application/smil+xml": { - source: "iana", - compressible: true, - extensions: ["smi", "smil"] - }, - "application/smpte336m": { - source: "iana" - }, - "application/soap+fastinfoset": { - source: "iana" - }, - "application/soap+xml": { - source: "iana", - compressible: true - }, - "application/sparql-query": { - source: "iana", - extensions: ["rq"] - }, - "application/sparql-results+xml": { - source: "iana", - compressible: true, - extensions: ["srx"] - }, - "application/spdx+json": { - source: "iana", - compressible: true - }, - "application/spirits-event+xml": { - source: "iana", - compressible: true - }, - "application/sql": { - source: "iana" - }, - "application/srgs": { - source: "iana", - extensions: ["gram"] - }, - "application/srgs+xml": { - source: "iana", - compressible: true, - extensions: ["grxml"] - }, - "application/sru+xml": { - source: "iana", - compressible: true, - extensions: ["sru"] - }, - "application/ssdl+xml": { - source: "apache", - compressible: true, - extensions: ["ssdl"] - }, - "application/ssml+xml": { - source: "iana", - compressible: true, - extensions: ["ssml"] - }, - "application/stix+json": { - source: "iana", - compressible: true - }, - "application/swid+xml": { - source: "iana", - compressible: true, - extensions: ["swidtag"] - }, - "application/tamp-apex-update": { - source: "iana" - }, - "application/tamp-apex-update-confirm": { - source: "iana" - }, - "application/tamp-community-update": { - source: "iana" - }, - "application/tamp-community-update-confirm": { - source: "iana" - }, - "application/tamp-error": { - source: "iana" - }, - "application/tamp-sequence-adjust": { - source: "iana" - }, - "application/tamp-sequence-adjust-confirm": { - source: "iana" - }, - "application/tamp-status-query": { - source: "iana" - }, - "application/tamp-status-response": { - source: "iana" - }, - "application/tamp-update": { - source: "iana" - }, - "application/tamp-update-confirm": { - source: "iana" - }, - "application/tar": { - compressible: true - }, - "application/taxii+json": { - source: "iana", - compressible: true - }, - "application/td+json": { - source: "iana", - compressible: true - }, - "application/tei+xml": { - source: "iana", - compressible: true, - extensions: ["tei", "teicorpus"] - }, - "application/tetra_isi": { - source: "iana" - }, - "application/thraud+xml": { - source: "iana", - compressible: true, - extensions: ["tfi"] - }, - "application/timestamp-query": { - source: "iana" - }, - "application/timestamp-reply": { - source: "iana" - }, - "application/timestamped-data": { - source: "iana", - extensions: ["tsd"] - }, - "application/tlsrpt+gzip": { - source: "iana" - }, - "application/tlsrpt+json": { - source: "iana", - compressible: true - }, - "application/tnauthlist": { - source: "iana" - }, - "application/token-introspection+jwt": { - source: "iana" - }, - "application/toml": { - compressible: true, - extensions: ["toml"] - }, - "application/trickle-ice-sdpfrag": { - source: "iana" - }, - "application/trig": { - source: "iana", - extensions: ["trig"] - }, - "application/ttml+xml": { - source: "iana", - compressible: true, - extensions: ["ttml"] - }, - "application/tve-trigger": { - source: "iana" - }, - "application/tzif": { - source: "iana" - }, - "application/tzif-leap": { - source: "iana" - }, - "application/ubjson": { - compressible: false, - extensions: ["ubj"] - }, - "application/ulpfec": { - source: "iana" - }, - "application/urc-grpsheet+xml": { - source: "iana", - compressible: true - }, - "application/urc-ressheet+xml": { - source: "iana", - compressible: true, - extensions: ["rsheet"] - }, - "application/urc-targetdesc+xml": { - source: "iana", - compressible: true, - extensions: ["td"] - }, - "application/urc-uisocketdesc+xml": { - source: "iana", - compressible: true - }, - "application/vcard+json": { - source: "iana", - compressible: true - }, - "application/vcard+xml": { - source: "iana", - compressible: true - }, - "application/vemmi": { - source: "iana" - }, - "application/vividence.scriptfile": { - source: "apache" - }, - "application/vnd.1000minds.decision-model+xml": { - source: "iana", - compressible: true, - extensions: ["1km"] - }, - "application/vnd.3gpp-prose+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp-prose-pc3ch+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp-v2x-local-service-information": { - source: "iana" - }, - "application/vnd.3gpp.5gnas": { - source: "iana" - }, - "application/vnd.3gpp.access-transfer-events+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.bsf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.gmop+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.gtpc": { - source: "iana" - }, - "application/vnd.3gpp.interworking-data": { - source: "iana" - }, - "application/vnd.3gpp.lpp": { - source: "iana" - }, - "application/vnd.3gpp.mc-signalling-ear": { - source: "iana" - }, - "application/vnd.3gpp.mcdata-affiliation-command+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-payload": { - source: "iana" - }, - "application/vnd.3gpp.mcdata-service-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-signalling": { - source: "iana" - }, - "application/vnd.3gpp.mcdata-ue-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-user-profile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-affiliation-command+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-floor-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-location-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-service-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-signed+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-ue-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-ue-init-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-user-profile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-affiliation-command+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-affiliation-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-location-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-service-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-transmission-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-ue-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-user-profile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mid-call+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.ngap": { - source: "iana" - }, - "application/vnd.3gpp.pfcp": { - source: "iana" - }, - "application/vnd.3gpp.pic-bw-large": { - source: "iana", - extensions: ["plb"] - }, - "application/vnd.3gpp.pic-bw-small": { - source: "iana", - extensions: ["psb"] - }, - "application/vnd.3gpp.pic-bw-var": { - source: "iana", - extensions: ["pvb"] - }, - "application/vnd.3gpp.s1ap": { - source: "iana" - }, - "application/vnd.3gpp.sms": { - source: "iana" - }, - "application/vnd.3gpp.sms+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.srvcc-ext+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.srvcc-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.state-and-event-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.ussd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp2.bcmcsinfo+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp2.sms": { - source: "iana" - }, - "application/vnd.3gpp2.tcap": { - source: "iana", - extensions: ["tcap"] - }, - "application/vnd.3lightssoftware.imagescal": { - source: "iana" - }, - "application/vnd.3m.post-it-notes": { - source: "iana", - extensions: ["pwn"] - }, - "application/vnd.accpac.simply.aso": { - source: "iana", - extensions: ["aso"] - }, - "application/vnd.accpac.simply.imp": { - source: "iana", - extensions: ["imp"] - }, - "application/vnd.acucobol": { - source: "iana", - extensions: ["acu"] - }, - "application/vnd.acucorp": { - source: "iana", - extensions: ["atc", "acutc"] - }, - "application/vnd.adobe.air-application-installer-package+zip": { - source: "apache", - compressible: false, - extensions: ["air"] - }, - "application/vnd.adobe.flash.movie": { - source: "iana" - }, - "application/vnd.adobe.formscentral.fcdt": { - source: "iana", - extensions: ["fcdt"] - }, - "application/vnd.adobe.fxp": { - source: "iana", - extensions: ["fxp", "fxpl"] - }, - "application/vnd.adobe.partial-upload": { - source: "iana" - }, - "application/vnd.adobe.xdp+xml": { - source: "iana", - compressible: true, - extensions: ["xdp"] - }, - "application/vnd.adobe.xfdf": { - source: "iana", - extensions: ["xfdf"] - }, - "application/vnd.aether.imp": { - source: "iana" - }, - "application/vnd.afpc.afplinedata": { - source: "iana" - }, - "application/vnd.afpc.afplinedata-pagedef": { - source: "iana" - }, - "application/vnd.afpc.cmoca-cmresource": { - source: "iana" - }, - "application/vnd.afpc.foca-charset": { - source: "iana" - }, - "application/vnd.afpc.foca-codedfont": { - source: "iana" - }, - "application/vnd.afpc.foca-codepage": { - source: "iana" - }, - "application/vnd.afpc.modca": { - source: "iana" - }, - "application/vnd.afpc.modca-cmtable": { - source: "iana" - }, - "application/vnd.afpc.modca-formdef": { - source: "iana" - }, - "application/vnd.afpc.modca-mediummap": { - source: "iana" - }, - "application/vnd.afpc.modca-objectcontainer": { - source: "iana" - }, - "application/vnd.afpc.modca-overlay": { - source: "iana" - }, - "application/vnd.afpc.modca-pagesegment": { - source: "iana" - }, - "application/vnd.age": { - source: "iana", - extensions: ["age"] - }, - "application/vnd.ah-barcode": { - source: "iana" - }, - "application/vnd.ahead.space": { - source: "iana", - extensions: ["ahead"] - }, - "application/vnd.airzip.filesecure.azf": { - source: "iana", - extensions: ["azf"] - }, - "application/vnd.airzip.filesecure.azs": { - source: "iana", - extensions: ["azs"] - }, - "application/vnd.amadeus+json": { - source: "iana", - compressible: true - }, - "application/vnd.amazon.ebook": { - source: "apache", - extensions: ["azw"] - }, - "application/vnd.amazon.mobi8-ebook": { - source: "iana" - }, - "application/vnd.americandynamics.acc": { - source: "iana", - extensions: ["acc"] - }, - "application/vnd.amiga.ami": { - source: "iana", - extensions: ["ami"] - }, - "application/vnd.amundsen.maze+xml": { - source: "iana", - compressible: true - }, - "application/vnd.android.ota": { - source: "iana" - }, - "application/vnd.android.package-archive": { - source: "apache", - compressible: false, - extensions: ["apk"] - }, - "application/vnd.anki": { - source: "iana" - }, - "application/vnd.anser-web-certificate-issue-initiation": { - source: "iana", - extensions: ["cii"] - }, - "application/vnd.anser-web-funds-transfer-initiation": { - source: "apache", - extensions: ["fti"] - }, - "application/vnd.antix.game-component": { - source: "iana", - extensions: ["atx"] - }, - "application/vnd.apache.arrow.file": { - source: "iana" - }, - "application/vnd.apache.arrow.stream": { - source: "iana" - }, - "application/vnd.apache.thrift.binary": { - source: "iana" - }, - "application/vnd.apache.thrift.compact": { - source: "iana" - }, - "application/vnd.apache.thrift.json": { - source: "iana" - }, - "application/vnd.api+json": { - source: "iana", - compressible: true - }, - "application/vnd.aplextor.warrp+json": { - source: "iana", - compressible: true - }, - "application/vnd.apothekende.reservation+json": { - source: "iana", - compressible: true - }, - "application/vnd.apple.installer+xml": { - source: "iana", - compressible: true, - extensions: ["mpkg"] - }, - "application/vnd.apple.keynote": { - source: "iana", - extensions: ["key"] - }, - "application/vnd.apple.mpegurl": { - source: "iana", - extensions: ["m3u8"] - }, - "application/vnd.apple.numbers": { - source: "iana", - extensions: ["numbers"] - }, - "application/vnd.apple.pages": { - source: "iana", - extensions: ["pages"] - }, - "application/vnd.apple.pkpass": { - compressible: false, - extensions: ["pkpass"] - }, - "application/vnd.arastra.swi": { - source: "iana" - }, - "application/vnd.aristanetworks.swi": { - source: "iana", - extensions: ["swi"] - }, - "application/vnd.artisan+json": { - source: "iana", - compressible: true - }, - "application/vnd.artsquare": { - source: "iana" - }, - "application/vnd.astraea-software.iota": { - source: "iana", - extensions: ["iota"] - }, - "application/vnd.audiograph": { - source: "iana", - extensions: ["aep"] - }, - "application/vnd.autopackage": { - source: "iana" - }, - "application/vnd.avalon+json": { - source: "iana", - compressible: true - }, - "application/vnd.avistar+xml": { - source: "iana", - compressible: true - }, - "application/vnd.balsamiq.bmml+xml": { - source: "iana", - compressible: true, - extensions: ["bmml"] - }, - "application/vnd.balsamiq.bmpr": { - source: "iana" - }, - "application/vnd.banana-accounting": { - source: "iana" - }, - "application/vnd.bbf.usp.error": { - source: "iana" - }, - "application/vnd.bbf.usp.msg": { - source: "iana" - }, - "application/vnd.bbf.usp.msg+json": { - source: "iana", - compressible: true - }, - "application/vnd.bekitzur-stech+json": { - source: "iana", - compressible: true - }, - "application/vnd.bint.med-content": { - source: "iana" - }, - "application/vnd.biopax.rdf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.blink-idb-value-wrapper": { - source: "iana" - }, - "application/vnd.blueice.multipass": { - source: "iana", - extensions: ["mpm"] - }, - "application/vnd.bluetooth.ep.oob": { - source: "iana" - }, - "application/vnd.bluetooth.le.oob": { - source: "iana" - }, - "application/vnd.bmi": { - source: "iana", - extensions: ["bmi"] - }, - "application/vnd.bpf": { - source: "iana" - }, - "application/vnd.bpf3": { - source: "iana" - }, - "application/vnd.businessobjects": { - source: "iana", - extensions: ["rep"] - }, - "application/vnd.byu.uapi+json": { - source: "iana", - compressible: true - }, - "application/vnd.cab-jscript": { - source: "iana" - }, - "application/vnd.canon-cpdl": { - source: "iana" - }, - "application/vnd.canon-lips": { - source: "iana" - }, - "application/vnd.capasystems-pg+json": { - source: "iana", - compressible: true - }, - "application/vnd.cendio.thinlinc.clientconf": { - source: "iana" - }, - "application/vnd.century-systems.tcp_stream": { - source: "iana" - }, - "application/vnd.chemdraw+xml": { - source: "iana", - compressible: true, - extensions: ["cdxml"] - }, - "application/vnd.chess-pgn": { - source: "iana" - }, - "application/vnd.chipnuts.karaoke-mmd": { - source: "iana", - extensions: ["mmd"] - }, - "application/vnd.ciedi": { - source: "iana" - }, - "application/vnd.cinderella": { - source: "iana", - extensions: ["cdy"] - }, - "application/vnd.cirpack.isdn-ext": { - source: "iana" - }, - "application/vnd.citationstyles.style+xml": { - source: "iana", - compressible: true, - extensions: ["csl"] - }, - "application/vnd.claymore": { - source: "iana", - extensions: ["cla"] - }, - "application/vnd.cloanto.rp9": { - source: "iana", - extensions: ["rp9"] - }, - "application/vnd.clonk.c4group": { - source: "iana", - extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"] - }, - "application/vnd.cluetrust.cartomobile-config": { - source: "iana", - extensions: ["c11amc"] - }, - "application/vnd.cluetrust.cartomobile-config-pkg": { - source: "iana", - extensions: ["c11amz"] - }, - "application/vnd.coffeescript": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.document": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.document-template": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.presentation": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.presentation-template": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet-template": { - source: "iana" - }, - "application/vnd.collection+json": { - source: "iana", - compressible: true - }, - "application/vnd.collection.doc+json": { - source: "iana", - compressible: true - }, - "application/vnd.collection.next+json": { - source: "iana", - compressible: true - }, - "application/vnd.comicbook+zip": { - source: "iana", - compressible: false - }, - "application/vnd.comicbook-rar": { - source: "iana" - }, - "application/vnd.commerce-battelle": { - source: "iana" - }, - "application/vnd.commonspace": { - source: "iana", - extensions: ["csp"] - }, - "application/vnd.contact.cmsg": { - source: "iana", - extensions: ["cdbcmsg"] - }, - "application/vnd.coreos.ignition+json": { - source: "iana", - compressible: true - }, - "application/vnd.cosmocaller": { - source: "iana", - extensions: ["cmc"] - }, - "application/vnd.crick.clicker": { - source: "iana", - extensions: ["clkx"] - }, - "application/vnd.crick.clicker.keyboard": { - source: "iana", - extensions: ["clkk"] - }, - "application/vnd.crick.clicker.palette": { - source: "iana", - extensions: ["clkp"] - }, - "application/vnd.crick.clicker.template": { - source: "iana", - extensions: ["clkt"] - }, - "application/vnd.crick.clicker.wordbank": { - source: "iana", - extensions: ["clkw"] - }, - "application/vnd.criticaltools.wbs+xml": { - source: "iana", - compressible: true, - extensions: ["wbs"] - }, - "application/vnd.cryptii.pipe+json": { - source: "iana", - compressible: true - }, - "application/vnd.crypto-shade-file": { - source: "iana" - }, - "application/vnd.cryptomator.encrypted": { - source: "iana" - }, - "application/vnd.cryptomator.vault": { - source: "iana" - }, - "application/vnd.ctc-posml": { - source: "iana", - extensions: ["pml"] - }, - "application/vnd.ctct.ws+xml": { - source: "iana", - compressible: true - }, - "application/vnd.cups-pdf": { - source: "iana" - }, - "application/vnd.cups-postscript": { - source: "iana" - }, - "application/vnd.cups-ppd": { - source: "iana", - extensions: ["ppd"] - }, - "application/vnd.cups-raster": { - source: "iana" - }, - "application/vnd.cups-raw": { - source: "iana" - }, - "application/vnd.curl": { - source: "iana" - }, - "application/vnd.curl.car": { - source: "apache", - extensions: ["car"] - }, - "application/vnd.curl.pcurl": { - source: "apache", - extensions: ["pcurl"] - }, - "application/vnd.cyan.dean.root+xml": { - source: "iana", - compressible: true - }, - "application/vnd.cybank": { - source: "iana" - }, - "application/vnd.cyclonedx+json": { - source: "iana", - compressible: true - }, - "application/vnd.cyclonedx+xml": { - source: "iana", - compressible: true - }, - "application/vnd.d2l.coursepackage1p0+zip": { - source: "iana", - compressible: false - }, - "application/vnd.d3m-dataset": { - source: "iana" - }, - "application/vnd.d3m-problem": { - source: "iana" - }, - "application/vnd.dart": { - source: "iana", - compressible: true, - extensions: ["dart"] - }, - "application/vnd.data-vision.rdz": { - source: "iana", - extensions: ["rdz"] - }, - "application/vnd.datapackage+json": { - source: "iana", - compressible: true - }, - "application/vnd.dataresource+json": { - source: "iana", - compressible: true - }, - "application/vnd.dbf": { - source: "iana", - extensions: ["dbf"] - }, - "application/vnd.debian.binary-package": { - source: "iana" - }, - "application/vnd.dece.data": { - source: "iana", - extensions: ["uvf", "uvvf", "uvd", "uvvd"] - }, - "application/vnd.dece.ttml+xml": { - source: "iana", - compressible: true, - extensions: ["uvt", "uvvt"] - }, - "application/vnd.dece.unspecified": { - source: "iana", - extensions: ["uvx", "uvvx"] - }, - "application/vnd.dece.zip": { - source: "iana", - extensions: ["uvz", "uvvz"] - }, - "application/vnd.denovo.fcselayout-link": { - source: "iana", - extensions: ["fe_launch"] - }, - "application/vnd.desmume.movie": { - source: "iana" - }, - "application/vnd.dir-bi.plate-dl-nosuffix": { - source: "iana" - }, - "application/vnd.dm.delegation+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dna": { - source: "iana", - extensions: ["dna"] - }, - "application/vnd.document+json": { - source: "iana", - compressible: true - }, - "application/vnd.dolby.mlp": { - source: "apache", - extensions: ["mlp"] - }, - "application/vnd.dolby.mobile.1": { - source: "iana" - }, - "application/vnd.dolby.mobile.2": { - source: "iana" - }, - "application/vnd.doremir.scorecloud-binary-document": { - source: "iana" - }, - "application/vnd.dpgraph": { - source: "iana", - extensions: ["dpg"] - }, - "application/vnd.dreamfactory": { - source: "iana", - extensions: ["dfac"] - }, - "application/vnd.drive+json": { - source: "iana", - compressible: true - }, - "application/vnd.ds-keypoint": { - source: "apache", - extensions: ["kpxx"] - }, - "application/vnd.dtg.local": { - source: "iana" - }, - "application/vnd.dtg.local.flash": { - source: "iana" - }, - "application/vnd.dtg.local.html": { - source: "iana" - }, - "application/vnd.dvb.ait": { - source: "iana", - extensions: ["ait"] - }, - "application/vnd.dvb.dvbisl+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.dvbj": { - source: "iana" - }, - "application/vnd.dvb.esgcontainer": { - source: "iana" - }, - "application/vnd.dvb.ipdcdftnotifaccess": { - source: "iana" - }, - "application/vnd.dvb.ipdcesgaccess": { - source: "iana" - }, - "application/vnd.dvb.ipdcesgaccess2": { - source: "iana" - }, - "application/vnd.dvb.ipdcesgpdd": { - source: "iana" - }, - "application/vnd.dvb.ipdcroaming": { - source: "iana" - }, - "application/vnd.dvb.iptv.alfec-base": { - source: "iana" - }, - "application/vnd.dvb.iptv.alfec-enhancement": { - source: "iana" - }, - "application/vnd.dvb.notif-aggregate-root+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-container+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-generic+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-ia-msglist+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-ia-registration-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-ia-registration-response+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-init+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.pfr": { - source: "iana" - }, - "application/vnd.dvb.service": { - source: "iana", - extensions: ["svc"] - }, - "application/vnd.dxr": { - source: "iana" - }, - "application/vnd.dynageo": { - source: "iana", - extensions: ["geo"] - }, - "application/vnd.dzr": { - source: "iana" - }, - "application/vnd.easykaraoke.cdgdownload": { - source: "iana" - }, - "application/vnd.ecdis-update": { - source: "iana" - }, - "application/vnd.ecip.rlp": { - source: "iana" - }, - "application/vnd.eclipse.ditto+json": { - source: "iana", - compressible: true - }, - "application/vnd.ecowin.chart": { - source: "iana", - extensions: ["mag"] - }, - "application/vnd.ecowin.filerequest": { - source: "iana" - }, - "application/vnd.ecowin.fileupdate": { - source: "iana" - }, - "application/vnd.ecowin.series": { - source: "iana" - }, - "application/vnd.ecowin.seriesrequest": { - source: "iana" - }, - "application/vnd.ecowin.seriesupdate": { - source: "iana" - }, - "application/vnd.efi.img": { - source: "iana" - }, - "application/vnd.efi.iso": { - source: "iana" - }, - "application/vnd.emclient.accessrequest+xml": { - source: "iana", - compressible: true - }, - "application/vnd.enliven": { - source: "iana", - extensions: ["nml"] - }, - "application/vnd.enphase.envoy": { - source: "iana" - }, - "application/vnd.eprints.data+xml": { - source: "iana", - compressible: true - }, - "application/vnd.epson.esf": { - source: "iana", - extensions: ["esf"] - }, - "application/vnd.epson.msf": { - source: "iana", - extensions: ["msf"] - }, - "application/vnd.epson.quickanime": { - source: "iana", - extensions: ["qam"] - }, - "application/vnd.epson.salt": { - source: "iana", - extensions: ["slt"] - }, - "application/vnd.epson.ssf": { - source: "iana", - extensions: ["ssf"] - }, - "application/vnd.ericsson.quickcall": { - source: "iana" - }, - "application/vnd.espass-espass+zip": { - source: "iana", - compressible: false - }, - "application/vnd.eszigno3+xml": { - source: "iana", - compressible: true, - extensions: ["es3", "et3"] - }, - "application/vnd.etsi.aoc+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.asic-e+zip": { - source: "iana", - compressible: false - }, - "application/vnd.etsi.asic-s+zip": { - source: "iana", - compressible: false - }, - "application/vnd.etsi.cug+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvcommand+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvdiscovery+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsad-bc+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsad-cod+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsad-npvr+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvservice+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsync+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvueprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.mcid+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.mheg5": { - source: "iana" - }, - "application/vnd.etsi.overload-control-policy-dataset+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.pstn+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.sci+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.simservs+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.timestamp-token": { - source: "iana" - }, - "application/vnd.etsi.tsl+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.tsl.der": { - source: "iana" - }, - "application/vnd.eu.kasparian.car+json": { - source: "iana", - compressible: true - }, - "application/vnd.eudora.data": { - source: "iana" - }, - "application/vnd.evolv.ecig.profile": { - source: "iana" - }, - "application/vnd.evolv.ecig.settings": { - source: "iana" - }, - "application/vnd.evolv.ecig.theme": { - source: "iana" - }, - "application/vnd.exstream-empower+zip": { - source: "iana", - compressible: false - }, - "application/vnd.exstream-package": { - source: "iana" - }, - "application/vnd.ezpix-album": { - source: "iana", - extensions: ["ez2"] - }, - "application/vnd.ezpix-package": { - source: "iana", - extensions: ["ez3"] - }, - "application/vnd.f-secure.mobile": { - source: "iana" - }, - "application/vnd.familysearch.gedcom+zip": { - source: "iana", - compressible: false - }, - "application/vnd.fastcopy-disk-image": { - source: "iana" - }, - "application/vnd.fdf": { - source: "iana", - extensions: ["fdf"] - }, - "application/vnd.fdsn.mseed": { - source: "iana", - extensions: ["mseed"] - }, - "application/vnd.fdsn.seed": { - source: "iana", - extensions: ["seed", "dataless"] - }, - "application/vnd.ffsns": { - source: "iana" - }, - "application/vnd.ficlab.flb+zip": { - source: "iana", - compressible: false - }, - "application/vnd.filmit.zfc": { - source: "iana" - }, - "application/vnd.fints": { - source: "iana" - }, - "application/vnd.firemonkeys.cloudcell": { - source: "iana" - }, - "application/vnd.flographit": { - source: "iana", - extensions: ["gph"] - }, - "application/vnd.fluxtime.clip": { - source: "iana", - extensions: ["ftc"] - }, - "application/vnd.font-fontforge-sfd": { - source: "iana" - }, - "application/vnd.framemaker": { - source: "iana", - extensions: ["fm", "frame", "maker", "book"] - }, - "application/vnd.frogans.fnc": { - source: "iana", - extensions: ["fnc"] - }, - "application/vnd.frogans.ltf": { - source: "iana", - extensions: ["ltf"] - }, - "application/vnd.fsc.weblaunch": { - source: "iana", - extensions: ["fsc"] - }, - "application/vnd.fujifilm.fb.docuworks": { - source: "iana" - }, - "application/vnd.fujifilm.fb.docuworks.binder": { - source: "iana" - }, - "application/vnd.fujifilm.fb.docuworks.container": { - source: "iana" - }, - "application/vnd.fujifilm.fb.jfi+xml": { - source: "iana", - compressible: true - }, - "application/vnd.fujitsu.oasys": { - source: "iana", - extensions: ["oas"] - }, - "application/vnd.fujitsu.oasys2": { - source: "iana", - extensions: ["oa2"] - }, - "application/vnd.fujitsu.oasys3": { - source: "iana", - extensions: ["oa3"] - }, - "application/vnd.fujitsu.oasysgp": { - source: "iana", - extensions: ["fg5"] - }, - "application/vnd.fujitsu.oasysprs": { - source: "iana", - extensions: ["bh2"] - }, - "application/vnd.fujixerox.art-ex": { - source: "iana" - }, - "application/vnd.fujixerox.art4": { - source: "iana" - }, - "application/vnd.fujixerox.ddd": { - source: "iana", - extensions: ["ddd"] - }, - "application/vnd.fujixerox.docuworks": { - source: "iana", - extensions: ["xdw"] - }, - "application/vnd.fujixerox.docuworks.binder": { - source: "iana", - extensions: ["xbd"] - }, - "application/vnd.fujixerox.docuworks.container": { - source: "iana" - }, - "application/vnd.fujixerox.hbpl": { - source: "iana" - }, - "application/vnd.fut-misnet": { - source: "iana" - }, - "application/vnd.futoin+cbor": { - source: "iana" - }, - "application/vnd.futoin+json": { - source: "iana", - compressible: true - }, - "application/vnd.fuzzysheet": { - source: "iana", - extensions: ["fzs"] - }, - "application/vnd.genomatix.tuxedo": { - source: "iana", - extensions: ["txd"] - }, - "application/vnd.gentics.grd+json": { - source: "iana", - compressible: true - }, - "application/vnd.geo+json": { - source: "iana", - compressible: true - }, - "application/vnd.geocube+xml": { - source: "iana", - compressible: true - }, - "application/vnd.geogebra.file": { - source: "iana", - extensions: ["ggb"] - }, - "application/vnd.geogebra.slides": { - source: "iana" - }, - "application/vnd.geogebra.tool": { - source: "iana", - extensions: ["ggt"] - }, - "application/vnd.geometry-explorer": { - source: "iana", - extensions: ["gex", "gre"] - }, - "application/vnd.geonext": { - source: "iana", - extensions: ["gxt"] - }, - "application/vnd.geoplan": { - source: "iana", - extensions: ["g2w"] - }, - "application/vnd.geospace": { - source: "iana", - extensions: ["g3w"] - }, - "application/vnd.gerber": { - source: "iana" - }, - "application/vnd.globalplatform.card-content-mgt": { - source: "iana" - }, - "application/vnd.globalplatform.card-content-mgt-response": { - source: "iana" - }, - "application/vnd.gmx": { - source: "iana", - extensions: ["gmx"] - }, - "application/vnd.google-apps.document": { - compressible: false, - extensions: ["gdoc"] - }, - "application/vnd.google-apps.presentation": { - compressible: false, - extensions: ["gslides"] - }, - "application/vnd.google-apps.spreadsheet": { - compressible: false, - extensions: ["gsheet"] - }, - "application/vnd.google-earth.kml+xml": { - source: "iana", - compressible: true, - extensions: ["kml"] - }, - "application/vnd.google-earth.kmz": { - source: "iana", - compressible: false, - extensions: ["kmz"] - }, - "application/vnd.gov.sk.e-form+xml": { - source: "iana", - compressible: true - }, - "application/vnd.gov.sk.e-form+zip": { - source: "iana", - compressible: false - }, - "application/vnd.gov.sk.xmldatacontainer+xml": { - source: "iana", - compressible: true - }, - "application/vnd.grafeq": { - source: "iana", - extensions: ["gqf", "gqs"] - }, - "application/vnd.gridmp": { - source: "iana" - }, - "application/vnd.groove-account": { - source: "iana", - extensions: ["gac"] - }, - "application/vnd.groove-help": { - source: "iana", - extensions: ["ghf"] - }, - "application/vnd.groove-identity-message": { - source: "iana", - extensions: ["gim"] - }, - "application/vnd.groove-injector": { - source: "iana", - extensions: ["grv"] - }, - "application/vnd.groove-tool-message": { - source: "iana", - extensions: ["gtm"] - }, - "application/vnd.groove-tool-template": { - source: "iana", - extensions: ["tpl"] - }, - "application/vnd.groove-vcard": { - source: "iana", - extensions: ["vcg"] - }, - "application/vnd.hal+json": { - source: "iana", - compressible: true - }, - "application/vnd.hal+xml": { - source: "iana", - compressible: true, - extensions: ["hal"] - }, - "application/vnd.handheld-entertainment+xml": { - source: "iana", - compressible: true, - extensions: ["zmm"] - }, - "application/vnd.hbci": { - source: "iana", - extensions: ["hbci"] - }, - "application/vnd.hc+json": { - source: "iana", - compressible: true - }, - "application/vnd.hcl-bireports": { - source: "iana" - }, - "application/vnd.hdt": { - source: "iana" - }, - "application/vnd.heroku+json": { - source: "iana", - compressible: true - }, - "application/vnd.hhe.lesson-player": { - source: "iana", - extensions: ["les"] - }, - "application/vnd.hl7cda+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.hl7v2+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.hp-hpgl": { - source: "iana", - extensions: ["hpgl"] - }, - "application/vnd.hp-hpid": { - source: "iana", - extensions: ["hpid"] - }, - "application/vnd.hp-hps": { - source: "iana", - extensions: ["hps"] - }, - "application/vnd.hp-jlyt": { - source: "iana", - extensions: ["jlt"] - }, - "application/vnd.hp-pcl": { - source: "iana", - extensions: ["pcl"] - }, - "application/vnd.hp-pclxl": { - source: "iana", - extensions: ["pclxl"] - }, - "application/vnd.httphone": { - source: "iana" - }, - "application/vnd.hydrostatix.sof-data": { - source: "iana", - extensions: ["sfd-hdstx"] - }, - "application/vnd.hyper+json": { - source: "iana", - compressible: true - }, - "application/vnd.hyper-item+json": { - source: "iana", - compressible: true - }, - "application/vnd.hyperdrive+json": { - source: "iana", - compressible: true - }, - "application/vnd.hzn-3d-crossword": { - source: "iana" - }, - "application/vnd.ibm.afplinedata": { - source: "iana" - }, - "application/vnd.ibm.electronic-media": { - source: "iana" - }, - "application/vnd.ibm.minipay": { - source: "iana", - extensions: ["mpy"] - }, - "application/vnd.ibm.modcap": { - source: "iana", - extensions: ["afp", "listafp", "list3820"] - }, - "application/vnd.ibm.rights-management": { - source: "iana", - extensions: ["irm"] - }, - "application/vnd.ibm.secure-container": { - source: "iana", - extensions: ["sc"] - }, - "application/vnd.iccprofile": { - source: "iana", - extensions: ["icc", "icm"] - }, - "application/vnd.ieee.1905": { - source: "iana" - }, - "application/vnd.igloader": { - source: "iana", - extensions: ["igl"] - }, - "application/vnd.imagemeter.folder+zip": { - source: "iana", - compressible: false - }, - "application/vnd.imagemeter.image+zip": { - source: "iana", - compressible: false - }, - "application/vnd.immervision-ivp": { - source: "iana", - extensions: ["ivp"] - }, - "application/vnd.immervision-ivu": { - source: "iana", - extensions: ["ivu"] - }, - "application/vnd.ims.imsccv1p1": { - source: "iana" - }, - "application/vnd.ims.imsccv1p2": { - source: "iana" - }, - "application/vnd.ims.imsccv1p3": { - source: "iana" - }, - "application/vnd.ims.lis.v2.result+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolconsumerprofile+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolproxy+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolproxy.id+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolsettings+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolsettings.simple+json": { - source: "iana", - compressible: true - }, - "application/vnd.informedcontrol.rms+xml": { - source: "iana", - compressible: true - }, - "application/vnd.informix-visionary": { - source: "iana" - }, - "application/vnd.infotech.project": { - source: "iana" - }, - "application/vnd.infotech.project+xml": { - source: "iana", - compressible: true - }, - "application/vnd.innopath.wamp.notification": { - source: "iana" - }, - "application/vnd.insors.igm": { - source: "iana", - extensions: ["igm"] - }, - "application/vnd.intercon.formnet": { - source: "iana", - extensions: ["xpw", "xpx"] - }, - "application/vnd.intergeo": { - source: "iana", - extensions: ["i2g"] - }, - "application/vnd.intertrust.digibox": { - source: "iana" - }, - "application/vnd.intertrust.nncp": { - source: "iana" - }, - "application/vnd.intu.qbo": { - source: "iana", - extensions: ["qbo"] - }, - "application/vnd.intu.qfx": { - source: "iana", - extensions: ["qfx"] - }, - "application/vnd.iptc.g2.catalogitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.conceptitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.knowledgeitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.newsitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.newsmessage+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.packageitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.planningitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ipunplugged.rcprofile": { - source: "iana", - extensions: ["rcprofile"] - }, - "application/vnd.irepository.package+xml": { - source: "iana", - compressible: true, - extensions: ["irp"] - }, - "application/vnd.is-xpr": { - source: "iana", - extensions: ["xpr"] - }, - "application/vnd.isac.fcs": { - source: "iana", - extensions: ["fcs"] - }, - "application/vnd.iso11783-10+zip": { - source: "iana", - compressible: false - }, - "application/vnd.jam": { - source: "iana", - extensions: ["jam"] - }, - "application/vnd.japannet-directory-service": { - source: "iana" - }, - "application/vnd.japannet-jpnstore-wakeup": { - source: "iana" - }, - "application/vnd.japannet-payment-wakeup": { - source: "iana" - }, - "application/vnd.japannet-registration": { - source: "iana" - }, - "application/vnd.japannet-registration-wakeup": { - source: "iana" - }, - "application/vnd.japannet-setstore-wakeup": { - source: "iana" - }, - "application/vnd.japannet-verification": { - source: "iana" - }, - "application/vnd.japannet-verification-wakeup": { - source: "iana" - }, - "application/vnd.jcp.javame.midlet-rms": { - source: "iana", - extensions: ["rms"] - }, - "application/vnd.jisp": { - source: "iana", - extensions: ["jisp"] - }, - "application/vnd.joost.joda-archive": { - source: "iana", - extensions: ["joda"] - }, - "application/vnd.jsk.isdn-ngn": { - source: "iana" - }, - "application/vnd.kahootz": { - source: "iana", - extensions: ["ktz", "ktr"] - }, - "application/vnd.kde.karbon": { - source: "iana", - extensions: ["karbon"] - }, - "application/vnd.kde.kchart": { - source: "iana", - extensions: ["chrt"] - }, - "application/vnd.kde.kformula": { - source: "iana", - extensions: ["kfo"] - }, - "application/vnd.kde.kivio": { - source: "iana", - extensions: ["flw"] - }, - "application/vnd.kde.kontour": { - source: "iana", - extensions: ["kon"] - }, - "application/vnd.kde.kpresenter": { - source: "iana", - extensions: ["kpr", "kpt"] - }, - "application/vnd.kde.kspread": { - source: "iana", - extensions: ["ksp"] - }, - "application/vnd.kde.kword": { - source: "iana", - extensions: ["kwd", "kwt"] - }, - "application/vnd.kenameaapp": { - source: "iana", - extensions: ["htke"] - }, - "application/vnd.kidspiration": { - source: "iana", - extensions: ["kia"] - }, - "application/vnd.kinar": { - source: "iana", - extensions: ["kne", "knp"] - }, - "application/vnd.koan": { - source: "iana", - extensions: ["skp", "skd", "skt", "skm"] - }, - "application/vnd.kodak-descriptor": { - source: "iana", - extensions: ["sse"] - }, - "application/vnd.las": { - source: "iana" - }, - "application/vnd.las.las+json": { - source: "iana", - compressible: true - }, - "application/vnd.las.las+xml": { - source: "iana", - compressible: true, - extensions: ["lasxml"] - }, - "application/vnd.laszip": { - source: "iana" - }, - "application/vnd.leap+json": { - source: "iana", - compressible: true - }, - "application/vnd.liberty-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.llamagraphics.life-balance.desktop": { - source: "iana", - extensions: ["lbd"] - }, - "application/vnd.llamagraphics.life-balance.exchange+xml": { - source: "iana", - compressible: true, - extensions: ["lbe"] - }, - "application/vnd.logipipe.circuit+zip": { - source: "iana", - compressible: false - }, - "application/vnd.loom": { - source: "iana" - }, - "application/vnd.lotus-1-2-3": { - source: "iana", - extensions: ["123"] - }, - "application/vnd.lotus-approach": { - source: "iana", - extensions: ["apr"] - }, - "application/vnd.lotus-freelance": { - source: "iana", - extensions: ["pre"] - }, - "application/vnd.lotus-notes": { - source: "iana", - extensions: ["nsf"] - }, - "application/vnd.lotus-organizer": { - source: "iana", - extensions: ["org"] - }, - "application/vnd.lotus-screencam": { - source: "iana", - extensions: ["scm"] - }, - "application/vnd.lotus-wordpro": { - source: "iana", - extensions: ["lwp"] - }, - "application/vnd.macports.portpkg": { - source: "iana", - extensions: ["portpkg"] - }, - "application/vnd.mapbox-vector-tile": { - source: "iana", - extensions: ["mvt"] - }, - "application/vnd.marlin.drm.actiontoken+xml": { - source: "iana", - compressible: true - }, - "application/vnd.marlin.drm.conftoken+xml": { - source: "iana", - compressible: true - }, - "application/vnd.marlin.drm.license+xml": { - source: "iana", - compressible: true - }, - "application/vnd.marlin.drm.mdcf": { - source: "iana" - }, - "application/vnd.mason+json": { - source: "iana", - compressible: true - }, - "application/vnd.maxar.archive.3tz+zip": { - source: "iana", - compressible: false - }, - "application/vnd.maxmind.maxmind-db": { - source: "iana" - }, - "application/vnd.mcd": { - source: "iana", - extensions: ["mcd"] - }, - "application/vnd.medcalcdata": { - source: "iana", - extensions: ["mc1"] - }, - "application/vnd.mediastation.cdkey": { - source: "iana", - extensions: ["cdkey"] - }, - "application/vnd.meridian-slingshot": { - source: "iana" - }, - "application/vnd.mfer": { - source: "iana", - extensions: ["mwf"] - }, - "application/vnd.mfmp": { - source: "iana", - extensions: ["mfm"] - }, - "application/vnd.micro+json": { - source: "iana", - compressible: true - }, - "application/vnd.micrografx.flo": { - source: "iana", - extensions: ["flo"] - }, - "application/vnd.micrografx.igx": { - source: "iana", - extensions: ["igx"] - }, - "application/vnd.microsoft.portable-executable": { - source: "iana" - }, - "application/vnd.microsoft.windows.thumbnail-cache": { - source: "iana" - }, - "application/vnd.miele+json": { - source: "iana", - compressible: true - }, - "application/vnd.mif": { - source: "iana", - extensions: ["mif"] - }, - "application/vnd.minisoft-hp3000-save": { - source: "iana" - }, - "application/vnd.mitsubishi.misty-guard.trustweb": { - source: "iana" - }, - "application/vnd.mobius.daf": { - source: "iana", - extensions: ["daf"] - }, - "application/vnd.mobius.dis": { - source: "iana", - extensions: ["dis"] - }, - "application/vnd.mobius.mbk": { - source: "iana", - extensions: ["mbk"] - }, - "application/vnd.mobius.mqy": { - source: "iana", - extensions: ["mqy"] - }, - "application/vnd.mobius.msl": { - source: "iana", - extensions: ["msl"] - }, - "application/vnd.mobius.plc": { - source: "iana", - extensions: ["plc"] - }, - "application/vnd.mobius.txf": { - source: "iana", - extensions: ["txf"] - }, - "application/vnd.mophun.application": { - source: "iana", - extensions: ["mpn"] - }, - "application/vnd.mophun.certificate": { - source: "iana", - extensions: ["mpc"] - }, - "application/vnd.motorola.flexsuite": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.adsi": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.fis": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.gotap": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.kmr": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.ttc": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.wem": { - source: "iana" - }, - "application/vnd.motorola.iprm": { - source: "iana" - }, - "application/vnd.mozilla.xul+xml": { - source: "iana", - compressible: true, - extensions: ["xul"] - }, - "application/vnd.ms-3mfdocument": { - source: "iana" - }, - "application/vnd.ms-artgalry": { - source: "iana", - extensions: ["cil"] - }, - "application/vnd.ms-asf": { - source: "iana" - }, - "application/vnd.ms-cab-compressed": { - source: "iana", - extensions: ["cab"] - }, - "application/vnd.ms-color.iccprofile": { - source: "apache" - }, - "application/vnd.ms-excel": { - source: "iana", - compressible: false, - extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"] - }, - "application/vnd.ms-excel.addin.macroenabled.12": { - source: "iana", - extensions: ["xlam"] - }, - "application/vnd.ms-excel.sheet.binary.macroenabled.12": { - source: "iana", - extensions: ["xlsb"] - }, - "application/vnd.ms-excel.sheet.macroenabled.12": { - source: "iana", - extensions: ["xlsm"] - }, - "application/vnd.ms-excel.template.macroenabled.12": { - source: "iana", - extensions: ["xltm"] - }, - "application/vnd.ms-fontobject": { - source: "iana", - compressible: true, - extensions: ["eot"] - }, - "application/vnd.ms-htmlhelp": { - source: "iana", - extensions: ["chm"] - }, - "application/vnd.ms-ims": { - source: "iana", - extensions: ["ims"] - }, - "application/vnd.ms-lrm": { - source: "iana", - extensions: ["lrm"] - }, - "application/vnd.ms-office.activex+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-officetheme": { - source: "iana", - extensions: ["thmx"] - }, - "application/vnd.ms-opentype": { - source: "apache", - compressible: true - }, - "application/vnd.ms-outlook": { - compressible: false, - extensions: ["msg"] - }, - "application/vnd.ms-package.obfuscated-opentype": { - source: "apache" - }, - "application/vnd.ms-pki.seccat": { - source: "apache", - extensions: ["cat"] - }, - "application/vnd.ms-pki.stl": { - source: "apache", - extensions: ["stl"] - }, - "application/vnd.ms-playready.initiator+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-powerpoint": { - source: "iana", - compressible: false, - extensions: ["ppt", "pps", "pot"] - }, - "application/vnd.ms-powerpoint.addin.macroenabled.12": { - source: "iana", - extensions: ["ppam"] - }, - "application/vnd.ms-powerpoint.presentation.macroenabled.12": { - source: "iana", - extensions: ["pptm"] - }, - "application/vnd.ms-powerpoint.slide.macroenabled.12": { - source: "iana", - extensions: ["sldm"] - }, - "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { - source: "iana", - extensions: ["ppsm"] - }, - "application/vnd.ms-powerpoint.template.macroenabled.12": { - source: "iana", - extensions: ["potm"] - }, - "application/vnd.ms-printdevicecapabilities+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-printing.printticket+xml": { - source: "apache", - compressible: true - }, - "application/vnd.ms-printschematicket+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-project": { - source: "iana", - extensions: ["mpp", "mpt"] - }, - "application/vnd.ms-tnef": { - source: "iana" - }, - "application/vnd.ms-windows.devicepairing": { - source: "iana" - }, - "application/vnd.ms-windows.nwprinting.oob": { - source: "iana" - }, - "application/vnd.ms-windows.printerpairing": { - source: "iana" - }, - "application/vnd.ms-windows.wsd.oob": { - source: "iana" - }, - "application/vnd.ms-wmdrm.lic-chlg-req": { - source: "iana" - }, - "application/vnd.ms-wmdrm.lic-resp": { - source: "iana" - }, - "application/vnd.ms-wmdrm.meter-chlg-req": { - source: "iana" - }, - "application/vnd.ms-wmdrm.meter-resp": { - source: "iana" - }, - "application/vnd.ms-word.document.macroenabled.12": { - source: "iana", - extensions: ["docm"] - }, - "application/vnd.ms-word.template.macroenabled.12": { - source: "iana", - extensions: ["dotm"] - }, - "application/vnd.ms-works": { - source: "iana", - extensions: ["wps", "wks", "wcm", "wdb"] - }, - "application/vnd.ms-wpl": { - source: "iana", - extensions: ["wpl"] - }, - "application/vnd.ms-xpsdocument": { - source: "iana", - compressible: false, - extensions: ["xps"] - }, - "application/vnd.msa-disk-image": { - source: "iana" - }, - "application/vnd.mseq": { - source: "iana", - extensions: ["mseq"] - }, - "application/vnd.msign": { - source: "iana" - }, - "application/vnd.multiad.creator": { - source: "iana" - }, - "application/vnd.multiad.creator.cif": { - source: "iana" - }, - "application/vnd.music-niff": { - source: "iana" - }, - "application/vnd.musician": { - source: "iana", - extensions: ["mus"] - }, - "application/vnd.muvee.style": { - source: "iana", - extensions: ["msty"] - }, - "application/vnd.mynfc": { - source: "iana", - extensions: ["taglet"] - }, - "application/vnd.nacamar.ybrid+json": { - source: "iana", - compressible: true - }, - "application/vnd.ncd.control": { - source: "iana" - }, - "application/vnd.ncd.reference": { - source: "iana" - }, - "application/vnd.nearst.inv+json": { - source: "iana", - compressible: true - }, - "application/vnd.nebumind.line": { - source: "iana" - }, - "application/vnd.nervana": { - source: "iana" - }, - "application/vnd.netfpx": { - source: "iana" - }, - "application/vnd.neurolanguage.nlu": { - source: "iana", - extensions: ["nlu"] - }, - "application/vnd.nimn": { - source: "iana" - }, - "application/vnd.nintendo.nitro.rom": { - source: "iana" - }, - "application/vnd.nintendo.snes.rom": { - source: "iana" - }, - "application/vnd.nitf": { - source: "iana", - extensions: ["ntf", "nitf"] - }, - "application/vnd.noblenet-directory": { - source: "iana", - extensions: ["nnd"] - }, - "application/vnd.noblenet-sealer": { - source: "iana", - extensions: ["nns"] - }, - "application/vnd.noblenet-web": { - source: "iana", - extensions: ["nnw"] - }, - "application/vnd.nokia.catalogs": { - source: "iana" - }, - "application/vnd.nokia.conml+wbxml": { - source: "iana" - }, - "application/vnd.nokia.conml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.iptv.config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.isds-radio-presets": { - source: "iana" - }, - "application/vnd.nokia.landmark+wbxml": { - source: "iana" - }, - "application/vnd.nokia.landmark+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.landmarkcollection+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.n-gage.ac+xml": { - source: "iana", - compressible: true, - extensions: ["ac"] - }, - "application/vnd.nokia.n-gage.data": { - source: "iana", - extensions: ["ngdat"] - }, - "application/vnd.nokia.n-gage.symbian.install": { - source: "iana", - extensions: ["n-gage"] - }, - "application/vnd.nokia.ncd": { - source: "iana" - }, - "application/vnd.nokia.pcd+wbxml": { - source: "iana" - }, - "application/vnd.nokia.pcd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.radio-preset": { - source: "iana", - extensions: ["rpst"] - }, - "application/vnd.nokia.radio-presets": { - source: "iana", - extensions: ["rpss"] - }, - "application/vnd.novadigm.edm": { - source: "iana", - extensions: ["edm"] - }, - "application/vnd.novadigm.edx": { - source: "iana", - extensions: ["edx"] - }, - "application/vnd.novadigm.ext": { - source: "iana", - extensions: ["ext"] - }, - "application/vnd.ntt-local.content-share": { - source: "iana" - }, - "application/vnd.ntt-local.file-transfer": { - source: "iana" - }, - "application/vnd.ntt-local.ogw_remote-access": { - source: "iana" - }, - "application/vnd.ntt-local.sip-ta_remote": { - source: "iana" - }, - "application/vnd.ntt-local.sip-ta_tcp_stream": { - source: "iana" - }, - "application/vnd.oasis.opendocument.chart": { - source: "iana", - extensions: ["odc"] - }, - "application/vnd.oasis.opendocument.chart-template": { - source: "iana", - extensions: ["otc"] - }, - "application/vnd.oasis.opendocument.database": { - source: "iana", - extensions: ["odb"] - }, - "application/vnd.oasis.opendocument.formula": { - source: "iana", - extensions: ["odf"] - }, - "application/vnd.oasis.opendocument.formula-template": { - source: "iana", - extensions: ["odft"] - }, - "application/vnd.oasis.opendocument.graphics": { - source: "iana", - compressible: false, - extensions: ["odg"] - }, - "application/vnd.oasis.opendocument.graphics-template": { - source: "iana", - extensions: ["otg"] - }, - "application/vnd.oasis.opendocument.image": { - source: "iana", - extensions: ["odi"] - }, - "application/vnd.oasis.opendocument.image-template": { - source: "iana", - extensions: ["oti"] - }, - "application/vnd.oasis.opendocument.presentation": { - source: "iana", - compressible: false, - extensions: ["odp"] - }, - "application/vnd.oasis.opendocument.presentation-template": { - source: "iana", - extensions: ["otp"] - }, - "application/vnd.oasis.opendocument.spreadsheet": { - source: "iana", - compressible: false, - extensions: ["ods"] - }, - "application/vnd.oasis.opendocument.spreadsheet-template": { - source: "iana", - extensions: ["ots"] - }, - "application/vnd.oasis.opendocument.text": { - source: "iana", - compressible: false, - extensions: ["odt"] - }, - "application/vnd.oasis.opendocument.text-master": { - source: "iana", - extensions: ["odm"] - }, - "application/vnd.oasis.opendocument.text-template": { - source: "iana", - extensions: ["ott"] - }, - "application/vnd.oasis.opendocument.text-web": { - source: "iana", - extensions: ["oth"] - }, - "application/vnd.obn": { - source: "iana" - }, - "application/vnd.ocf+cbor": { - source: "iana" - }, - "application/vnd.oci.image.manifest.v1+json": { - source: "iana", - compressible: true - }, - "application/vnd.oftn.l10n+json": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.contentaccessdownload+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.contentaccessstreaming+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.cspg-hexbinary": { - source: "iana" - }, - "application/vnd.oipf.dae.svg+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.dae.xhtml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.mippvcontrolmessage+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.pae.gem": { - source: "iana" - }, - "application/vnd.oipf.spdiscovery+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.spdlist+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.ueprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.userprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.olpc-sugar": { - source: "iana", - extensions: ["xo"] - }, - "application/vnd.oma-scws-config": { - source: "iana" - }, - "application/vnd.oma-scws-http-request": { - source: "iana" - }, - "application/vnd.oma-scws-http-response": { - source: "iana" - }, - "application/vnd.oma.bcast.associated-procedure-parameter+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.drm-trigger+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.imd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.ltkm": { - source: "iana" - }, - "application/vnd.oma.bcast.notification+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.provisioningtrigger": { - source: "iana" - }, - "application/vnd.oma.bcast.sgboot": { - source: "iana" - }, - "application/vnd.oma.bcast.sgdd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.sgdu": { - source: "iana" - }, - "application/vnd.oma.bcast.simple-symbol-container": { - source: "iana" - }, - "application/vnd.oma.bcast.smartcard-trigger+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.sprov+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.stkm": { - source: "iana" - }, - "application/vnd.oma.cab-address-book+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-feature-handler+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-pcc+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-subs-invite+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-user-prefs+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.dcd": { - source: "iana" - }, - "application/vnd.oma.dcdc": { - source: "iana" - }, - "application/vnd.oma.dd2+xml": { - source: "iana", - compressible: true, - extensions: ["dd2"] - }, - "application/vnd.oma.drm.risd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.group-usage-list+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.lwm2m+cbor": { - source: "iana" - }, - "application/vnd.oma.lwm2m+json": { - source: "iana", - compressible: true - }, - "application/vnd.oma.lwm2m+tlv": { - source: "iana" - }, - "application/vnd.oma.pal+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.detailed-progress-report+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.final-report+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.groups+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.invocation-descriptor+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.optimized-progress-report+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.push": { - source: "iana" - }, - "application/vnd.oma.scidm.messages+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.xcap-directory+xml": { - source: "iana", - compressible: true - }, - "application/vnd.omads-email+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.omads-file+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.omads-folder+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.omaloc-supl-init": { - source: "iana" - }, - "application/vnd.onepager": { - source: "iana" - }, - "application/vnd.onepagertamp": { - source: "iana" - }, - "application/vnd.onepagertamx": { - source: "iana" - }, - "application/vnd.onepagertat": { - source: "iana" - }, - "application/vnd.onepagertatp": { - source: "iana" - }, - "application/vnd.onepagertatx": { - source: "iana" - }, - "application/vnd.openblox.game+xml": { - source: "iana", - compressible: true, - extensions: ["obgx"] - }, - "application/vnd.openblox.game-binary": { - source: "iana" - }, - "application/vnd.openeye.oeb": { - source: "iana" - }, - "application/vnd.openofficeorg.extension": { - source: "apache", - extensions: ["oxt"] - }, - "application/vnd.openstreetmap.data+xml": { - source: "iana", - compressible: true, - extensions: ["osm"] - }, - "application/vnd.opentimestamps.ots": { - source: "iana" - }, - "application/vnd.openxmlformats-officedocument.custom-properties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawing+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.extended-properties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation": { - source: "iana", - compressible: false, - extensions: ["pptx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide": { - source: "iana", - extensions: ["sldx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { - source: "iana", - extensions: ["ppsx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.template": { - source: "iana", - extensions: ["potx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { - source: "iana", - compressible: false, - extensions: ["xlsx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { - source: "iana", - extensions: ["xltx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.theme+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.themeoverride+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.vmldrawing": { - source: "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { - source: "iana", - compressible: false, - extensions: ["docx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { - source: "iana", - extensions: ["dotx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-package.core-properties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-package.relationships+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oracle.resource+json": { - source: "iana", - compressible: true - }, - "application/vnd.orange.indata": { - source: "iana" - }, - "application/vnd.osa.netdeploy": { - source: "iana" - }, - "application/vnd.osgeo.mapguide.package": { - source: "iana", - extensions: ["mgp"] - }, - "application/vnd.osgi.bundle": { - source: "iana" - }, - "application/vnd.osgi.dp": { - source: "iana", - extensions: ["dp"] - }, - "application/vnd.osgi.subsystem": { - source: "iana", - extensions: ["esa"] - }, - "application/vnd.otps.ct-kip+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oxli.countgraph": { - source: "iana" - }, - "application/vnd.pagerduty+json": { - source: "iana", - compressible: true - }, - "application/vnd.palm": { - source: "iana", - extensions: ["pdb", "pqa", "oprc"] - }, - "application/vnd.panoply": { - source: "iana" - }, - "application/vnd.paos.xml": { - source: "iana" - }, - "application/vnd.patentdive": { - source: "iana" - }, - "application/vnd.patientecommsdoc": { - source: "iana" - }, - "application/vnd.pawaafile": { - source: "iana", - extensions: ["paw"] - }, - "application/vnd.pcos": { - source: "iana" - }, - "application/vnd.pg.format": { - source: "iana", - extensions: ["str"] - }, - "application/vnd.pg.osasli": { - source: "iana", - extensions: ["ei6"] - }, - "application/vnd.piaccess.application-licence": { - source: "iana" - }, - "application/vnd.picsel": { - source: "iana", - extensions: ["efif"] - }, - "application/vnd.pmi.widget": { - source: "iana", - extensions: ["wg"] - }, - "application/vnd.poc.group-advertisement+xml": { - source: "iana", - compressible: true - }, - "application/vnd.pocketlearn": { - source: "iana", - extensions: ["plf"] - }, - "application/vnd.powerbuilder6": { - source: "iana", - extensions: ["pbd"] - }, - "application/vnd.powerbuilder6-s": { - source: "iana" - }, - "application/vnd.powerbuilder7": { - source: "iana" - }, - "application/vnd.powerbuilder7-s": { - source: "iana" - }, - "application/vnd.powerbuilder75": { - source: "iana" - }, - "application/vnd.powerbuilder75-s": { - source: "iana" - }, - "application/vnd.preminet": { - source: "iana" - }, - "application/vnd.previewsystems.box": { - source: "iana", - extensions: ["box"] - }, - "application/vnd.proteus.magazine": { - source: "iana", - extensions: ["mgz"] - }, - "application/vnd.psfs": { - source: "iana" - }, - "application/vnd.publishare-delta-tree": { - source: "iana", - extensions: ["qps"] - }, - "application/vnd.pvi.ptid1": { - source: "iana", - extensions: ["ptid"] - }, - "application/vnd.pwg-multiplexed": { - source: "iana" - }, - "application/vnd.pwg-xhtml-print+xml": { - source: "iana", - compressible: true - }, - "application/vnd.qualcomm.brew-app-res": { - source: "iana" - }, - "application/vnd.quarantainenet": { - source: "iana" - }, - "application/vnd.quark.quarkxpress": { - source: "iana", - extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"] - }, - "application/vnd.quobject-quoxdocument": { - source: "iana" - }, - "application/vnd.radisys.moml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-conf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-conn+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-dialog+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-stream+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-conf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-base+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-fax-detect+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-group+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-speech+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-transform+xml": { - source: "iana", - compressible: true - }, - "application/vnd.rainstor.data": { - source: "iana" - }, - "application/vnd.rapid": { - source: "iana" - }, - "application/vnd.rar": { - source: "iana", - extensions: ["rar"] - }, - "application/vnd.realvnc.bed": { - source: "iana", - extensions: ["bed"] - }, - "application/vnd.recordare.musicxml": { - source: "iana", - extensions: ["mxl"] - }, - "application/vnd.recordare.musicxml+xml": { - source: "iana", - compressible: true, - extensions: ["musicxml"] - }, - "application/vnd.renlearn.rlprint": { - source: "iana" - }, - "application/vnd.resilient.logic": { - source: "iana" - }, - "application/vnd.restful+json": { - source: "iana", - compressible: true - }, - "application/vnd.rig.cryptonote": { - source: "iana", - extensions: ["cryptonote"] - }, - "application/vnd.rim.cod": { - source: "apache", - extensions: ["cod"] - }, - "application/vnd.rn-realmedia": { - source: "apache", - extensions: ["rm"] - }, - "application/vnd.rn-realmedia-vbr": { - source: "apache", - extensions: ["rmvb"] - }, - "application/vnd.route66.link66+xml": { - source: "iana", - compressible: true, - extensions: ["link66"] - }, - "application/vnd.rs-274x": { - source: "iana" - }, - "application/vnd.ruckus.download": { - source: "iana" - }, - "application/vnd.s3sms": { - source: "iana" - }, - "application/vnd.sailingtracker.track": { - source: "iana", - extensions: ["st"] - }, - "application/vnd.sar": { - source: "iana" - }, - "application/vnd.sbm.cid": { - source: "iana" - }, - "application/vnd.sbm.mid2": { - source: "iana" - }, - "application/vnd.scribus": { - source: "iana" - }, - "application/vnd.sealed.3df": { - source: "iana" - }, - "application/vnd.sealed.csf": { - source: "iana" - }, - "application/vnd.sealed.doc": { - source: "iana" - }, - "application/vnd.sealed.eml": { - source: "iana" - }, - "application/vnd.sealed.mht": { - source: "iana" - }, - "application/vnd.sealed.net": { - source: "iana" - }, - "application/vnd.sealed.ppt": { - source: "iana" - }, - "application/vnd.sealed.tiff": { - source: "iana" - }, - "application/vnd.sealed.xls": { - source: "iana" - }, - "application/vnd.sealedmedia.softseal.html": { - source: "iana" - }, - "application/vnd.sealedmedia.softseal.pdf": { - source: "iana" - }, - "application/vnd.seemail": { - source: "iana", - extensions: ["see"] - }, - "application/vnd.seis+json": { - source: "iana", - compressible: true - }, - "application/vnd.sema": { - source: "iana", - extensions: ["sema"] - }, - "application/vnd.semd": { - source: "iana", - extensions: ["semd"] - }, - "application/vnd.semf": { - source: "iana", - extensions: ["semf"] - }, - "application/vnd.shade-save-file": { - source: "iana" - }, - "application/vnd.shana.informed.formdata": { - source: "iana", - extensions: ["ifm"] - }, - "application/vnd.shana.informed.formtemplate": { - source: "iana", - extensions: ["itp"] - }, - "application/vnd.shana.informed.interchange": { - source: "iana", - extensions: ["iif"] - }, - "application/vnd.shana.informed.package": { - source: "iana", - extensions: ["ipk"] - }, - "application/vnd.shootproof+json": { - source: "iana", - compressible: true - }, - "application/vnd.shopkick+json": { - source: "iana", - compressible: true - }, - "application/vnd.shp": { - source: "iana" - }, - "application/vnd.shx": { - source: "iana" - }, - "application/vnd.sigrok.session": { - source: "iana" - }, - "application/vnd.simtech-mindmapper": { - source: "iana", - extensions: ["twd", "twds"] - }, - "application/vnd.siren+json": { - source: "iana", - compressible: true - }, - "application/vnd.smaf": { - source: "iana", - extensions: ["mmf"] - }, - "application/vnd.smart.notebook": { - source: "iana" - }, - "application/vnd.smart.teacher": { - source: "iana", - extensions: ["teacher"] - }, - "application/vnd.snesdev-page-table": { - source: "iana" - }, - "application/vnd.software602.filler.form+xml": { - source: "iana", - compressible: true, - extensions: ["fo"] - }, - "application/vnd.software602.filler.form-xml-zip": { - source: "iana" - }, - "application/vnd.solent.sdkm+xml": { - source: "iana", - compressible: true, - extensions: ["sdkm", "sdkd"] - }, - "application/vnd.spotfire.dxp": { - source: "iana", - extensions: ["dxp"] - }, - "application/vnd.spotfire.sfs": { - source: "iana", - extensions: ["sfs"] - }, - "application/vnd.sqlite3": { - source: "iana" - }, - "application/vnd.sss-cod": { - source: "iana" - }, - "application/vnd.sss-dtf": { - source: "iana" - }, - "application/vnd.sss-ntf": { - source: "iana" - }, - "application/vnd.stardivision.calc": { - source: "apache", - extensions: ["sdc"] - }, - "application/vnd.stardivision.draw": { - source: "apache", - extensions: ["sda"] - }, - "application/vnd.stardivision.impress": { - source: "apache", - extensions: ["sdd"] - }, - "application/vnd.stardivision.math": { - source: "apache", - extensions: ["smf"] - }, - "application/vnd.stardivision.writer": { - source: "apache", - extensions: ["sdw", "vor"] - }, - "application/vnd.stardivision.writer-global": { - source: "apache", - extensions: ["sgl"] - }, - "application/vnd.stepmania.package": { - source: "iana", - extensions: ["smzip"] - }, - "application/vnd.stepmania.stepchart": { - source: "iana", - extensions: ["sm"] - }, - "application/vnd.street-stream": { - source: "iana" - }, - "application/vnd.sun.wadl+xml": { - source: "iana", - compressible: true, - extensions: ["wadl"] - }, - "application/vnd.sun.xml.calc": { - source: "apache", - extensions: ["sxc"] - }, - "application/vnd.sun.xml.calc.template": { - source: "apache", - extensions: ["stc"] - }, - "application/vnd.sun.xml.draw": { - source: "apache", - extensions: ["sxd"] - }, - "application/vnd.sun.xml.draw.template": { - source: "apache", - extensions: ["std"] - }, - "application/vnd.sun.xml.impress": { - source: "apache", - extensions: ["sxi"] - }, - "application/vnd.sun.xml.impress.template": { - source: "apache", - extensions: ["sti"] - }, - "application/vnd.sun.xml.math": { - source: "apache", - extensions: ["sxm"] - }, - "application/vnd.sun.xml.writer": { - source: "apache", - extensions: ["sxw"] - }, - "application/vnd.sun.xml.writer.global": { - source: "apache", - extensions: ["sxg"] - }, - "application/vnd.sun.xml.writer.template": { - source: "apache", - extensions: ["stw"] - }, - "application/vnd.sus-calendar": { - source: "iana", - extensions: ["sus", "susp"] - }, - "application/vnd.svd": { - source: "iana", - extensions: ["svd"] - }, - "application/vnd.swiftview-ics": { - source: "iana" - }, - "application/vnd.sycle+xml": { - source: "iana", - compressible: true - }, - "application/vnd.syft+json": { - source: "iana", - compressible: true - }, - "application/vnd.symbian.install": { - source: "apache", - extensions: ["sis", "sisx"] - }, - "application/vnd.syncml+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["xsm"] - }, - "application/vnd.syncml.dm+wbxml": { - source: "iana", - charset: "UTF-8", - extensions: ["bdm"] - }, - "application/vnd.syncml.dm+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["xdm"] - }, - "application/vnd.syncml.dm.notification": { - source: "iana" - }, - "application/vnd.syncml.dmddf+wbxml": { - source: "iana" - }, - "application/vnd.syncml.dmddf+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["ddf"] - }, - "application/vnd.syncml.dmtnds+wbxml": { - source: "iana" - }, - "application/vnd.syncml.dmtnds+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.syncml.ds.notification": { - source: "iana" - }, - "application/vnd.tableschema+json": { - source: "iana", - compressible: true - }, - "application/vnd.tao.intent-module-archive": { - source: "iana", - extensions: ["tao"] - }, - "application/vnd.tcpdump.pcap": { - source: "iana", - extensions: ["pcap", "cap", "dmp"] - }, - "application/vnd.think-cell.ppttc+json": { - source: "iana", - compressible: true - }, - "application/vnd.tmd.mediaflex.api+xml": { - source: "iana", - compressible: true - }, - "application/vnd.tml": { - source: "iana" - }, - "application/vnd.tmobile-livetv": { - source: "iana", - extensions: ["tmo"] - }, - "application/vnd.tri.onesource": { - source: "iana" - }, - "application/vnd.trid.tpt": { - source: "iana", - extensions: ["tpt"] - }, - "application/vnd.triscape.mxs": { - source: "iana", - extensions: ["mxs"] - }, - "application/vnd.trueapp": { - source: "iana", - extensions: ["tra"] - }, - "application/vnd.truedoc": { - source: "iana" - }, - "application/vnd.ubisoft.webplayer": { - source: "iana" - }, - "application/vnd.ufdl": { - source: "iana", - extensions: ["ufd", "ufdl"] - }, - "application/vnd.uiq.theme": { - source: "iana", - extensions: ["utz"] - }, - "application/vnd.umajin": { - source: "iana", - extensions: ["umj"] - }, - "application/vnd.unity": { - source: "iana", - extensions: ["unityweb"] - }, - "application/vnd.uoml+xml": { - source: "iana", - compressible: true, - extensions: ["uoml"] - }, - "application/vnd.uplanet.alert": { - source: "iana" - }, - "application/vnd.uplanet.alert-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.bearer-choice": { - source: "iana" - }, - "application/vnd.uplanet.bearer-choice-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.cacheop": { - source: "iana" - }, - "application/vnd.uplanet.cacheop-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.channel": { - source: "iana" - }, - "application/vnd.uplanet.channel-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.list": { - source: "iana" - }, - "application/vnd.uplanet.list-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.listcmd": { - source: "iana" - }, - "application/vnd.uplanet.listcmd-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.signal": { - source: "iana" - }, - "application/vnd.uri-map": { - source: "iana" - }, - "application/vnd.valve.source.material": { - source: "iana" - }, - "application/vnd.vcx": { - source: "iana", - extensions: ["vcx"] - }, - "application/vnd.vd-study": { - source: "iana" - }, - "application/vnd.vectorworks": { - source: "iana" - }, - "application/vnd.vel+json": { - source: "iana", - compressible: true - }, - "application/vnd.verimatrix.vcas": { - source: "iana" - }, - "application/vnd.veritone.aion+json": { - source: "iana", - compressible: true - }, - "application/vnd.veryant.thin": { - source: "iana" - }, - "application/vnd.ves.encrypted": { - source: "iana" - }, - "application/vnd.vidsoft.vidconference": { - source: "iana" - }, - "application/vnd.visio": { - source: "iana", - extensions: ["vsd", "vst", "vss", "vsw"] - }, - "application/vnd.visionary": { - source: "iana", - extensions: ["vis"] - }, - "application/vnd.vividence.scriptfile": { - source: "iana" - }, - "application/vnd.vsf": { - source: "iana", - extensions: ["vsf"] - }, - "application/vnd.wap.sic": { - source: "iana" - }, - "application/vnd.wap.slc": { - source: "iana" - }, - "application/vnd.wap.wbxml": { - source: "iana", - charset: "UTF-8", - extensions: ["wbxml"] - }, - "application/vnd.wap.wmlc": { - source: "iana", - extensions: ["wmlc"] - }, - "application/vnd.wap.wmlscriptc": { - source: "iana", - extensions: ["wmlsc"] - }, - "application/vnd.webturbo": { - source: "iana", - extensions: ["wtb"] - }, - "application/vnd.wfa.dpp": { - source: "iana" - }, - "application/vnd.wfa.p2p": { - source: "iana" - }, - "application/vnd.wfa.wsc": { - source: "iana" - }, - "application/vnd.windows.devicepairing": { - source: "iana" - }, - "application/vnd.wmc": { - source: "iana" - }, - "application/vnd.wmf.bootstrap": { - source: "iana" - }, - "application/vnd.wolfram.mathematica": { - source: "iana" - }, - "application/vnd.wolfram.mathematica.package": { - source: "iana" - }, - "application/vnd.wolfram.player": { - source: "iana", - extensions: ["nbp"] - }, - "application/vnd.wordperfect": { - source: "iana", - extensions: ["wpd"] - }, - "application/vnd.wqd": { - source: "iana", - extensions: ["wqd"] - }, - "application/vnd.wrq-hp3000-labelled": { - source: "iana" - }, - "application/vnd.wt.stf": { - source: "iana", - extensions: ["stf"] - }, - "application/vnd.wv.csp+wbxml": { - source: "iana" - }, - "application/vnd.wv.csp+xml": { - source: "iana", - compressible: true - }, - "application/vnd.wv.ssp+xml": { - source: "iana", - compressible: true - }, - "application/vnd.xacml+json": { - source: "iana", - compressible: true - }, - "application/vnd.xara": { - source: "iana", - extensions: ["xar"] - }, - "application/vnd.xfdl": { - source: "iana", - extensions: ["xfdl"] - }, - "application/vnd.xfdl.webform": { - source: "iana" - }, - "application/vnd.xmi+xml": { - source: "iana", - compressible: true - }, - "application/vnd.xmpie.cpkg": { - source: "iana" - }, - "application/vnd.xmpie.dpkg": { - source: "iana" - }, - "application/vnd.xmpie.plan": { - source: "iana" - }, - "application/vnd.xmpie.ppkg": { - source: "iana" - }, - "application/vnd.xmpie.xlim": { - source: "iana" - }, - "application/vnd.yamaha.hv-dic": { - source: "iana", - extensions: ["hvd"] - }, - "application/vnd.yamaha.hv-script": { - source: "iana", - extensions: ["hvs"] - }, - "application/vnd.yamaha.hv-voice": { - source: "iana", - extensions: ["hvp"] - }, - "application/vnd.yamaha.openscoreformat": { - source: "iana", - extensions: ["osf"] - }, - "application/vnd.yamaha.openscoreformat.osfpvg+xml": { - source: "iana", - compressible: true, - extensions: ["osfpvg"] - }, - "application/vnd.yamaha.remote-setup": { - source: "iana" - }, - "application/vnd.yamaha.smaf-audio": { - source: "iana", - extensions: ["saf"] - }, - "application/vnd.yamaha.smaf-phrase": { - source: "iana", - extensions: ["spf"] - }, - "application/vnd.yamaha.through-ngn": { - source: "iana" - }, - "application/vnd.yamaha.tunnel-udpencap": { - source: "iana" - }, - "application/vnd.yaoweme": { - source: "iana" - }, - "application/vnd.yellowriver-custom-menu": { - source: "iana", - extensions: ["cmp"] - }, - "application/vnd.youtube.yt": { - source: "iana" - }, - "application/vnd.zul": { - source: "iana", - extensions: ["zir", "zirz"] - }, - "application/vnd.zzazz.deck+xml": { - source: "iana", - compressible: true, - extensions: ["zaz"] - }, - "application/voicexml+xml": { - source: "iana", - compressible: true, - extensions: ["vxml"] - }, - "application/voucher-cms+json": { - source: "iana", - compressible: true - }, - "application/vq-rtcpxr": { - source: "iana" - }, - "application/wasm": { - source: "iana", - compressible: true, - extensions: ["wasm"] - }, - "application/watcherinfo+xml": { - source: "iana", - compressible: true, - extensions: ["wif"] - }, - "application/webpush-options+json": { - source: "iana", - compressible: true - }, - "application/whoispp-query": { - source: "iana" - }, - "application/whoispp-response": { - source: "iana" - }, - "application/widget": { - source: "iana", - extensions: ["wgt"] - }, - "application/winhlp": { - source: "apache", - extensions: ["hlp"] - }, - "application/wita": { - source: "iana" - }, - "application/wordperfect5.1": { - source: "iana" - }, - "application/wsdl+xml": { - source: "iana", - compressible: true, - extensions: ["wsdl"] - }, - "application/wspolicy+xml": { - source: "iana", - compressible: true, - extensions: ["wspolicy"] - }, - "application/x-7z-compressed": { - source: "apache", - compressible: false, - extensions: ["7z"] - }, - "application/x-abiword": { - source: "apache", - extensions: ["abw"] - }, - "application/x-ace-compressed": { - source: "apache", - extensions: ["ace"] - }, - "application/x-amf": { - source: "apache" - }, - "application/x-apple-diskimage": { - source: "apache", - extensions: ["dmg"] - }, - "application/x-arj": { - compressible: false, - extensions: ["arj"] - }, - "application/x-authorware-bin": { - source: "apache", - extensions: ["aab", "x32", "u32", "vox"] - }, - "application/x-authorware-map": { - source: "apache", - extensions: ["aam"] - }, - "application/x-authorware-seg": { - source: "apache", - extensions: ["aas"] - }, - "application/x-bcpio": { - source: "apache", - extensions: ["bcpio"] - }, - "application/x-bdoc": { - compressible: false, - extensions: ["bdoc"] - }, - "application/x-bittorrent": { - source: "apache", - extensions: ["torrent"] - }, - "application/x-blorb": { - source: "apache", - extensions: ["blb", "blorb"] - }, - "application/x-bzip": { - source: "apache", - compressible: false, - extensions: ["bz"] - }, - "application/x-bzip2": { - source: "apache", - compressible: false, - extensions: ["bz2", "boz"] - }, - "application/x-cbr": { - source: "apache", - extensions: ["cbr", "cba", "cbt", "cbz", "cb7"] - }, - "application/x-cdlink": { - source: "apache", - extensions: ["vcd"] - }, - "application/x-cfs-compressed": { - source: "apache", - extensions: ["cfs"] - }, - "application/x-chat": { - source: "apache", - extensions: ["chat"] - }, - "application/x-chess-pgn": { - source: "apache", - extensions: ["pgn"] - }, - "application/x-chrome-extension": { - extensions: ["crx"] - }, - "application/x-cocoa": { - source: "nginx", - extensions: ["cco"] - }, - "application/x-compress": { - source: "apache" - }, - "application/x-conference": { - source: "apache", - extensions: ["nsc"] - }, - "application/x-cpio": { - source: "apache", - extensions: ["cpio"] - }, - "application/x-csh": { - source: "apache", - extensions: ["csh"] - }, - "application/x-deb": { - compressible: false - }, - "application/x-debian-package": { - source: "apache", - extensions: ["deb", "udeb"] - }, - "application/x-dgc-compressed": { - source: "apache", - extensions: ["dgc"] - }, - "application/x-director": { - source: "apache", - extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"] - }, - "application/x-doom": { - source: "apache", - extensions: ["wad"] - }, - "application/x-dtbncx+xml": { - source: "apache", - compressible: true, - extensions: ["ncx"] - }, - "application/x-dtbook+xml": { - source: "apache", - compressible: true, - extensions: ["dtb"] - }, - "application/x-dtbresource+xml": { - source: "apache", - compressible: true, - extensions: ["res"] - }, - "application/x-dvi": { - source: "apache", - compressible: false, - extensions: ["dvi"] - }, - "application/x-envoy": { - source: "apache", - extensions: ["evy"] - }, - "application/x-eva": { - source: "apache", - extensions: ["eva"] - }, - "application/x-font-bdf": { - source: "apache", - extensions: ["bdf"] - }, - "application/x-font-dos": { - source: "apache" - }, - "application/x-font-framemaker": { - source: "apache" - }, - "application/x-font-ghostscript": { - source: "apache", - extensions: ["gsf"] - }, - "application/x-font-libgrx": { - source: "apache" - }, - "application/x-font-linux-psf": { - source: "apache", - extensions: ["psf"] - }, - "application/x-font-pcf": { - source: "apache", - extensions: ["pcf"] - }, - "application/x-font-snf": { - source: "apache", - extensions: ["snf"] - }, - "application/x-font-speedo": { - source: "apache" - }, - "application/x-font-sunos-news": { - source: "apache" - }, - "application/x-font-type1": { - source: "apache", - extensions: ["pfa", "pfb", "pfm", "afm"] - }, - "application/x-font-vfont": { - source: "apache" - }, - "application/x-freearc": { - source: "apache", - extensions: ["arc"] - }, - "application/x-futuresplash": { - source: "apache", - extensions: ["spl"] - }, - "application/x-gca-compressed": { - source: "apache", - extensions: ["gca"] - }, - "application/x-glulx": { - source: "apache", - extensions: ["ulx"] - }, - "application/x-gnumeric": { - source: "apache", - extensions: ["gnumeric"] - }, - "application/x-gramps-xml": { - source: "apache", - extensions: ["gramps"] - }, - "application/x-gtar": { - source: "apache", - extensions: ["gtar"] - }, - "application/x-gzip": { - source: "apache" - }, - "application/x-hdf": { - source: "apache", - extensions: ["hdf"] - }, - "application/x-httpd-php": { - compressible: true, - extensions: ["php"] - }, - "application/x-install-instructions": { - source: "apache", - extensions: ["install"] - }, - "application/x-iso9660-image": { - source: "apache", - extensions: ["iso"] - }, - "application/x-iwork-keynote-sffkey": { - extensions: ["key"] - }, - "application/x-iwork-numbers-sffnumbers": { - extensions: ["numbers"] - }, - "application/x-iwork-pages-sffpages": { - extensions: ["pages"] - }, - "application/x-java-archive-diff": { - source: "nginx", - extensions: ["jardiff"] - }, - "application/x-java-jnlp-file": { - source: "apache", - compressible: false, - extensions: ["jnlp"] - }, - "application/x-javascript": { - compressible: true - }, - "application/x-keepass2": { - extensions: ["kdbx"] - }, - "application/x-latex": { - source: "apache", - compressible: false, - extensions: ["latex"] - }, - "application/x-lua-bytecode": { - extensions: ["luac"] - }, - "application/x-lzh-compressed": { - source: "apache", - extensions: ["lzh", "lha"] - }, - "application/x-makeself": { - source: "nginx", - extensions: ["run"] - }, - "application/x-mie": { - source: "apache", - extensions: ["mie"] - }, - "application/x-mobipocket-ebook": { - source: "apache", - extensions: ["prc", "mobi"] - }, - "application/x-mpegurl": { - compressible: false - }, - "application/x-ms-application": { - source: "apache", - extensions: ["application"] - }, - "application/x-ms-shortcut": { - source: "apache", - extensions: ["lnk"] - }, - "application/x-ms-wmd": { - source: "apache", - extensions: ["wmd"] - }, - "application/x-ms-wmz": { - source: "apache", - extensions: ["wmz"] - }, - "application/x-ms-xbap": { - source: "apache", - extensions: ["xbap"] - }, - "application/x-msaccess": { - source: "apache", - extensions: ["mdb"] - }, - "application/x-msbinder": { - source: "apache", - extensions: ["obd"] - }, - "application/x-mscardfile": { - source: "apache", - extensions: ["crd"] - }, - "application/x-msclip": { - source: "apache", - extensions: ["clp"] - }, - "application/x-msdos-program": { - extensions: ["exe"] - }, - "application/x-msdownload": { - source: "apache", - extensions: ["exe", "dll", "com", "bat", "msi"] - }, - "application/x-msmediaview": { - source: "apache", - extensions: ["mvb", "m13", "m14"] - }, - "application/x-msmetafile": { - source: "apache", - extensions: ["wmf", "wmz", "emf", "emz"] - }, - "application/x-msmoney": { - source: "apache", - extensions: ["mny"] - }, - "application/x-mspublisher": { - source: "apache", - extensions: ["pub"] - }, - "application/x-msschedule": { - source: "apache", - extensions: ["scd"] - }, - "application/x-msterminal": { - source: "apache", - extensions: ["trm"] - }, - "application/x-mswrite": { - source: "apache", - extensions: ["wri"] - }, - "application/x-netcdf": { - source: "apache", - extensions: ["nc", "cdf"] - }, - "application/x-ns-proxy-autoconfig": { - compressible: true, - extensions: ["pac"] - }, - "application/x-nzb": { - source: "apache", - extensions: ["nzb"] - }, - "application/x-perl": { - source: "nginx", - extensions: ["pl", "pm"] - }, - "application/x-pilot": { - source: "nginx", - extensions: ["prc", "pdb"] - }, - "application/x-pkcs12": { - source: "apache", - compressible: false, - extensions: ["p12", "pfx"] - }, - "application/x-pkcs7-certificates": { - source: "apache", - extensions: ["p7b", "spc"] - }, - "application/x-pkcs7-certreqresp": { - source: "apache", - extensions: ["p7r"] - }, - "application/x-pki-message": { - source: "iana" - }, - "application/x-rar-compressed": { - source: "apache", - compressible: false, - extensions: ["rar"] - }, - "application/x-redhat-package-manager": { - source: "nginx", - extensions: ["rpm"] - }, - "application/x-research-info-systems": { - source: "apache", - extensions: ["ris"] - }, - "application/x-sea": { - source: "nginx", - extensions: ["sea"] - }, - "application/x-sh": { - source: "apache", - compressible: true, - extensions: ["sh"] - }, - "application/x-shar": { - source: "apache", - extensions: ["shar"] - }, - "application/x-shockwave-flash": { - source: "apache", - compressible: false, - extensions: ["swf"] - }, - "application/x-silverlight-app": { - source: "apache", - extensions: ["xap"] - }, - "application/x-sql": { - source: "apache", - extensions: ["sql"] - }, - "application/x-stuffit": { - source: "apache", - compressible: false, - extensions: ["sit"] - }, - "application/x-stuffitx": { - source: "apache", - extensions: ["sitx"] - }, - "application/x-subrip": { - source: "apache", - extensions: ["srt"] - }, - "application/x-sv4cpio": { - source: "apache", - extensions: ["sv4cpio"] - }, - "application/x-sv4crc": { - source: "apache", - extensions: ["sv4crc"] - }, - "application/x-t3vm-image": { - source: "apache", - extensions: ["t3"] - }, - "application/x-tads": { - source: "apache", - extensions: ["gam"] - }, - "application/x-tar": { - source: "apache", - compressible: true, - extensions: ["tar"] - }, - "application/x-tcl": { - source: "apache", - extensions: ["tcl", "tk"] - }, - "application/x-tex": { - source: "apache", - extensions: ["tex"] - }, - "application/x-tex-tfm": { - source: "apache", - extensions: ["tfm"] - }, - "application/x-texinfo": { - source: "apache", - extensions: ["texinfo", "texi"] - }, - "application/x-tgif": { - source: "apache", - extensions: ["obj"] - }, - "application/x-ustar": { - source: "apache", - extensions: ["ustar"] - }, - "application/x-virtualbox-hdd": { - compressible: true, - extensions: ["hdd"] - }, - "application/x-virtualbox-ova": { - compressible: true, - extensions: ["ova"] - }, - "application/x-virtualbox-ovf": { - compressible: true, - extensions: ["ovf"] - }, - "application/x-virtualbox-vbox": { - compressible: true, - extensions: ["vbox"] - }, - "application/x-virtualbox-vbox-extpack": { - compressible: false, - extensions: ["vbox-extpack"] - }, - "application/x-virtualbox-vdi": { - compressible: true, - extensions: ["vdi"] - }, - "application/x-virtualbox-vhd": { - compressible: true, - extensions: ["vhd"] - }, - "application/x-virtualbox-vmdk": { - compressible: true, - extensions: ["vmdk"] - }, - "application/x-wais-source": { - source: "apache", - extensions: ["src"] - }, - "application/x-web-app-manifest+json": { - compressible: true, - extensions: ["webapp"] - }, - "application/x-www-form-urlencoded": { - source: "iana", - compressible: true - }, - "application/x-x509-ca-cert": { - source: "iana", - extensions: ["der", "crt", "pem"] - }, - "application/x-x509-ca-ra-cert": { - source: "iana" - }, - "application/x-x509-next-ca-cert": { - source: "iana" - }, - "application/x-xfig": { - source: "apache", - extensions: ["fig"] - }, - "application/x-xliff+xml": { - source: "apache", - compressible: true, - extensions: ["xlf"] - }, - "application/x-xpinstall": { - source: "apache", - compressible: false, - extensions: ["xpi"] - }, - "application/x-xz": { - source: "apache", - extensions: ["xz"] - }, - "application/x-zmachine": { - source: "apache", - extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"] - }, - "application/x400-bp": { - source: "iana" - }, - "application/xacml+xml": { - source: "iana", - compressible: true - }, - "application/xaml+xml": { - source: "apache", - compressible: true, - extensions: ["xaml"] - }, - "application/xcap-att+xml": { - source: "iana", - compressible: true, - extensions: ["xav"] - }, - "application/xcap-caps+xml": { - source: "iana", - compressible: true, - extensions: ["xca"] - }, - "application/xcap-diff+xml": { - source: "iana", - compressible: true, - extensions: ["xdf"] - }, - "application/xcap-el+xml": { - source: "iana", - compressible: true, - extensions: ["xel"] - }, - "application/xcap-error+xml": { - source: "iana", - compressible: true - }, - "application/xcap-ns+xml": { - source: "iana", - compressible: true, - extensions: ["xns"] - }, - "application/xcon-conference-info+xml": { - source: "iana", - compressible: true - }, - "application/xcon-conference-info-diff+xml": { - source: "iana", - compressible: true - }, - "application/xenc+xml": { - source: "iana", - compressible: true, - extensions: ["xenc"] - }, - "application/xhtml+xml": { - source: "iana", - compressible: true, - extensions: ["xhtml", "xht"] - }, - "application/xhtml-voice+xml": { - source: "apache", - compressible: true - }, - "application/xliff+xml": { - source: "iana", - compressible: true, - extensions: ["xlf"] - }, - "application/xml": { - source: "iana", - compressible: true, - extensions: ["xml", "xsl", "xsd", "rng"] - }, - "application/xml-dtd": { - source: "iana", - compressible: true, - extensions: ["dtd"] - }, - "application/xml-external-parsed-entity": { - source: "iana" - }, - "application/xml-patch+xml": { - source: "iana", - compressible: true - }, - "application/xmpp+xml": { - source: "iana", - compressible: true - }, - "application/xop+xml": { - source: "iana", - compressible: true, - extensions: ["xop"] - }, - "application/xproc+xml": { - source: "apache", - compressible: true, - extensions: ["xpl"] - }, - "application/xslt+xml": { - source: "iana", - compressible: true, - extensions: ["xsl", "xslt"] - }, - "application/xspf+xml": { - source: "apache", - compressible: true, - extensions: ["xspf"] - }, - "application/xv+xml": { - source: "iana", - compressible: true, - extensions: ["mxml", "xhvml", "xvml", "xvm"] - }, - "application/yang": { - source: "iana", - extensions: ["yang"] - }, - "application/yang-data+json": { - source: "iana", - compressible: true - }, - "application/yang-data+xml": { - source: "iana", - compressible: true - }, - "application/yang-patch+json": { - source: "iana", - compressible: true - }, - "application/yang-patch+xml": { - source: "iana", - compressible: true - }, - "application/yin+xml": { - source: "iana", - compressible: true, - extensions: ["yin"] - }, - "application/zip": { - source: "iana", - compressible: false, - extensions: ["zip"] - }, - "application/zlib": { - source: "iana" - }, - "application/zstd": { - source: "iana" - }, - "audio/1d-interleaved-parityfec": { - source: "iana" - }, - "audio/32kadpcm": { - source: "iana" - }, - "audio/3gpp": { - source: "iana", - compressible: false, - extensions: ["3gpp"] - }, - "audio/3gpp2": { - source: "iana" - }, - "audio/aac": { - source: "iana" - }, - "audio/ac3": { - source: "iana" - }, - "audio/adpcm": { - source: "apache", - extensions: ["adp"] - }, - "audio/amr": { - source: "iana", - extensions: ["amr"] - }, - "audio/amr-wb": { - source: "iana" - }, - "audio/amr-wb+": { - source: "iana" - }, - "audio/aptx": { - source: "iana" - }, - "audio/asc": { - source: "iana" - }, - "audio/atrac-advanced-lossless": { - source: "iana" - }, - "audio/atrac-x": { - source: "iana" - }, - "audio/atrac3": { - source: "iana" - }, - "audio/basic": { - source: "iana", - compressible: false, - extensions: ["au", "snd"] - }, - "audio/bv16": { - source: "iana" - }, - "audio/bv32": { - source: "iana" - }, - "audio/clearmode": { - source: "iana" - }, - "audio/cn": { - source: "iana" - }, - "audio/dat12": { - source: "iana" - }, - "audio/dls": { - source: "iana" - }, - "audio/dsr-es201108": { - source: "iana" - }, - "audio/dsr-es202050": { - source: "iana" - }, - "audio/dsr-es202211": { - source: "iana" - }, - "audio/dsr-es202212": { - source: "iana" - }, - "audio/dv": { - source: "iana" - }, - "audio/dvi4": { - source: "iana" - }, - "audio/eac3": { - source: "iana" - }, - "audio/encaprtp": { - source: "iana" - }, - "audio/evrc": { - source: "iana" - }, - "audio/evrc-qcp": { - source: "iana" - }, - "audio/evrc0": { - source: "iana" - }, - "audio/evrc1": { - source: "iana" - }, - "audio/evrcb": { - source: "iana" - }, - "audio/evrcb0": { - source: "iana" - }, - "audio/evrcb1": { - source: "iana" - }, - "audio/evrcnw": { - source: "iana" - }, - "audio/evrcnw0": { - source: "iana" - }, - "audio/evrcnw1": { - source: "iana" - }, - "audio/evrcwb": { - source: "iana" - }, - "audio/evrcwb0": { - source: "iana" - }, - "audio/evrcwb1": { - source: "iana" - }, - "audio/evs": { - source: "iana" - }, - "audio/flexfec": { - source: "iana" - }, - "audio/fwdred": { - source: "iana" - }, - "audio/g711-0": { - source: "iana" - }, - "audio/g719": { - source: "iana" - }, - "audio/g722": { - source: "iana" - }, - "audio/g7221": { - source: "iana" - }, - "audio/g723": { - source: "iana" - }, - "audio/g726-16": { - source: "iana" - }, - "audio/g726-24": { - source: "iana" - }, - "audio/g726-32": { - source: "iana" - }, - "audio/g726-40": { - source: "iana" - }, - "audio/g728": { - source: "iana" - }, - "audio/g729": { - source: "iana" - }, - "audio/g7291": { - source: "iana" - }, - "audio/g729d": { - source: "iana" - }, - "audio/g729e": { - source: "iana" - }, - "audio/gsm": { - source: "iana" - }, - "audio/gsm-efr": { - source: "iana" - }, - "audio/gsm-hr-08": { - source: "iana" - }, - "audio/ilbc": { - source: "iana" - }, - "audio/ip-mr_v2.5": { - source: "iana" - }, - "audio/isac": { - source: "apache" - }, - "audio/l16": { - source: "iana" - }, - "audio/l20": { - source: "iana" - }, - "audio/l24": { - source: "iana", - compressible: false - }, - "audio/l8": { - source: "iana" - }, - "audio/lpc": { - source: "iana" - }, - "audio/melp": { - source: "iana" - }, - "audio/melp1200": { - source: "iana" - }, - "audio/melp2400": { - source: "iana" - }, - "audio/melp600": { - source: "iana" - }, - "audio/mhas": { - source: "iana" - }, - "audio/midi": { - source: "apache", - extensions: ["mid", "midi", "kar", "rmi"] - }, - "audio/mobile-xmf": { - source: "iana", - extensions: ["mxmf"] - }, - "audio/mp3": { - compressible: false, - extensions: ["mp3"] - }, - "audio/mp4": { - source: "iana", - compressible: false, - extensions: ["m4a", "mp4a"] - }, - "audio/mp4a-latm": { - source: "iana" - }, - "audio/mpa": { - source: "iana" - }, - "audio/mpa-robust": { - source: "iana" - }, - "audio/mpeg": { - source: "iana", - compressible: false, - extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"] - }, - "audio/mpeg4-generic": { - source: "iana" - }, - "audio/musepack": { - source: "apache" - }, - "audio/ogg": { - source: "iana", - compressible: false, - extensions: ["oga", "ogg", "spx", "opus"] - }, - "audio/opus": { - source: "iana" - }, - "audio/parityfec": { - source: "iana" - }, - "audio/pcma": { - source: "iana" - }, - "audio/pcma-wb": { - source: "iana" - }, - "audio/pcmu": { - source: "iana" - }, - "audio/pcmu-wb": { - source: "iana" - }, - "audio/prs.sid": { - source: "iana" - }, - "audio/qcelp": { - source: "iana" - }, - "audio/raptorfec": { - source: "iana" - }, - "audio/red": { - source: "iana" - }, - "audio/rtp-enc-aescm128": { - source: "iana" - }, - "audio/rtp-midi": { - source: "iana" - }, - "audio/rtploopback": { - source: "iana" - }, - "audio/rtx": { - source: "iana" - }, - "audio/s3m": { - source: "apache", - extensions: ["s3m"] - }, - "audio/scip": { - source: "iana" - }, - "audio/silk": { - source: "apache", - extensions: ["sil"] - }, - "audio/smv": { - source: "iana" - }, - "audio/smv-qcp": { - source: "iana" - }, - "audio/smv0": { - source: "iana" - }, - "audio/sofa": { - source: "iana" - }, - "audio/sp-midi": { - source: "iana" - }, - "audio/speex": { - source: "iana" - }, - "audio/t140c": { - source: "iana" - }, - "audio/t38": { - source: "iana" - }, - "audio/telephone-event": { - source: "iana" - }, - "audio/tetra_acelp": { - source: "iana" - }, - "audio/tetra_acelp_bb": { - source: "iana" - }, - "audio/tone": { - source: "iana" - }, - "audio/tsvcis": { - source: "iana" - }, - "audio/uemclip": { - source: "iana" - }, - "audio/ulpfec": { - source: "iana" - }, - "audio/usac": { - source: "iana" - }, - "audio/vdvi": { - source: "iana" - }, - "audio/vmr-wb": { - source: "iana" - }, - "audio/vnd.3gpp.iufp": { - source: "iana" - }, - "audio/vnd.4sb": { - source: "iana" - }, - "audio/vnd.audiokoz": { - source: "iana" - }, - "audio/vnd.celp": { - source: "iana" - }, - "audio/vnd.cisco.nse": { - source: "iana" - }, - "audio/vnd.cmles.radio-events": { - source: "iana" - }, - "audio/vnd.cns.anp1": { - source: "iana" - }, - "audio/vnd.cns.inf1": { - source: "iana" - }, - "audio/vnd.dece.audio": { - source: "iana", - extensions: ["uva", "uvva"] - }, - "audio/vnd.digital-winds": { - source: "iana", - extensions: ["eol"] - }, - "audio/vnd.dlna.adts": { - source: "iana" - }, - "audio/vnd.dolby.heaac.1": { - source: "iana" - }, - "audio/vnd.dolby.heaac.2": { - source: "iana" - }, - "audio/vnd.dolby.mlp": { - source: "iana" - }, - "audio/vnd.dolby.mps": { - source: "iana" - }, - "audio/vnd.dolby.pl2": { - source: "iana" - }, - "audio/vnd.dolby.pl2x": { - source: "iana" - }, - "audio/vnd.dolby.pl2z": { - source: "iana" - }, - "audio/vnd.dolby.pulse.1": { - source: "iana" - }, - "audio/vnd.dra": { - source: "iana", - extensions: ["dra"] - }, - "audio/vnd.dts": { - source: "iana", - extensions: ["dts"] - }, - "audio/vnd.dts.hd": { - source: "iana", - extensions: ["dtshd"] - }, - "audio/vnd.dts.uhd": { - source: "iana" - }, - "audio/vnd.dvb.file": { - source: "iana" - }, - "audio/vnd.everad.plj": { - source: "iana" - }, - "audio/vnd.hns.audio": { - source: "iana" - }, - "audio/vnd.lucent.voice": { - source: "iana", - extensions: ["lvp"] - }, - "audio/vnd.ms-playready.media.pya": { - source: "iana", - extensions: ["pya"] - }, - "audio/vnd.nokia.mobile-xmf": { - source: "iana" - }, - "audio/vnd.nortel.vbk": { - source: "iana" - }, - "audio/vnd.nuera.ecelp4800": { - source: "iana", - extensions: ["ecelp4800"] - }, - "audio/vnd.nuera.ecelp7470": { - source: "iana", - extensions: ["ecelp7470"] - }, - "audio/vnd.nuera.ecelp9600": { - source: "iana", - extensions: ["ecelp9600"] - }, - "audio/vnd.octel.sbc": { - source: "iana" - }, - "audio/vnd.presonus.multitrack": { - source: "iana" - }, - "audio/vnd.qcelp": { - source: "iana" - }, - "audio/vnd.rhetorex.32kadpcm": { - source: "iana" - }, - "audio/vnd.rip": { - source: "iana", - extensions: ["rip"] - }, - "audio/vnd.rn-realaudio": { - compressible: false - }, - "audio/vnd.sealedmedia.softseal.mpeg": { - source: "iana" - }, - "audio/vnd.vmx.cvsd": { - source: "iana" - }, - "audio/vnd.wave": { - compressible: false - }, - "audio/vorbis": { - source: "iana", - compressible: false - }, - "audio/vorbis-config": { - source: "iana" - }, - "audio/wav": { - compressible: false, - extensions: ["wav"] - }, - "audio/wave": { - compressible: false, - extensions: ["wav"] - }, - "audio/webm": { - source: "apache", - compressible: false, - extensions: ["weba"] - }, - "audio/x-aac": { - source: "apache", - compressible: false, - extensions: ["aac"] - }, - "audio/x-aiff": { - source: "apache", - extensions: ["aif", "aiff", "aifc"] - }, - "audio/x-caf": { - source: "apache", - compressible: false, - extensions: ["caf"] - }, - "audio/x-flac": { - source: "apache", - extensions: ["flac"] - }, - "audio/x-m4a": { - source: "nginx", - extensions: ["m4a"] - }, - "audio/x-matroska": { - source: "apache", - extensions: ["mka"] - }, - "audio/x-mpegurl": { - source: "apache", - extensions: ["m3u"] - }, - "audio/x-ms-wax": { - source: "apache", - extensions: ["wax"] - }, - "audio/x-ms-wma": { - source: "apache", - extensions: ["wma"] - }, - "audio/x-pn-realaudio": { - source: "apache", - extensions: ["ram", "ra"] - }, - "audio/x-pn-realaudio-plugin": { - source: "apache", - extensions: ["rmp"] - }, - "audio/x-realaudio": { - source: "nginx", - extensions: ["ra"] - }, - "audio/x-tta": { - source: "apache" - }, - "audio/x-wav": { - source: "apache", - extensions: ["wav"] - }, - "audio/xm": { - source: "apache", - extensions: ["xm"] - }, - "chemical/x-cdx": { - source: "apache", - extensions: ["cdx"] - }, - "chemical/x-cif": { - source: "apache", - extensions: ["cif"] - }, - "chemical/x-cmdf": { - source: "apache", - extensions: ["cmdf"] - }, - "chemical/x-cml": { - source: "apache", - extensions: ["cml"] - }, - "chemical/x-csml": { - source: "apache", - extensions: ["csml"] - }, - "chemical/x-pdb": { - source: "apache" - }, - "chemical/x-xyz": { - source: "apache", - extensions: ["xyz"] - }, - "font/collection": { - source: "iana", - extensions: ["ttc"] - }, - "font/otf": { - source: "iana", - compressible: true, - extensions: ["otf"] - }, - "font/sfnt": { - source: "iana" - }, - "font/ttf": { - source: "iana", - compressible: true, - extensions: ["ttf"] - }, - "font/woff": { - source: "iana", - extensions: ["woff"] - }, - "font/woff2": { - source: "iana", - extensions: ["woff2"] - }, - "image/aces": { - source: "iana", - extensions: ["exr"] - }, - "image/apng": { - compressible: false, - extensions: ["apng"] - }, - "image/avci": { - source: "iana", - extensions: ["avci"] - }, - "image/avcs": { - source: "iana", - extensions: ["avcs"] - }, - "image/avif": { - source: "iana", - compressible: false, - extensions: ["avif"] - }, - "image/bmp": { - source: "iana", - compressible: true, - extensions: ["bmp"] - }, - "image/cgm": { - source: "iana", - extensions: ["cgm"] - }, - "image/dicom-rle": { - source: "iana", - extensions: ["drle"] - }, - "image/emf": { - source: "iana", - extensions: ["emf"] - }, - "image/fits": { - source: "iana", - extensions: ["fits"] - }, - "image/g3fax": { - source: "iana", - extensions: ["g3"] - }, - "image/gif": { - source: "iana", - compressible: false, - extensions: ["gif"] - }, - "image/heic": { - source: "iana", - extensions: ["heic"] - }, - "image/heic-sequence": { - source: "iana", - extensions: ["heics"] - }, - "image/heif": { - source: "iana", - extensions: ["heif"] - }, - "image/heif-sequence": { - source: "iana", - extensions: ["heifs"] - }, - "image/hej2k": { - source: "iana", - extensions: ["hej2"] - }, - "image/hsj2": { - source: "iana", - extensions: ["hsj2"] - }, - "image/ief": { - source: "iana", - extensions: ["ief"] - }, - "image/jls": { - source: "iana", - extensions: ["jls"] - }, - "image/jp2": { - source: "iana", - compressible: false, - extensions: ["jp2", "jpg2"] - }, - "image/jpeg": { - source: "iana", - compressible: false, - extensions: ["jpeg", "jpg", "jpe"] - }, - "image/jph": { - source: "iana", - extensions: ["jph"] - }, - "image/jphc": { - source: "iana", - extensions: ["jhc"] - }, - "image/jpm": { - source: "iana", - compressible: false, - extensions: ["jpm"] - }, - "image/jpx": { - source: "iana", - compressible: false, - extensions: ["jpx", "jpf"] - }, - "image/jxr": { - source: "iana", - extensions: ["jxr"] - }, - "image/jxra": { - source: "iana", - extensions: ["jxra"] - }, - "image/jxrs": { - source: "iana", - extensions: ["jxrs"] - }, - "image/jxs": { - source: "iana", - extensions: ["jxs"] - }, - "image/jxsc": { - source: "iana", - extensions: ["jxsc"] - }, - "image/jxsi": { - source: "iana", - extensions: ["jxsi"] - }, - "image/jxss": { - source: "iana", - extensions: ["jxss"] - }, - "image/ktx": { - source: "iana", - extensions: ["ktx"] - }, - "image/ktx2": { - source: "iana", - extensions: ["ktx2"] - }, - "image/naplps": { - source: "iana" - }, - "image/pjpeg": { - compressible: false - }, - "image/png": { - source: "iana", - compressible: false, - extensions: ["png"] - }, - "image/prs.btif": { - source: "iana", - extensions: ["btif"] - }, - "image/prs.pti": { - source: "iana", - extensions: ["pti"] - }, - "image/pwg-raster": { - source: "iana" - }, - "image/sgi": { - source: "apache", - extensions: ["sgi"] - }, - "image/svg+xml": { - source: "iana", - compressible: true, - extensions: ["svg", "svgz"] - }, - "image/t38": { - source: "iana", - extensions: ["t38"] - }, - "image/tiff": { - source: "iana", - compressible: false, - extensions: ["tif", "tiff"] - }, - "image/tiff-fx": { - source: "iana", - extensions: ["tfx"] - }, - "image/vnd.adobe.photoshop": { - source: "iana", - compressible: true, - extensions: ["psd"] - }, - "image/vnd.airzip.accelerator.azv": { - source: "iana", - extensions: ["azv"] - }, - "image/vnd.cns.inf2": { - source: "iana" - }, - "image/vnd.dece.graphic": { - source: "iana", - extensions: ["uvi", "uvvi", "uvg", "uvvg"] - }, - "image/vnd.djvu": { - source: "iana", - extensions: ["djvu", "djv"] - }, - "image/vnd.dvb.subtitle": { - source: "iana", - extensions: ["sub"] - }, - "image/vnd.dwg": { - source: "iana", - extensions: ["dwg"] - }, - "image/vnd.dxf": { - source: "iana", - extensions: ["dxf"] - }, - "image/vnd.fastbidsheet": { - source: "iana", - extensions: ["fbs"] - }, - "image/vnd.fpx": { - source: "iana", - extensions: ["fpx"] - }, - "image/vnd.fst": { - source: "iana", - extensions: ["fst"] - }, - "image/vnd.fujixerox.edmics-mmr": { - source: "iana", - extensions: ["mmr"] - }, - "image/vnd.fujixerox.edmics-rlc": { - source: "iana", - extensions: ["rlc"] - }, - "image/vnd.globalgraphics.pgb": { - source: "iana" - }, - "image/vnd.microsoft.icon": { - source: "iana", - compressible: true, - extensions: ["ico"] - }, - "image/vnd.mix": { - source: "iana" - }, - "image/vnd.mozilla.apng": { - source: "iana" - }, - "image/vnd.ms-dds": { - compressible: true, - extensions: ["dds"] - }, - "image/vnd.ms-modi": { - source: "iana", - extensions: ["mdi"] - }, - "image/vnd.ms-photo": { - source: "apache", - extensions: ["wdp"] - }, - "image/vnd.net-fpx": { - source: "iana", - extensions: ["npx"] - }, - "image/vnd.pco.b16": { - source: "iana", - extensions: ["b16"] - }, - "image/vnd.radiance": { - source: "iana" - }, - "image/vnd.sealed.png": { - source: "iana" - }, - "image/vnd.sealedmedia.softseal.gif": { - source: "iana" - }, - "image/vnd.sealedmedia.softseal.jpg": { - source: "iana" - }, - "image/vnd.svf": { - source: "iana" - }, - "image/vnd.tencent.tap": { - source: "iana", - extensions: ["tap"] - }, - "image/vnd.valve.source.texture": { - source: "iana", - extensions: ["vtf"] - }, - "image/vnd.wap.wbmp": { - source: "iana", - extensions: ["wbmp"] - }, - "image/vnd.xiff": { - source: "iana", - extensions: ["xif"] - }, - "image/vnd.zbrush.pcx": { - source: "iana", - extensions: ["pcx"] - }, - "image/webp": { - source: "apache", - extensions: ["webp"] - }, - "image/wmf": { - source: "iana", - extensions: ["wmf"] - }, - "image/x-3ds": { - source: "apache", - extensions: ["3ds"] - }, - "image/x-cmu-raster": { - source: "apache", - extensions: ["ras"] - }, - "image/x-cmx": { - source: "apache", - extensions: ["cmx"] - }, - "image/x-freehand": { - source: "apache", - extensions: ["fh", "fhc", "fh4", "fh5", "fh7"] - }, - "image/x-icon": { - source: "apache", - compressible: true, - extensions: ["ico"] - }, - "image/x-jng": { - source: "nginx", - extensions: ["jng"] - }, - "image/x-mrsid-image": { - source: "apache", - extensions: ["sid"] - }, - "image/x-ms-bmp": { - source: "nginx", - compressible: true, - extensions: ["bmp"] - }, - "image/x-pcx": { - source: "apache", - extensions: ["pcx"] - }, - "image/x-pict": { - source: "apache", - extensions: ["pic", "pct"] - }, - "image/x-portable-anymap": { - source: "apache", - extensions: ["pnm"] - }, - "image/x-portable-bitmap": { - source: "apache", - extensions: ["pbm"] - }, - "image/x-portable-graymap": { - source: "apache", - extensions: ["pgm"] - }, - "image/x-portable-pixmap": { - source: "apache", - extensions: ["ppm"] - }, - "image/x-rgb": { - source: "apache", - extensions: ["rgb"] - }, - "image/x-tga": { - source: "apache", - extensions: ["tga"] - }, - "image/x-xbitmap": { - source: "apache", - extensions: ["xbm"] - }, - "image/x-xcf": { - compressible: false - }, - "image/x-xpixmap": { - source: "apache", - extensions: ["xpm"] - }, - "image/x-xwindowdump": { - source: "apache", - extensions: ["xwd"] - }, - "message/cpim": { - source: "iana" - }, - "message/delivery-status": { - source: "iana" - }, - "message/disposition-notification": { - source: "iana", - extensions: [ - "disposition-notification" - ] - }, - "message/external-body": { - source: "iana" - }, - "message/feedback-report": { - source: "iana" - }, - "message/global": { - source: "iana", - extensions: ["u8msg"] - }, - "message/global-delivery-status": { - source: "iana", - extensions: ["u8dsn"] - }, - "message/global-disposition-notification": { - source: "iana", - extensions: ["u8mdn"] - }, - "message/global-headers": { - source: "iana", - extensions: ["u8hdr"] - }, - "message/http": { - source: "iana", - compressible: false - }, - "message/imdn+xml": { - source: "iana", - compressible: true - }, - "message/news": { - source: "iana" - }, - "message/partial": { - source: "iana", - compressible: false - }, - "message/rfc822": { - source: "iana", - compressible: true, - extensions: ["eml", "mime"] - }, - "message/s-http": { - source: "iana" - }, - "message/sip": { - source: "iana" - }, - "message/sipfrag": { - source: "iana" - }, - "message/tracking-status": { - source: "iana" - }, - "message/vnd.si.simp": { - source: "iana" - }, - "message/vnd.wfa.wsc": { - source: "iana", - extensions: ["wsc"] - }, - "model/3mf": { - source: "iana", - extensions: ["3mf"] - }, - "model/e57": { - source: "iana" - }, - "model/gltf+json": { - source: "iana", - compressible: true, - extensions: ["gltf"] - }, - "model/gltf-binary": { - source: "iana", - compressible: true, - extensions: ["glb"] - }, - "model/iges": { - source: "iana", - compressible: false, - extensions: ["igs", "iges"] - }, - "model/mesh": { - source: "iana", - compressible: false, - extensions: ["msh", "mesh", "silo"] - }, - "model/mtl": { - source: "iana", - extensions: ["mtl"] - }, - "model/obj": { - source: "iana", - extensions: ["obj"] - }, - "model/step": { - source: "iana" - }, - "model/step+xml": { - source: "iana", - compressible: true, - extensions: ["stpx"] - }, - "model/step+zip": { - source: "iana", - compressible: false, - extensions: ["stpz"] - }, - "model/step-xml+zip": { - source: "iana", - compressible: false, - extensions: ["stpxz"] - }, - "model/stl": { - source: "iana", - extensions: ["stl"] - }, - "model/vnd.collada+xml": { - source: "iana", - compressible: true, - extensions: ["dae"] - }, - "model/vnd.dwf": { - source: "iana", - extensions: ["dwf"] - }, - "model/vnd.flatland.3dml": { - source: "iana" - }, - "model/vnd.gdl": { - source: "iana", - extensions: ["gdl"] - }, - "model/vnd.gs-gdl": { - source: "apache" - }, - "model/vnd.gs.gdl": { - source: "iana" - }, - "model/vnd.gtw": { - source: "iana", - extensions: ["gtw"] - }, - "model/vnd.moml+xml": { - source: "iana", - compressible: true - }, - "model/vnd.mts": { - source: "iana", - extensions: ["mts"] - }, - "model/vnd.opengex": { - source: "iana", - extensions: ["ogex"] - }, - "model/vnd.parasolid.transmit.binary": { - source: "iana", - extensions: ["x_b"] - }, - "model/vnd.parasolid.transmit.text": { - source: "iana", - extensions: ["x_t"] - }, - "model/vnd.pytha.pyox": { - source: "iana" - }, - "model/vnd.rosette.annotated-data-model": { - source: "iana" - }, - "model/vnd.sap.vds": { - source: "iana", - extensions: ["vds"] - }, - "model/vnd.usdz+zip": { - source: "iana", - compressible: false, - extensions: ["usdz"] - }, - "model/vnd.valve.source.compiled-map": { - source: "iana", - extensions: ["bsp"] - }, - "model/vnd.vtu": { - source: "iana", - extensions: ["vtu"] - }, - "model/vrml": { - source: "iana", - compressible: false, - extensions: ["wrl", "vrml"] - }, - "model/x3d+binary": { - source: "apache", - compressible: false, - extensions: ["x3db", "x3dbz"] - }, - "model/x3d+fastinfoset": { - source: "iana", - extensions: ["x3db"] - }, - "model/x3d+vrml": { - source: "apache", - compressible: false, - extensions: ["x3dv", "x3dvz"] - }, - "model/x3d+xml": { - source: "iana", - compressible: true, - extensions: ["x3d", "x3dz"] - }, - "model/x3d-vrml": { - source: "iana", - extensions: ["x3dv"] - }, - "multipart/alternative": { - source: "iana", - compressible: false - }, - "multipart/appledouble": { - source: "iana" - }, - "multipart/byteranges": { - source: "iana" - }, - "multipart/digest": { - source: "iana" - }, - "multipart/encrypted": { - source: "iana", - compressible: false - }, - "multipart/form-data": { - source: "iana", - compressible: false - }, - "multipart/header-set": { - source: "iana" - }, - "multipart/mixed": { - source: "iana" - }, - "multipart/multilingual": { - source: "iana" - }, - "multipart/parallel": { - source: "iana" - }, - "multipart/related": { - source: "iana", - compressible: false - }, - "multipart/report": { - source: "iana" - }, - "multipart/signed": { - source: "iana", - compressible: false - }, - "multipart/vnd.bint.med-plus": { - source: "iana" - }, - "multipart/voice-message": { - source: "iana" - }, - "multipart/x-mixed-replace": { - source: "iana" - }, - "text/1d-interleaved-parityfec": { - source: "iana" - }, - "text/cache-manifest": { - source: "iana", - compressible: true, - extensions: ["appcache", "manifest"] - }, - "text/calendar": { - source: "iana", - extensions: ["ics", "ifb"] - }, - "text/calender": { - compressible: true - }, - "text/cmd": { - compressible: true - }, - "text/coffeescript": { - extensions: ["coffee", "litcoffee"] - }, - "text/cql": { - source: "iana" - }, - "text/cql-expression": { - source: "iana" - }, - "text/cql-identifier": { - source: "iana" - }, - "text/css": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["css"] - }, - "text/csv": { - source: "iana", - compressible: true, - extensions: ["csv"] - }, - "text/csv-schema": { - source: "iana" - }, - "text/directory": { - source: "iana" - }, - "text/dns": { - source: "iana" - }, - "text/ecmascript": { - source: "iana" - }, - "text/encaprtp": { - source: "iana" - }, - "text/enriched": { - source: "iana" - }, - "text/fhirpath": { - source: "iana" - }, - "text/flexfec": { - source: "iana" - }, - "text/fwdred": { - source: "iana" - }, - "text/gff3": { - source: "iana" - }, - "text/grammar-ref-list": { - source: "iana" - }, - "text/html": { - source: "iana", - compressible: true, - extensions: ["html", "htm", "shtml"] - }, - "text/jade": { - extensions: ["jade"] - }, - "text/javascript": { - source: "iana", - compressible: true - }, - "text/jcr-cnd": { - source: "iana" - }, - "text/jsx": { - compressible: true, - extensions: ["jsx"] - }, - "text/less": { - compressible: true, - extensions: ["less"] - }, - "text/markdown": { - source: "iana", - compressible: true, - extensions: ["markdown", "md"] - }, - "text/mathml": { - source: "nginx", - extensions: ["mml"] - }, - "text/mdx": { - compressible: true, - extensions: ["mdx"] - }, - "text/mizar": { - source: "iana" - }, - "text/n3": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["n3"] - }, - "text/parameters": { - source: "iana", - charset: "UTF-8" - }, - "text/parityfec": { - source: "iana" - }, - "text/plain": { - source: "iana", - compressible: true, - extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"] - }, - "text/provenance-notation": { - source: "iana", - charset: "UTF-8" - }, - "text/prs.fallenstein.rst": { - source: "iana" - }, - "text/prs.lines.tag": { - source: "iana", - extensions: ["dsc"] - }, - "text/prs.prop.logic": { - source: "iana" - }, - "text/raptorfec": { - source: "iana" - }, - "text/red": { - source: "iana" - }, - "text/rfc822-headers": { - source: "iana" - }, - "text/richtext": { - source: "iana", - compressible: true, - extensions: ["rtx"] - }, - "text/rtf": { - source: "iana", - compressible: true, - extensions: ["rtf"] - }, - "text/rtp-enc-aescm128": { - source: "iana" - }, - "text/rtploopback": { - source: "iana" - }, - "text/rtx": { - source: "iana" - }, - "text/sgml": { - source: "iana", - extensions: ["sgml", "sgm"] - }, - "text/shaclc": { - source: "iana" - }, - "text/shex": { - source: "iana", - extensions: ["shex"] - }, - "text/slim": { - extensions: ["slim", "slm"] - }, - "text/spdx": { - source: "iana", - extensions: ["spdx"] - }, - "text/strings": { - source: "iana" - }, - "text/stylus": { - extensions: ["stylus", "styl"] - }, - "text/t140": { - source: "iana" - }, - "text/tab-separated-values": { - source: "iana", - compressible: true, - extensions: ["tsv"] - }, - "text/troff": { - source: "iana", - extensions: ["t", "tr", "roff", "man", "me", "ms"] - }, - "text/turtle": { - source: "iana", - charset: "UTF-8", - extensions: ["ttl"] - }, - "text/ulpfec": { - source: "iana" - }, - "text/uri-list": { - source: "iana", - compressible: true, - extensions: ["uri", "uris", "urls"] - }, - "text/vcard": { - source: "iana", - compressible: true, - extensions: ["vcard"] - }, - "text/vnd.a": { - source: "iana" - }, - "text/vnd.abc": { - source: "iana" - }, - "text/vnd.ascii-art": { - source: "iana" - }, - "text/vnd.curl": { - source: "iana", - extensions: ["curl"] - }, - "text/vnd.curl.dcurl": { - source: "apache", - extensions: ["dcurl"] - }, - "text/vnd.curl.mcurl": { - source: "apache", - extensions: ["mcurl"] - }, - "text/vnd.curl.scurl": { - source: "apache", - extensions: ["scurl"] - }, - "text/vnd.debian.copyright": { - source: "iana", - charset: "UTF-8" - }, - "text/vnd.dmclientscript": { - source: "iana" - }, - "text/vnd.dvb.subtitle": { - source: "iana", - extensions: ["sub"] - }, - "text/vnd.esmertec.theme-descriptor": { - source: "iana", - charset: "UTF-8" - }, - "text/vnd.familysearch.gedcom": { - source: "iana", - extensions: ["ged"] - }, - "text/vnd.ficlab.flt": { - source: "iana" - }, - "text/vnd.fly": { - source: "iana", - extensions: ["fly"] - }, - "text/vnd.fmi.flexstor": { - source: "iana", - extensions: ["flx"] - }, - "text/vnd.gml": { - source: "iana" - }, - "text/vnd.graphviz": { - source: "iana", - extensions: ["gv"] - }, - "text/vnd.hans": { - source: "iana" - }, - "text/vnd.hgl": { - source: "iana" - }, - "text/vnd.in3d.3dml": { - source: "iana", - extensions: ["3dml"] - }, - "text/vnd.in3d.spot": { - source: "iana", - extensions: ["spot"] - }, - "text/vnd.iptc.newsml": { - source: "iana" - }, - "text/vnd.iptc.nitf": { - source: "iana" - }, - "text/vnd.latex-z": { - source: "iana" - }, - "text/vnd.motorola.reflex": { - source: "iana" - }, - "text/vnd.ms-mediapackage": { - source: "iana" - }, - "text/vnd.net2phone.commcenter.command": { - source: "iana" - }, - "text/vnd.radisys.msml-basic-layout": { - source: "iana" - }, - "text/vnd.senx.warpscript": { - source: "iana" - }, - "text/vnd.si.uricatalogue": { - source: "iana" - }, - "text/vnd.sosi": { - source: "iana" - }, - "text/vnd.sun.j2me.app-descriptor": { - source: "iana", - charset: "UTF-8", - extensions: ["jad"] - }, - "text/vnd.trolltech.linguist": { - source: "iana", - charset: "UTF-8" - }, - "text/vnd.wap.si": { - source: "iana" - }, - "text/vnd.wap.sl": { - source: "iana" - }, - "text/vnd.wap.wml": { - source: "iana", - extensions: ["wml"] - }, - "text/vnd.wap.wmlscript": { - source: "iana", - extensions: ["wmls"] - }, - "text/vtt": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["vtt"] - }, - "text/x-asm": { - source: "apache", - extensions: ["s", "asm"] - }, - "text/x-c": { - source: "apache", - extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"] - }, - "text/x-component": { - source: "nginx", - extensions: ["htc"] - }, - "text/x-fortran": { - source: "apache", - extensions: ["f", "for", "f77", "f90"] - }, - "text/x-gwt-rpc": { - compressible: true - }, - "text/x-handlebars-template": { - extensions: ["hbs"] - }, - "text/x-java-source": { - source: "apache", - extensions: ["java"] - }, - "text/x-jquery-tmpl": { - compressible: true - }, - "text/x-lua": { - extensions: ["lua"] - }, - "text/x-markdown": { - compressible: true, - extensions: ["mkd"] - }, - "text/x-nfo": { - source: "apache", - extensions: ["nfo"] - }, - "text/x-opml": { - source: "apache", - extensions: ["opml"] - }, - "text/x-org": { - compressible: true, - extensions: ["org"] - }, - "text/x-pascal": { - source: "apache", - extensions: ["p", "pas"] - }, - "text/x-processing": { - compressible: true, - extensions: ["pde"] - }, - "text/x-sass": { - extensions: ["sass"] - }, - "text/x-scss": { - extensions: ["scss"] - }, - "text/x-setext": { - source: "apache", - extensions: ["etx"] - }, - "text/x-sfv": { - source: "apache", - extensions: ["sfv"] - }, - "text/x-suse-ymp": { - compressible: true, - extensions: ["ymp"] - }, - "text/x-uuencode": { - source: "apache", - extensions: ["uu"] - }, - "text/x-vcalendar": { - source: "apache", - extensions: ["vcs"] - }, - "text/x-vcard": { - source: "apache", - extensions: ["vcf"] - }, - "text/xml": { - source: "iana", - compressible: true, - extensions: ["xml"] - }, - "text/xml-external-parsed-entity": { - source: "iana" - }, - "text/yaml": { - compressible: true, - extensions: ["yaml", "yml"] - }, - "video/1d-interleaved-parityfec": { - source: "iana" - }, - "video/3gpp": { - source: "iana", - extensions: ["3gp", "3gpp"] - }, - "video/3gpp-tt": { - source: "iana" - }, - "video/3gpp2": { - source: "iana", - extensions: ["3g2"] - }, - "video/av1": { - source: "iana" - }, - "video/bmpeg": { - source: "iana" - }, - "video/bt656": { - source: "iana" - }, - "video/celb": { - source: "iana" - }, - "video/dv": { - source: "iana" - }, - "video/encaprtp": { - source: "iana" - }, - "video/ffv1": { - source: "iana" - }, - "video/flexfec": { - source: "iana" - }, - "video/h261": { - source: "iana", - extensions: ["h261"] - }, - "video/h263": { - source: "iana", - extensions: ["h263"] - }, - "video/h263-1998": { - source: "iana" - }, - "video/h263-2000": { - source: "iana" - }, - "video/h264": { - source: "iana", - extensions: ["h264"] - }, - "video/h264-rcdo": { - source: "iana" - }, - "video/h264-svc": { - source: "iana" - }, - "video/h265": { - source: "iana" - }, - "video/iso.segment": { - source: "iana", - extensions: ["m4s"] - }, - "video/jpeg": { - source: "iana", - extensions: ["jpgv"] - }, - "video/jpeg2000": { - source: "iana" - }, - "video/jpm": { - source: "apache", - extensions: ["jpm", "jpgm"] - }, - "video/jxsv": { - source: "iana" - }, - "video/mj2": { - source: "iana", - extensions: ["mj2", "mjp2"] - }, - "video/mp1s": { - source: "iana" - }, - "video/mp2p": { - source: "iana" - }, - "video/mp2t": { - source: "iana", - extensions: ["ts"] - }, - "video/mp4": { - source: "iana", - compressible: false, - extensions: ["mp4", "mp4v", "mpg4"] - }, - "video/mp4v-es": { - source: "iana" - }, - "video/mpeg": { - source: "iana", - compressible: false, - extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"] - }, - "video/mpeg4-generic": { - source: "iana" - }, - "video/mpv": { - source: "iana" - }, - "video/nv": { - source: "iana" - }, - "video/ogg": { - source: "iana", - compressible: false, - extensions: ["ogv"] - }, - "video/parityfec": { - source: "iana" - }, - "video/pointer": { - source: "iana" - }, - "video/quicktime": { - source: "iana", - compressible: false, - extensions: ["qt", "mov"] - }, - "video/raptorfec": { - source: "iana" - }, - "video/raw": { - source: "iana" - }, - "video/rtp-enc-aescm128": { - source: "iana" - }, - "video/rtploopback": { - source: "iana" - }, - "video/rtx": { - source: "iana" - }, - "video/scip": { - source: "iana" - }, - "video/smpte291": { - source: "iana" - }, - "video/smpte292m": { - source: "iana" - }, - "video/ulpfec": { - source: "iana" - }, - "video/vc1": { - source: "iana" - }, - "video/vc2": { - source: "iana" - }, - "video/vnd.cctv": { - source: "iana" - }, - "video/vnd.dece.hd": { - source: "iana", - extensions: ["uvh", "uvvh"] - }, - "video/vnd.dece.mobile": { - source: "iana", - extensions: ["uvm", "uvvm"] - }, - "video/vnd.dece.mp4": { - source: "iana" - }, - "video/vnd.dece.pd": { - source: "iana", - extensions: ["uvp", "uvvp"] - }, - "video/vnd.dece.sd": { - source: "iana", - extensions: ["uvs", "uvvs"] - }, - "video/vnd.dece.video": { - source: "iana", - extensions: ["uvv", "uvvv"] - }, - "video/vnd.directv.mpeg": { - source: "iana" - }, - "video/vnd.directv.mpeg-tts": { - source: "iana" - }, - "video/vnd.dlna.mpeg-tts": { - source: "iana" - }, - "video/vnd.dvb.file": { - source: "iana", - extensions: ["dvb"] - }, - "video/vnd.fvt": { - source: "iana", - extensions: ["fvt"] - }, - "video/vnd.hns.video": { - source: "iana" - }, - "video/vnd.iptvforum.1dparityfec-1010": { - source: "iana" - }, - "video/vnd.iptvforum.1dparityfec-2005": { - source: "iana" - }, - "video/vnd.iptvforum.2dparityfec-1010": { - source: "iana" - }, - "video/vnd.iptvforum.2dparityfec-2005": { - source: "iana" - }, - "video/vnd.iptvforum.ttsavc": { - source: "iana" - }, - "video/vnd.iptvforum.ttsmpeg2": { - source: "iana" - }, - "video/vnd.motorola.video": { - source: "iana" - }, - "video/vnd.motorola.videop": { - source: "iana" - }, - "video/vnd.mpegurl": { - source: "iana", - extensions: ["mxu", "m4u"] - }, - "video/vnd.ms-playready.media.pyv": { - source: "iana", - extensions: ["pyv"] - }, - "video/vnd.nokia.interleaved-multimedia": { - source: "iana" - }, - "video/vnd.nokia.mp4vr": { - source: "iana" - }, - "video/vnd.nokia.videovoip": { - source: "iana" - }, - "video/vnd.objectvideo": { - source: "iana" - }, - "video/vnd.radgamettools.bink": { - source: "iana" - }, - "video/vnd.radgamettools.smacker": { - source: "iana" - }, - "video/vnd.sealed.mpeg1": { - source: "iana" - }, - "video/vnd.sealed.mpeg4": { - source: "iana" - }, - "video/vnd.sealed.swf": { - source: "iana" - }, - "video/vnd.sealedmedia.softseal.mov": { - source: "iana" - }, - "video/vnd.uvvu.mp4": { - source: "iana", - extensions: ["uvu", "uvvu"] - }, - "video/vnd.vivo": { - source: "iana", - extensions: ["viv"] - }, - "video/vnd.youtube.yt": { - source: "iana" - }, - "video/vp8": { - source: "iana" - }, - "video/vp9": { - source: "iana" - }, - "video/webm": { - source: "apache", - compressible: false, - extensions: ["webm"] - }, - "video/x-f4v": { - source: "apache", - extensions: ["f4v"] - }, - "video/x-fli": { - source: "apache", - extensions: ["fli"] - }, - "video/x-flv": { - source: "apache", - compressible: false, - extensions: ["flv"] - }, - "video/x-m4v": { - source: "apache", - extensions: ["m4v"] - }, - "video/x-matroska": { - source: "apache", - compressible: false, - extensions: ["mkv", "mk3d", "mks"] - }, - "video/x-mng": { - source: "apache", - extensions: ["mng"] - }, - "video/x-ms-asf": { - source: "apache", - extensions: ["asf", "asx"] - }, - "video/x-ms-vob": { - source: "apache", - extensions: ["vob"] - }, - "video/x-ms-wm": { - source: "apache", - extensions: ["wm"] - }, - "video/x-ms-wmv": { - source: "apache", - compressible: false, - extensions: ["wmv"] +// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-match-kind.js +var require_internal_match_kind = __commonJS({ + "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-match-kind.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MatchKind = void 0; + var MatchKind; + (function(MatchKind2) { + MatchKind2[MatchKind2["None"] = 0] = "None"; + MatchKind2[MatchKind2["Directory"] = 1] = "Directory"; + MatchKind2[MatchKind2["File"] = 2] = "File"; + MatchKind2[MatchKind2["All"] = 3] = "All"; + })(MatchKind = exports.MatchKind || (exports.MatchKind = {})); + } +}); + +// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js +var require_internal_pattern_helper = __commonJS({ + "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.partialMatch = exports.match = exports.getSearchPaths = void 0; + var pathHelper = __importStar(require_internal_path_helper()); + var internal_match_kind_1 = require_internal_match_kind(); + var IS_WINDOWS = process.platform === "win32"; + function getSearchPaths(patterns) { + patterns = patterns.filter((x2) => !x2.negate); + const searchPathMap = {}; + for (const pattern of patterns) { + const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; + searchPathMap[key] = "candidate"; + } + const result = []; + for (const pattern of patterns) { + const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; + if (searchPathMap[key] === "included") { + continue; + } + let foundAncestor = false; + let tempKey = key; + let parent = pathHelper.dirname(tempKey); + while (parent !== tempKey) { + if (searchPathMap[parent]) { + foundAncestor = true; + break; + } + tempKey = parent; + parent = pathHelper.dirname(tempKey); + } + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = "included"; + } + } + return result; + } + exports.getSearchPaths = getSearchPaths; + function match(patterns, itemPath) { + let result = internal_match_kind_1.MatchKind.None; + for (const pattern of patterns) { + if (pattern.negate) { + result &= ~pattern.match(itemPath); + } else { + result |= pattern.match(itemPath); + } + } + return result; + } + exports.match = match; + function partialMatch(patterns, itemPath) { + return patterns.some((x2) => !x2.negate && x2.partialMatch(itemPath)); + } + exports.partialMatch = partialMatch; + } +}); + +// node_modules/concat-map/index.js +var require_concat_map = __commonJS({ + "node_modules/concat-map/index.js"(exports, module) { + module.exports = function(xs, fn2) { + var res = []; + for (var i2 = 0; i2 < xs.length; i2++) { + var x2 = fn2(xs[i2], i2); + if (isArray(x2)) + res.push.apply(res, x2); + else + res.push(x2); + } + return res; + }; + var isArray = Array.isArray || function(xs) { + return Object.prototype.toString.call(xs) === "[object Array]"; + }; + } +}); + +// node_modules/balanced-match/index.js +var require_balanced_match = __commonJS({ + "node_modules/balanced-match/index.js"(exports, module) { + "use strict"; + module.exports = balanced; + function balanced(a2, b2, str) { + if (a2 instanceof RegExp) + a2 = maybeMatch(a2, str); + if (b2 instanceof RegExp) + b2 = maybeMatch(b2, str); + var r2 = range2(a2, b2, str); + return r2 && { + start: r2[0], + end: r2[1], + pre: str.slice(0, r2[0]), + body: str.slice(r2[0] + a2.length, r2[1]), + post: str.slice(r2[1] + b2.length) + }; + } + function maybeMatch(reg, str) { + var m3 = str.match(reg); + return m3 ? m3[0] : null; + } + balanced.range = range2; + function range2(a2, b2, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a2); + var bi = str.indexOf(b2, ai + 1); + var i2 = ai; + if (ai >= 0 && bi > 0) { + if (a2 === b2) { + return [ai, bi]; + } + begs = []; + left = str.length; + while (i2 >= 0 && !result) { + if (i2 == ai) { + begs.push(i2); + ai = str.indexOf(a2, i2 + 1); + } else if (begs.length == 1) { + result = [begs.pop(), bi]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + bi = str.indexOf(b2, i2 + 1); + } + i2 = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length) { + result = [left, right]; + } + } + return result; + } + } +}); + +// node_modules/brace-expansion/index.js +var require_brace_expansion = __commonJS({ + "node_modules/brace-expansion/index.js"(exports, module) { + var concatMap = require_concat_map(); + var balanced = require_balanced_match(); + module.exports = expandTop; + var escSlash = "\0SLASH" + Math.random() + "\0"; + var escOpen = "\0OPEN" + Math.random() + "\0"; + var escClose = "\0CLOSE" + Math.random() + "\0"; + var escComma = "\0COMMA" + Math.random() + "\0"; + var escPeriod = "\0PERIOD" + Math.random() + "\0"; + function numeric(str) { + return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); + } + function escapeBraces(str) { + return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); + } + function unescapeBraces(str) { + return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); + } + function parseCommaParts(str) { + if (!str) + return [""]; + var parts = []; + var m3 = balanced("{", "}", str); + if (!m3) + return str.split(","); + var pre = m3.pre; + var body2 = m3.body; + var post2 = m3.post; + var p2 = pre.split(","); + p2[p2.length - 1] += "{" + body2 + "}"; + var postParts = parseCommaParts(post2); + if (post2.length) { + p2[p2.length - 1] += postParts.shift(); + p2.push.apply(p2, postParts); + } + parts.push.apply(parts, p2); + return parts; + } + function expandTop(str) { + if (!str) + return []; + if (str.substr(0, 2) === "{}") { + str = "\\{\\}" + str.substr(2); + } + return expand(escapeBraces(str), true).map(unescapeBraces); + } + function embrace(str) { + return "{" + str + "}"; + } + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte(i2, y2) { + return i2 <= y2; + } + function gte(i2, y2) { + return i2 >= y2; + } + function expand(str, isTop) { + var expansions = []; + var m3 = balanced("{", "}", str); + if (!m3 || /\$$/.test(m3.pre)) + return [str]; + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m3.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m3.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m3.body.indexOf(",") >= 0; + if (!isSequence && !isOptions) { + if (m3.post.match(/,.*\}/)) { + str = m3.pre + "{" + m3.body + escClose + m3.post; + return expand(str); + } + return [str]; + } + var n2; + if (isSequence) { + n2 = m3.body.split(/\.\./); + } else { + n2 = parseCommaParts(m3.body); + if (n2.length === 1) { + n2 = expand(n2[0], false).map(embrace); + if (n2.length === 1) { + var post2 = m3.post.length ? expand(m3.post, false) : [""]; + return post2.map(function(p2) { + return m3.pre + n2[0] + p2; + }); + } + } + } + var pre = m3.pre; + var post2 = m3.post.length ? expand(m3.post, false) : [""]; + var N2; + if (isSequence) { + var x2 = numeric(n2[0]); + var y2 = numeric(n2[1]); + var width = Math.max(n2[0].length, n2[1].length); + var incr = n2.length == 3 ? Math.abs(numeric(n2[2])) : 1; + var test = lte; + var reverse = y2 < x2; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n2.some(isPadded); + N2 = []; + for (var i2 = x2; test(i2, y2); i2 += incr) { + var c2; + if (isAlphaSequence) { + c2 = String.fromCharCode(i2); + if (c2 === "\\") + c2 = ""; + } else { + c2 = String(i2); + if (pad) { + var need = width - c2.length; + if (need > 0) { + var z2 = new Array(need + 1).join("0"); + if (i2 < 0) + c2 = "-" + z2 + c2.slice(1); + else + c2 = z2 + c2; + } + } + } + N2.push(c2); + } + } else { + N2 = concatMap(n2, function(el) { + return expand(el, false); + }); + } + for (var j2 = 0; j2 < N2.length; j2++) { + for (var k2 = 0; k2 < post2.length; k2++) { + var expansion = pre + N2[j2] + post2[k2]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + return expansions; + } + } +}); + +// node_modules/minimatch/minimatch.js +var require_minimatch = __commonJS({ + "node_modules/minimatch/minimatch.js"(exports, module) { + module.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path14 = function() { + try { + return __require("path"); + } catch (e2) { + } + }() || { + sep: "/" + }; + minimatch.sep = path14.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } + }; + var qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s2) { + return s2.split("").reduce(function(set2, c2) { + set2[c2] = true; + return set2; + }, {}); + } + var slashSplit = /\/+/; + minimatch.filter = filter; + function filter(pattern, options) { + options = options || {}; + return function(p2, i2, list3) { + return minimatch(p2, pattern, options); + }; + } + function ext(a2, b2) { + b2 = b2 || {}; + var t2 = {}; + Object.keys(a2).forEach(function(k2) { + t2[k2] = a2[k2]; + }); + Object.keys(b2).forEach(function(k2) { + t2[k2] = b2[k2]; + }); + return t2; + } + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; + } + var orig = minimatch; + var m3 = function minimatch2(p2, pattern, options) { + return orig(p2, pattern, ext(def, options)); + }; + m3.Minimatch = function Minimatch2(pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)); + }; + m3.Minimatch.defaults = function defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m3.filter = function filter2(pattern, options) { + return orig.filter(pattern, ext(def, options)); + }; + m3.defaults = function defaults(options) { + return orig.defaults(ext(def, options)); + }; + m3.makeRe = function makeRe2(pattern, options) { + return orig.makeRe(pattern, ext(def, options)); + }; + m3.braceExpand = function braceExpand2(pattern, options) { + return orig.braceExpand(pattern, ext(def, options)); + }; + m3.match = function(list3, pattern, options) { + return orig.match(list3, pattern, ext(def, options)); + }; + return m3; + }; + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p2, pattern, options) { + assertValidPattern(pattern); + if (!options) + options = {}; + if (!options.nocomment && pattern.charAt(0) === "#") { + return false; + } + return new Minimatch(pattern, options).match(p2); + } + function Minimatch(pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options); + } + assertValidPattern(pattern); + if (!options) + options = {}; + pattern = pattern.trim(); + if (!options.allowWindowsEscape && path14.sep !== "/") { + pattern = pattern.split(path14.sep).join("/"); + } + this.options = options; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); + } + Minimatch.prototype.debug = function() { + }; + Minimatch.prototype.make = make; + function make() { + var pattern = this.pattern; + var options = this.options; + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true; + return; + } + if (!pattern) { + this.empty = true; + return; + } + this.parseNegate(); + var set2 = this.globSet = this.braceExpand(); + if (options.debug) + this.debug = function debug3() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set2); + set2 = this.globParts = set2.map(function(s2) { + return s2.split(slashSplit); + }); + this.debug(this.pattern, set2); + set2 = set2.map(function(s2, si, set3) { + return s2.map(this.parse, this); + }, this); + this.debug(this.pattern, set2); + set2 = set2.filter(function(s2) { + return s2.indexOf(false) === -1; + }); + this.debug(this.pattern, set2); + this.set = set2; + } + Minimatch.prototype.parseNegate = parseNegate; + function parseNegate() { + var pattern = this.pattern; + var negate = false; + var options = this.options; + var negateOffset = 0; + if (options.nonegate) + return; + for (var i2 = 0, l2 = pattern.length; i2 < l2 && pattern.charAt(i2) === "!"; i2++) { + negate = !negate; + negateOffset++; + } + if (negateOffset) + this.pattern = pattern.substr(negateOffset); + this.negate = negate; + } + minimatch.braceExpand = function(pattern, options) { + return braceExpand(pattern, options); + }; + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; + } + } + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + assertValidPattern(pattern); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + return [pattern]; + } + return expand(pattern); + } + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern) { + if (typeof pattern !== "string") { + throw new TypeError("invalid pattern"); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); + } + }; + Minimatch.prototype.parse = parse5; + var SUBPARSE = {}; + function parse5(pattern, isSub) { + assertValidPattern(pattern); + var options = this.options; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + else + pattern = "*"; + } + if (pattern === "") + return ""; + var re3 = ""; + var hasMagic = !!options.nocase; + var escaping = false; + var patternListStack = []; + var negativeLists = []; + var stateChar; + var inClass = false; + var reClassStart = -1; + var classStart = -1; + var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; + var self2 = this; + function clearStateChar() { + if (stateChar) { + switch (stateChar) { + case "*": + re3 += star; + hasMagic = true; + break; + case "?": + re3 += qmark; + hasMagic = true; + break; + default: + re3 += "\\" + stateChar; + break; + } + self2.debug("clearStateChar %j %j", stateChar, re3); + stateChar = false; + } + } + for (var i2 = 0, len = pattern.length, c2; i2 < len && (c2 = pattern.charAt(i2)); i2++) { + this.debug("%s %s %s %j", pattern, i2, re3, c2); + if (escaping && reSpecials[c2]) { + re3 += "\\" + c2; + escaping = false; + continue; + } + switch (c2) { + case "/": { + return false; + } + case "\\": + clearStateChar(); + escaping = true; + continue; + case "?": + case "*": + case "+": + case "@": + case "!": + this.debug("%s %s %s %j <-- stateChar", pattern, i2, re3, c2); + if (inClass) { + this.debug(" in class"); + if (c2 === "!" && i2 === classStart + 1) + c2 = "^"; + re3 += c2; + continue; + } + self2.debug("call clearStateChar %j", stateChar); + clearStateChar(); + stateChar = c2; + if (options.noext) + clearStateChar(); + continue; + case "(": + if (inClass) { + re3 += "("; + continue; + } + if (!stateChar) { + re3 += "\\("; + continue; + } + patternListStack.push({ + type: stateChar, + start: i2 - 1, + reStart: re3.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }); + re3 += stateChar === "!" ? "(?:(?!(?:" : "(?:"; + this.debug("plType %j %j", stateChar, re3); + stateChar = false; + continue; + case ")": + if (inClass || !patternListStack.length) { + re3 += "\\)"; + continue; + } + clearStateChar(); + hasMagic = true; + var pl = patternListStack.pop(); + re3 += pl.close; + if (pl.type === "!") { + negativeLists.push(pl); + } + pl.reEnd = re3.length; + continue; + case "|": + if (inClass || !patternListStack.length || escaping) { + re3 += "\\|"; + escaping = false; + continue; + } + clearStateChar(); + re3 += "|"; + continue; + case "[": + clearStateChar(); + if (inClass) { + re3 += "\\" + c2; + continue; + } + inClass = true; + classStart = i2; + reClassStart = re3.length; + re3 += c2; + continue; + case "]": + if (i2 === classStart + 1 || !inClass) { + re3 += "\\" + c2; + escaping = false; + continue; + } + var cs = pattern.substring(classStart + 1, i2); + try { + RegExp("[" + cs + "]"); + } catch (er2) { + var sp = this.parse(cs, SUBPARSE); + re3 = re3.substr(0, reClassStart) + "\\[" + sp[0] + "\\]"; + hasMagic = hasMagic || sp[1]; + inClass = false; + continue; + } + hasMagic = true; + inClass = false; + re3 += c2; + continue; + default: + clearStateChar(); + if (escaping) { + escaping = false; + } else if (reSpecials[c2] && !(c2 === "^" && inClass)) { + re3 += "\\"; + } + re3 += c2; + } + } + if (inClass) { + cs = pattern.substr(classStart + 1); + sp = this.parse(cs, SUBPARSE); + re3 = re3.substr(0, reClassStart) + "\\[" + sp[0]; + hasMagic = hasMagic || sp[1]; + } + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re3.slice(pl.reStart + pl.open.length); + this.debug("setting tail", re3, pl); + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_2, $1, $2) { + if (!$2) { + $2 = "\\"; + } + return $1 + $1 + $2 + "|"; + }); + this.debug("tail=%j\n %s", tail, tail, pl, re3); + var t2 = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re3 = re3.slice(0, pl.reStart) + t2 + "\\(" + tail; + } + clearStateChar(); + if (escaping) { + re3 += "\\\\"; + } + var addPatternStart = false; + switch (re3.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = true; + } + for (var n2 = negativeLists.length - 1; n2 > -1; n2--) { + var nl = negativeLists[n2]; + var nlBefore = re3.slice(0, nl.reStart); + var nlFirst = re3.slice(nl.reStart, nl.reEnd - 8); + var nlLast = re3.slice(nl.reEnd - 8, nl.reEnd); + var nlAfter = re3.slice(nl.reEnd); + nlLast += nlAfter; + var openParensBefore = nlBefore.split("(").length - 1; + var cleanAfter = nlAfter; + for (i2 = 0; i2 < openParensBefore; i2++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, ""); + } + nlAfter = cleanAfter; + var dollar = ""; + if (nlAfter === "" && isSub !== SUBPARSE) { + dollar = "$"; + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; + re3 = newRe; + } + if (re3 !== "" && hasMagic) { + re3 = "(?=.)" + re3; + } + if (addPatternStart) { + re3 = patternStart + re3; + } + if (isSub === SUBPARSE) { + return [re3, hasMagic]; + } + if (!hasMagic) { + return globUnescape(pattern); + } + var flags = options.nocase ? "i" : ""; + try { + var regExp = new RegExp("^" + re3 + "$", flags); + } catch (er2) { + return new RegExp("$."); + } + regExp._glob = pattern; + regExp._src = re3; + return regExp; + } + minimatch.makeRe = function(pattern, options) { + return new Minimatch(pattern, options || {}).makeRe(); + }; + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) + return this.regexp; + var set2 = this.set; + if (!set2.length) { + this.regexp = false; + return this.regexp; + } + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re3 = set2.map(function(pattern) { + return pattern.map(function(p2) { + return p2 === GLOBSTAR ? twoStar : typeof p2 === "string" ? regExpEscape(p2) : p2._src; + }).join("\\/"); + }).join("|"); + re3 = "^(?:" + re3 + ")$"; + if (this.negate) + re3 = "^(?!" + re3 + ").*$"; + try { + this.regexp = new RegExp(re3, flags); + } catch (ex) { + this.regexp = false; + } + return this.regexp; + } + minimatch.match = function(list3, pattern, options) { + options = options || {}; + var mm = new Minimatch(pattern, options); + list3 = list3.filter(function(f2) { + return mm.match(f2); + }); + if (mm.options.nonull && !list3.length) { + list3.push(pattern); + } + return list3; + }; + Minimatch.prototype.match = function match(f2, partial) { + if (typeof partial === "undefined") + partial = this.partial; + this.debug("match", f2, this.pattern); + if (this.comment) + return false; + if (this.empty) + return f2 === ""; + if (f2 === "/" && partial) + return true; + var options = this.options; + if (path14.sep !== "/") { + f2 = f2.split(path14.sep).join("/"); + } + f2 = f2.split(slashSplit); + this.debug(this.pattern, "split", f2); + var set2 = this.set; + this.debug(this.pattern, "set", set2); + var filename; + var i2; + for (i2 = f2.length - 1; i2 >= 0; i2--) { + filename = f2[i2]; + if (filename) + break; + } + for (i2 = 0; i2 < set2.length; i2++) { + var pattern = set2[i2]; + var file = f2; + if (options.matchBase && pattern.length === 1) { + file = [filename]; + } + var hit = this.matchOne(file, pattern, partial); + if (hit) { + if (options.flipNegate) + return true; + return !this.negate; + } + } + if (options.flipNegate) + return false; + return this.negate; + }; + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options = this.options; + this.debug( + "matchOne", + { "this": this, file, pattern } + ); + this.debug("matchOne", file.length, pattern.length); + for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p2 = pattern[pi]; + var f2 = file[fi]; + this.debug(pattern, p2, f2); + if (p2 === false) + return false; + if (p2 === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern, p2, f2]); + var fr2 = fi; + var pr2 = pi + 1; + if (pr2 === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") + return false; + } + return true; + } + while (fr2 < fl) { + var swallowee = file[fr2]; + this.debug("\nglobstar while", file, fr2, pattern, pr2, swallowee); + if (this.matchOne(file.slice(fr2), pattern.slice(pr2), partial)) { + this.debug("globstar found match!", fr2, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr2, pattern, pr2); + break; + } + this.debug("globstar swallow a segment, and continue"); + fr2++; + } + } + if (partial) { + this.debug("\n>>> no match, partial?", file, fr2, pattern, pr2); + if (fr2 === fl) + return true; + } + return false; + } + var hit; + if (typeof p2 === "string") { + hit = f2 === p2; + this.debug("string match", p2, f2, hit); + } else { + hit = f2.match(p2); + this.debug("pattern match", p2, f2, hit); + } + if (!hit) + return false; + } + if (fi === fl && pi === pl) { + return true; + } else if (fi === fl) { + return partial; + } else if (pi === pl) { + return fi === fl - 1 && file[fi] === ""; + } + throw new Error("wtf?"); + }; + function globUnescape(s2) { + return s2.replace(/\\(.)/g, "$1"); + } + function regExpEscape(s2) { + return s2.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + } + } +}); + +// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js +var require_internal_path = __commonJS({ + "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; + }; + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Path = void 0; + var path14 = __importStar(__require("path")); + var pathHelper = __importStar(require_internal_path_helper()); + var assert_1 = __importDefault(__require("assert")); + var IS_WINDOWS = process.platform === "win32"; + var Path = class { + /** + * Constructs a Path + * @param itemPath Path or array of segments + */ + constructor(itemPath) { + this.segments = []; + if (typeof itemPath === "string") { + assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + if (!pathHelper.hasRoot(itemPath)) { + this.segments = itemPath.split(path14.sep); + } else { + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + const basename = path14.basename(remaining); + this.segments.unshift(basename); + remaining = dir; + dir = pathHelper.dirname(remaining); + } + this.segments.unshift(remaining); + } + } else { + assert_1.default(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`); + for (let i2 = 0; i2 < itemPath.length; i2++) { + let segment = itemPath[i2]; + assert_1.default(segment, `Parameter 'itemPath' must not contain any empty segments`); + segment = pathHelper.normalizeSeparators(itemPath[i2]); + if (i2 === 0 && pathHelper.hasRoot(segment)) { + segment = pathHelper.safeTrimTrailingSeparator(segment); + assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); + this.segments.push(segment); + } else { + assert_1.default(!segment.includes(path14.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); + } + } + } + } + /** + * Converts the path to it's string representation + */ + toString() { + let result = this.segments[0]; + let skipSlash = result.endsWith(path14.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + for (let i2 = 1; i2 < this.segments.length; i2++) { + if (skipSlash) { + skipSlash = false; + } else { + result += path14.sep; + } + result += this.segments[i2]; + } + return result; + } + }; + exports.Path = Path; + } +}); + +// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js +var require_internal_pattern = __commonJS({ + "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; + }; + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Pattern = void 0; + var os3 = __importStar(__require("os")); + var path14 = __importStar(__require("path")); + var pathHelper = __importStar(require_internal_path_helper()); + var assert_1 = __importDefault(__require("assert")); + var minimatch_1 = require_minimatch(); + var internal_match_kind_1 = require_internal_match_kind(); + var internal_path_1 = require_internal_path(); + var IS_WINDOWS = process.platform === "win32"; + var Pattern = class _Pattern { + constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) { + this.negate = false; + let pattern; + if (typeof patternOrNegate === "string") { + pattern = patternOrNegate.trim(); + } else { + segments = segments || []; + assert_1.default(segments.length, `Parameter 'segments' must not empty`); + const root = _Pattern.getLiteral(segments[0]); + assert_1.default(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`); + pattern = new internal_path_1.Path(segments).toString().trim(); + if (patternOrNegate) { + pattern = `!${pattern}`; + } + } + while (pattern.startsWith("!")) { + this.negate = !this.negate; + pattern = pattern.substr(1).trim(); + } + pattern = _Pattern.fixupPattern(pattern, homedir); + this.segments = new internal_path_1.Path(pattern).segments; + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path14.sep); + pattern = pathHelper.safeTrimTrailingSeparator(pattern); + let foundGlob = false; + const searchSegments = this.segments.map((x2) => _Pattern.getLiteral(x2)).filter((x2) => !foundGlob && !(foundGlob = x2 === "")); + this.searchPath = new internal_path_1.Path(searchSegments).toString(); + this.rootRegExp = new RegExp(_Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? "i" : ""); + this.isImplicitPattern = isImplicitPattern; + const minimatchOptions = { + dot: true, + nobrace: true, + nocase: IS_WINDOWS, + nocomment: true, + noext: true, + nonegate: true + }; + pattern = IS_WINDOWS ? pattern.replace(/\\/g, "/") : pattern; + this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); + } + /** + * Matches the pattern against the specified path + */ + match(itemPath) { + if (this.segments[this.segments.length - 1] === "**") { + itemPath = pathHelper.normalizeSeparators(itemPath); + if (!itemPath.endsWith(path14.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path14.sep}`; + } + } else { + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + } + if (this.minimatch.match(itemPath)) { + return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All; + } + return internal_match_kind_1.MatchKind.None; + } + /** + * Indicates whether the pattern may match descendants of the specified path + */ + partialMatch(itemPath) { + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + if (pathHelper.dirname(itemPath) === itemPath) { + return this.rootRegExp.test(itemPath); + } + return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); + } + /** + * Escapes glob patterns within a path + */ + static globEscape(s2) { + return (IS_WINDOWS ? s2 : s2.replace(/\\/g, "\\\\")).replace(/(\[)(?=[^/]+\])/g, "[[]").replace(/\?/g, "[?]").replace(/\*/g, "[*]"); + } + /** + * Normalizes slashes and ensures absolute root + */ + static fixupPattern(pattern, homedir) { + assert_1.default(pattern, "pattern cannot be empty"); + const literalSegments = new internal_path_1.Path(pattern).segments.map((x2) => _Pattern.getLiteral(x2)); + assert_1.default(literalSegments.every((x2, i2) => (x2 !== "." || i2 === 0) && x2 !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); + assert_1.default(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); + pattern = pathHelper.normalizeSeparators(pattern); + if (pattern === "." || pattern.startsWith(`.${path14.sep}`)) { + pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); + } else if (pattern === "~" || pattern.startsWith(`~${path14.sep}`)) { + homedir = homedir || os3.homedir(); + assert_1.default(homedir, "Unable to determine HOME directory"); + assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = _Pattern.globEscape(homedir) + pattern.substr(1); + } else if (IS_WINDOWS && (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\]/i))) { + let root = pathHelper.ensureAbsoluteRoot("C:\\dummy-root", pattern.substr(0, 2)); + if (pattern.length > 2 && !root.endsWith("\\")) { + root += "\\"; + } + pattern = _Pattern.globEscape(root) + pattern.substr(2); + } else if (IS_WINDOWS && (pattern === "\\" || pattern.match(/^\\[^\\]/))) { + let root = pathHelper.ensureAbsoluteRoot("C:\\dummy-root", "\\"); + if (!root.endsWith("\\")) { + root += "\\"; + } + pattern = _Pattern.globEscape(root) + pattern.substr(1); + } else { + pattern = pathHelper.ensureAbsoluteRoot(_Pattern.globEscape(process.cwd()), pattern); + } + return pathHelper.normalizeSeparators(pattern); + } + /** + * Attempts to unescape a pattern segment to create a literal path segment. + * Otherwise returns empty string. + */ + static getLiteral(segment) { + let literal = ""; + for (let i2 = 0; i2 < segment.length; i2++) { + const c2 = segment[i2]; + if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { + literal += segment[++i2]; + continue; + } else if (c2 === "*" || c2 === "?") { + return ""; + } else if (c2 === "[" && i2 + 1 < segment.length) { + let set2 = ""; + let closed = -1; + for (let i22 = i2 + 1; i22 < segment.length; i22++) { + const c22 = segment[i22]; + if (c22 === "\\" && !IS_WINDOWS && i22 + 1 < segment.length) { + set2 += segment[++i22]; + continue; + } else if (c22 === "]") { + closed = i22; + break; + } else { + set2 += c22; + } + } + if (closed >= 0) { + if (set2.length > 1) { + return ""; + } + if (set2) { + literal += set2; + i2 = closed; + continue; + } + } + } + literal += c2; + } + return literal; + } + /** + * Escapes regexp special characters + * https://javascript.info/regexp-escaping + */ + static regExpEscape(s2) { + return s2.replace(/[[\\^$.|?*+()]/g, "\\$&"); + } + }; + exports.Pattern = Pattern; + } +}); + +// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-search-state.js +var require_internal_search_state = __commonJS({ + "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-search-state.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SearchState = void 0; + var SearchState = class { + constructor(path14, level) { + this.path = path14; + this.level = level; + } + }; + exports.SearchState = SearchState; + } +}); + +// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js +var require_internal_globber = __commonJS({ + "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve2) { + resolve2(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var __asyncValues2 = exports && exports.__asyncValues || function(o2) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m3 = o2[Symbol.asyncIterator], i2; + return m3 ? m3.call(o2) : (o2 = typeof __values === "function" ? __values(o2) : o2[Symbol.iterator](), i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { + return this; + }, i2); + function verb(n2) { + i2[n2] = o2[n2] && function(v2) { + return new Promise(function(resolve2, reject) { + v2 = o2[n2](v2), settle(resolve2, reject, v2.done, v2.value); + }); + }; + } + function settle(resolve2, reject, d2, v2) { + Promise.resolve(v2).then(function(v6) { + resolve2({ value: v6, done: d2 }); + }, reject); + } + }; + var __await2 = exports && exports.__await || function(v2) { + return this instanceof __await2 ? (this.v = v2, this) : new __await2(v2); + }; + var __asyncGenerator2 = exports && exports.__asyncGenerator || function(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var g2 = generator.apply(thisArg, _arguments || []), i2, q2 = []; + return i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { + return this; + }, i2; + function verb(n2) { + if (g2[n2]) + i2[n2] = function(v2) { + return new Promise(function(a2, b2) { + q2.push([n2, v2, a2, b2]) > 1 || resume(n2, v2); + }); + }; + } + function resume(n2, v2) { + try { + step(g2[n2](v2)); + } catch (e2) { + settle(q2[0][3], e2); + } + } + function step(r2) { + r2.value instanceof __await2 ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q2[0][2], r2); + } + function fulfill(value) { + resume("next", value); + } + function reject(value) { + resume("throw", value); + } + function settle(f2, v2) { + if (f2(v2), q2.shift(), q2.length) + resume(q2[0][0], q2[0][1]); + } + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DefaultGlobber = void 0; + var core2 = __importStar(require_core()); + var fs3 = __importStar(__require("fs")); + var globOptionsHelper = __importStar(require_internal_glob_options_helper()); + var path14 = __importStar(__require("path")); + var patternHelper = __importStar(require_internal_pattern_helper()); + var internal_match_kind_1 = require_internal_match_kind(); + var internal_pattern_1 = require_internal_pattern(); + var internal_search_state_1 = require_internal_search_state(); + var IS_WINDOWS = process.platform === "win32"; + var DefaultGlobber = class _DefaultGlobber { + constructor(options) { + this.patterns = []; + this.searchPaths = []; + this.options = globOptionsHelper.getOptions(options); + } + getSearchPaths() { + return this.searchPaths.slice(); + } + glob() { + var e_1, _a2; + return __awaiter(this, void 0, void 0, function* () { + const result = []; + try { + for (var _b2 = __asyncValues2(this.globGenerator()), _c2; _c2 = yield _b2.next(), !_c2.done; ) { + const itemPath = _c2.value; + result.push(itemPath); + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (_c2 && !_c2.done && (_a2 = _b2.return)) + yield _a2.call(_b2); + } finally { + if (e_1) + throw e_1.error; + } + } + return result; + }); + } + globGenerator() { + return __asyncGenerator2(this, arguments, function* globGenerator_1() { + const options = globOptionsHelper.getOptions(this.options); + const patterns = []; + for (const pattern of this.patterns) { + patterns.push(pattern); + if (options.implicitDescendants && (pattern.trailingSeparator || pattern.segments[pattern.segments.length - 1] !== "**")) { + patterns.push(new internal_pattern_1.Pattern(pattern.negate, true, pattern.segments.concat("**"))); + } + } + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core2.debug(`Search path '${searchPath}'`); + try { + yield __await2(fs3.promises.lstat(searchPath)); + } catch (err) { + if (err.code === "ENOENT") { + continue; + } + throw err; + } + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); + } + const traversalChain = []; + while (stack.length) { + const item = stack.pop(); + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !partialMatch) { + continue; + } + const stats = yield __await2( + _DefaultGlobber.stat(item, options, traversalChain) + // Broken symlink, or symlink cycle detected, or no longer exists + ); + if (!stats) { + continue; + } + if (stats.isDirectory()) { + if (match & internal_match_kind_1.MatchKind.Directory) { + yield yield __await2(item.path); + } else if (!partialMatch) { + continue; + } + const childLevel = item.level + 1; + const childItems = (yield __await2(fs3.promises.readdir(item.path))).map((x2) => new internal_search_state_1.SearchState(path14.join(item.path, x2), childLevel)); + stack.push(...childItems.reverse()); + } else if (match & internal_match_kind_1.MatchKind.File) { + yield yield __await2(item.path); + } + } + }); + } + /** + * Constructs a DefaultGlobber + */ + static create(patterns, options) { + return __awaiter(this, void 0, void 0, function* () { + const result = new _DefaultGlobber(options); + if (IS_WINDOWS) { + patterns = patterns.replace(/\r\n/g, "\n"); + patterns = patterns.replace(/\r/g, "\n"); + } + const lines = patterns.split("\n").map((x2) => x2.trim()); + for (const line of lines) { + if (!line || line.startsWith("#")) { + continue; + } else { + result.patterns.push(new internal_pattern_1.Pattern(line)); + } + } + result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns)); + return result; + }); + } + static stat(item, options, traversalChain) { + return __awaiter(this, void 0, void 0, function* () { + let stats; + if (options.followSymbolicLinks) { + try { + stats = yield fs3.promises.stat(item.path); + } catch (err) { + if (err.code === "ENOENT") { + if (options.omitBrokenSymbolicLinks) { + core2.debug(`Broken symlink '${item.path}'`); + return void 0; + } + throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); + } + throw err; + } + } else { + stats = yield fs3.promises.lstat(item.path); + } + if (stats.isDirectory() && options.followSymbolicLinks) { + const realPath = yield fs3.promises.realpath(item.path); + while (traversalChain.length >= item.level) { + traversalChain.pop(); + } + if (traversalChain.some((x2) => x2 === realPath)) { + core2.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return void 0; + } + traversalChain.push(realPath); + } + return stats; + }); + } + }; + exports.DefaultGlobber = DefaultGlobber; + } +}); + +// node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js +var require_glob = __commonJS({ + "node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js"(exports) { + "use strict"; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve2) { + resolve2(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.create = void 0; + var internal_globber_1 = require_internal_globber(); + function create(patterns, options) { + return __awaiter(this, void 0, void 0, function* () { + return yield internal_globber_1.DefaultGlobber.create(patterns, options); + }); + } + exports.create = create; + } +}); + +// node_modules/semver/internal/constants.js +var require_constants5 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports, module) { + var SEMVER_SPEC_VERSION = "2.0.0"; + var MAX_LENGTH = 256; + var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ + 9007199254740991; + var MAX_SAFE_COMPONENT_LENGTH = 16; + var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; + var RELEASE_TYPES = [ + "major", + "premajor", + "minor", + "preminor", + "patch", + "prepatch", + "prerelease" + ]; + module.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 1, + FLAG_LOOSE: 2 + }; + } +}); + +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports, module) { + var debug3 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + }; + module.exports = debug3; + } +}); + +// node_modules/semver/internal/re.js +var require_re = __commonJS({ + "node_modules/semver/internal/re.js"(exports, module) { + var { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH + } = require_constants5(); + var debug3 = require_debug(); + exports = module.exports = {}; + var re3 = exports.re = []; + var safeRe = exports.safeRe = []; + var src = exports.src = []; + var t2 = exports.t = {}; + var R2 = 0; + var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; + var safeRegexReplacements = [ + ["\\s", 1], + ["\\d", MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] + ]; + var makeSafeRegex = (value) => { + for (const [token, max] of safeRegexReplacements) { + value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`); + } + return value; + }; + var createToken = (name2, value, isGlobal) => { + const safe = makeSafeRegex(value); + const index = R2++; + debug3(name2, index, value); + t2[name2] = index; + src[index] = value; + re3[index] = new RegExp(value, isGlobal ? "g" : void 0); + safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0); + }; + createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); + createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); + createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); + createToken("MAINVERSION", `(${src[t2.NUMERICIDENTIFIER]})\\.(${src[t2.NUMERICIDENTIFIER]})\\.(${src[t2.NUMERICIDENTIFIER]})`); + createToken("MAINVERSIONLOOSE", `(${src[t2.NUMERICIDENTIFIERLOOSE]})\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})`); + createToken("PRERELEASEIDENTIFIER", `(?:${src[t2.NUMERICIDENTIFIER]}|${src[t2.NONNUMERICIDENTIFIER]})`); + createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t2.NUMERICIDENTIFIERLOOSE]}|${src[t2.NONNUMERICIDENTIFIER]})`); + createToken("PRERELEASE", `(?:-(${src[t2.PRERELEASEIDENTIFIER]}(?:\\.${src[t2.PRERELEASEIDENTIFIER]})*))`); + createToken("PRERELEASELOOSE", `(?:-?(${src[t2.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t2.PRERELEASEIDENTIFIERLOOSE]})*))`); + createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); + createToken("BUILD", `(?:\\+(${src[t2.BUILDIDENTIFIER]}(?:\\.${src[t2.BUILDIDENTIFIER]})*))`); + createToken("FULLPLAIN", `v?${src[t2.MAINVERSION]}${src[t2.PRERELEASE]}?${src[t2.BUILD]}?`); + createToken("FULL", `^${src[t2.FULLPLAIN]}$`); + createToken("LOOSEPLAIN", `[v=\\s]*${src[t2.MAINVERSIONLOOSE]}${src[t2.PRERELEASELOOSE]}?${src[t2.BUILD]}?`); + createToken("LOOSE", `^${src[t2.LOOSEPLAIN]}$`); + createToken("GTLT", "((?:<|>)?=?)"); + createToken("XRANGEIDENTIFIERLOOSE", `${src[t2.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); + createToken("XRANGEIDENTIFIER", `${src[t2.NUMERICIDENTIFIER]}|x|X|\\*`); + createToken("XRANGEPLAIN", `[v=\\s]*(${src[t2.XRANGEIDENTIFIER]})(?:\\.(${src[t2.XRANGEIDENTIFIER]})(?:\\.(${src[t2.XRANGEIDENTIFIER]})(?:${src[t2.PRERELEASE]})?${src[t2.BUILD]}?)?)?`); + createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:${src[t2.PRERELEASELOOSE]})?${src[t2.BUILD]}?)?)?`); + createToken("XRANGE", `^${src[t2.GTLT]}\\s*${src[t2.XRANGEPLAIN]}$`); + createToken("XRANGELOOSE", `^${src[t2.GTLT]}\\s*${src[t2.XRANGEPLAINLOOSE]}$`); + createToken("COERCE", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:$|[^\\d])`); + createToken("COERCERTL", src[t2.COERCE], true); + createToken("LONETILDE", "(?:~>?)"); + createToken("TILDETRIM", `(\\s*)${src[t2.LONETILDE]}\\s+`, true); + exports.tildeTrimReplace = "$1~"; + createToken("TILDE", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAIN]}$`); + createToken("TILDELOOSE", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAINLOOSE]}$`); + createToken("LONECARET", "(?:\\^)"); + createToken("CARETTRIM", `(\\s*)${src[t2.LONECARET]}\\s+`, true); + exports.caretTrimReplace = "$1^"; + createToken("CARET", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAIN]}$`); + createToken("CARETLOOSE", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAINLOOSE]}$`); + createToken("COMPARATORLOOSE", `^${src[t2.GTLT]}\\s*(${src[t2.LOOSEPLAIN]})$|^$`); + createToken("COMPARATOR", `^${src[t2.GTLT]}\\s*(${src[t2.FULLPLAIN]})$|^$`); + createToken("COMPARATORTRIM", `(\\s*)${src[t2.GTLT]}\\s*(${src[t2.LOOSEPLAIN]}|${src[t2.XRANGEPLAIN]})`, true); + exports.comparatorTrimReplace = "$1$2$3"; + createToken("HYPHENRANGE", `^\\s*(${src[t2.XRANGEPLAIN]})\\s+-\\s+(${src[t2.XRANGEPLAIN]})\\s*$`); + createToken("HYPHENRANGELOOSE", `^\\s*(${src[t2.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t2.XRANGEPLAINLOOSE]})\\s*$`); + createToken("STAR", "(<|>)?=?\\s*\\*"); + createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); + createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); + } +}); + +// node_modules/semver/internal/parse-options.js +var require_parse_options = __commonJS({ + "node_modules/semver/internal/parse-options.js"(exports, module) { + var looseOption = Object.freeze({ loose: true }); + var emptyOpts = Object.freeze({}); + var parseOptions = (options) => { + if (!options) { + return emptyOpts; + } + if (typeof options !== "object") { + return looseOption; + } + return options; + }; + module.exports = parseOptions; + } +}); + +// node_modules/semver/internal/identifiers.js +var require_identifiers = __commonJS({ + "node_modules/semver/internal/identifiers.js"(exports, module) { + var numeric = /^[0-9]+$/; + var compareIdentifiers = (a2, b2) => { + const anum = numeric.test(a2); + const bnum = numeric.test(b2); + if (anum && bnum) { + a2 = +a2; + b2 = +b2; + } + return a2 === b2 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a2 < b2 ? -1 : 1; + }; + var rcompareIdentifiers = (a2, b2) => compareIdentifiers(b2, a2); + module.exports = { + compareIdentifiers, + rcompareIdentifiers + }; + } +}); + +// node_modules/semver/classes/semver.js +var require_semver = __commonJS({ + "node_modules/semver/classes/semver.js"(exports, module) { + var debug3 = require_debug(); + var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants5(); + var { safeRe: re3, t: t2 } = require_re(); + var parseOptions = require_parse_options(); + var { compareIdentifiers } = require_identifiers(); + var SemVer = class _SemVer { + constructor(version4, options) { + options = parseOptions(options); + if (version4 instanceof _SemVer) { + if (version4.loose === !!options.loose && version4.includePrerelease === !!options.includePrerelease) { + return version4; + } else { + version4 = version4.version; + } + } else if (typeof version4 !== "string") { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version4}".`); + } + if (version4.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ); + } + debug3("SemVer", version4, options); + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + const m3 = version4.trim().match(options.loose ? re3[t2.LOOSE] : re3[t2.FULL]); + if (!m3) { + throw new TypeError(`Invalid Version: ${version4}`); + } + this.raw = version4; + this.major = +m3[1]; + this.minor = +m3[2]; + this.patch = +m3[3]; + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError("Invalid major version"); + } + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError("Invalid minor version"); + } + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError("Invalid patch version"); + } + if (!m3[4]) { + this.prerelease = []; + } else { + this.prerelease = m3[4].split(".").map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id; + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num; + } + } + return id; + }); + } + this.build = m3[5] ? m3[5].split(".") : []; + this.format(); + } + format() { + this.version = `${this.major}.${this.minor}.${this.patch}`; + if (this.prerelease.length) { + this.version += `-${this.prerelease.join(".")}`; + } + return this.version; + } + toString() { + return this.version; + } + compare(other) { + debug3("SemVer.compare", this.version, this.options, other); + if (!(other instanceof _SemVer)) { + if (typeof other === "string" && other === this.version) { + return 0; + } + other = new _SemVer(other, this.options); + } + if (other.version === this.version) { + return 0; + } + return this.compareMain(other) || this.comparePre(other); + } + compareMain(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); + } + comparePre(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + if (this.prerelease.length && !other.prerelease.length) { + return -1; + } else if (!this.prerelease.length && other.prerelease.length) { + return 1; + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0; + } + let i2 = 0; + do { + const a2 = this.prerelease[i2]; + const b2 = other.prerelease[i2]; + debug3("prerelease compare", i2, a2, b2); + if (a2 === void 0 && b2 === void 0) { + return 0; + } else if (b2 === void 0) { + return 1; + } else if (a2 === void 0) { + return -1; + } else if (a2 === b2) { + continue; + } else { + return compareIdentifiers(a2, b2); + } + } while (++i2); + } + compareBuild(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + let i2 = 0; + do { + const a2 = this.build[i2]; + const b2 = other.build[i2]; + debug3("prerelease compare", i2, a2, b2); + if (a2 === void 0 && b2 === void 0) { + return 0; + } else if (b2 === void 0) { + return 1; + } else if (a2 === void 0) { + return -1; + } else if (a2 === b2) { + continue; + } else { + return compareIdentifiers(a2, b2); + } + } while (++i2); + } + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc(release3, identifier, identifierBase) { + switch (release3) { + case "premajor": + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc("pre", identifier, identifierBase); + break; + case "preminor": + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc("pre", identifier, identifierBase); + break; + case "prepatch": + this.prerelease.length = 0; + this.inc("patch", identifier, identifierBase); + this.inc("pre", identifier, identifierBase); + break; + case "prerelease": + if (this.prerelease.length === 0) { + this.inc("patch", identifier, identifierBase); + } + this.inc("pre", identifier, identifierBase); + break; + case "major": + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; + } + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; + } + this.patch = 0; + this.prerelease = []; + break; + case "patch": + if (this.prerelease.length === 0) { + this.patch++; + } + this.prerelease = []; + break; + case "pre": { + const base = Number(identifierBase) ? 1 : 0; + if (!identifier && identifierBase === false) { + throw new Error("invalid increment argument: identifier is empty"); + } + if (this.prerelease.length === 0) { + this.prerelease = [base]; + } else { + let i2 = this.prerelease.length; + while (--i2 >= 0) { + if (typeof this.prerelease[i2] === "number") { + this.prerelease[i2]++; + i2 = -2; + } + } + if (i2 === -1) { + if (identifier === this.prerelease.join(".") && identifierBase === false) { + throw new Error("invalid increment argument: identifier already exists"); + } + this.prerelease.push(base); + } + } + if (identifier) { + let prerelease = [identifier, base]; + if (identifierBase === false) { + prerelease = [identifier]; + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease; + } + } else { + this.prerelease = prerelease; + } + } + break; + } + default: + throw new Error(`invalid increment argument: ${release3}`); + } + this.raw = this.format(); + if (this.build.length) { + this.raw += `+${this.build.join(".")}`; + } + return this; + } + }; + module.exports = SemVer; + } +}); + +// node_modules/semver/functions/parse.js +var require_parse2 = __commonJS({ + "node_modules/semver/functions/parse.js"(exports, module) { + var SemVer = require_semver(); + var parse5 = (version4, options, throwErrors = false) => { + if (version4 instanceof SemVer) { + return version4; + } + try { + return new SemVer(version4, options); + } catch (er2) { + if (!throwErrors) { + return null; + } + throw er2; + } + }; + module.exports = parse5; + } +}); + +// node_modules/semver/functions/valid.js +var require_valid = __commonJS({ + "node_modules/semver/functions/valid.js"(exports, module) { + var parse5 = require_parse2(); + var valid = (version4, options) => { + const v2 = parse5(version4, options); + return v2 ? v2.version : null; + }; + module.exports = valid; + } +}); + +// node_modules/semver/functions/clean.js +var require_clean = __commonJS({ + "node_modules/semver/functions/clean.js"(exports, module) { + var parse5 = require_parse2(); + var clean = (version4, options) => { + const s2 = parse5(version4.trim().replace(/^[=v]+/, ""), options); + return s2 ? s2.version : null; + }; + module.exports = clean; + } +}); + +// node_modules/semver/functions/inc.js +var require_inc = __commonJS({ + "node_modules/semver/functions/inc.js"(exports, module) { + var SemVer = require_semver(); + var inc = (version4, release3, options, identifier, identifierBase) => { + if (typeof options === "string") { + identifierBase = identifier; + identifier = options; + options = void 0; + } + try { + return new SemVer( + version4 instanceof SemVer ? version4.version : version4, + options + ).inc(release3, identifier, identifierBase).version; + } catch (er2) { + return null; + } + }; + module.exports = inc; + } +}); + +// node_modules/semver/functions/diff.js +var require_diff = __commonJS({ + "node_modules/semver/functions/diff.js"(exports, module) { + var parse5 = require_parse2(); + var diff = (version1, version22) => { + const v12 = parse5(version1, null, true); + const v2 = parse5(version22, null, true); + const comparison = v12.compare(v2); + if (comparison === 0) { + return null; + } + const v1Higher = comparison > 0; + const highVersion = v1Higher ? v12 : v2; + const lowVersion = v1Higher ? v2 : v12; + const highHasPre = !!highVersion.prerelease.length; + const lowHasPre = !!lowVersion.prerelease.length; + if (lowHasPre && !highHasPre) { + if (!lowVersion.patch && !lowVersion.minor) { + return "major"; + } + if (highVersion.patch) { + return "patch"; + } + if (highVersion.minor) { + return "minor"; + } + return "major"; + } + const prefix2 = highHasPre ? "pre" : ""; + if (v12.major !== v2.major) { + return prefix2 + "major"; + } + if (v12.minor !== v2.minor) { + return prefix2 + "minor"; + } + if (v12.patch !== v2.patch) { + return prefix2 + "patch"; + } + return "prerelease"; + }; + module.exports = diff; + } +}); + +// node_modules/semver/functions/major.js +var require_major = __commonJS({ + "node_modules/semver/functions/major.js"(exports, module) { + var SemVer = require_semver(); + var major2 = (a2, loose) => new SemVer(a2, loose).major; + module.exports = major2; + } +}); + +// node_modules/semver/functions/minor.js +var require_minor = __commonJS({ + "node_modules/semver/functions/minor.js"(exports, module) { + var SemVer = require_semver(); + var minor = (a2, loose) => new SemVer(a2, loose).minor; + module.exports = minor; + } +}); + +// node_modules/semver/functions/patch.js +var require_patch = __commonJS({ + "node_modules/semver/functions/patch.js"(exports, module) { + var SemVer = require_semver(); + var patch2 = (a2, loose) => new SemVer(a2, loose).patch; + module.exports = patch2; + } +}); + +// node_modules/semver/functions/prerelease.js +var require_prerelease = __commonJS({ + "node_modules/semver/functions/prerelease.js"(exports, module) { + var parse5 = require_parse2(); + var prerelease = (version4, options) => { + const parsed = parse5(version4, options); + return parsed && parsed.prerelease.length ? parsed.prerelease : null; + }; + module.exports = prerelease; + } +}); + +// node_modules/semver/functions/compare.js +var require_compare = __commonJS({ + "node_modules/semver/functions/compare.js"(exports, module) { + var SemVer = require_semver(); + var compare = (a2, b2, loose) => new SemVer(a2, loose).compare(new SemVer(b2, loose)); + module.exports = compare; + } +}); + +// node_modules/semver/functions/rcompare.js +var require_rcompare = __commonJS({ + "node_modules/semver/functions/rcompare.js"(exports, module) { + var compare = require_compare(); + var rcompare = (a2, b2, loose) => compare(b2, a2, loose); + module.exports = rcompare; + } +}); + +// node_modules/semver/functions/compare-loose.js +var require_compare_loose = __commonJS({ + "node_modules/semver/functions/compare-loose.js"(exports, module) { + var compare = require_compare(); + var compareLoose = (a2, b2) => compare(a2, b2, true); + module.exports = compareLoose; + } +}); + +// node_modules/semver/functions/compare-build.js +var require_compare_build = __commonJS({ + "node_modules/semver/functions/compare-build.js"(exports, module) { + var SemVer = require_semver(); + var compareBuild = (a2, b2, loose) => { + const versionA = new SemVer(a2, loose); + const versionB = new SemVer(b2, loose); + return versionA.compare(versionB) || versionA.compareBuild(versionB); + }; + module.exports = compareBuild; + } +}); + +// node_modules/semver/functions/sort.js +var require_sort = __commonJS({ + "node_modules/semver/functions/sort.js"(exports, module) { + var compareBuild = require_compare_build(); + var sort = (list3, loose) => list3.sort((a2, b2) => compareBuild(a2, b2, loose)); + module.exports = sort; + } +}); + +// node_modules/semver/functions/rsort.js +var require_rsort = __commonJS({ + "node_modules/semver/functions/rsort.js"(exports, module) { + var compareBuild = require_compare_build(); + var rsort = (list3, loose) => list3.sort((a2, b2) => compareBuild(b2, a2, loose)); + module.exports = rsort; + } +}); + +// node_modules/semver/functions/gt.js +var require_gt = __commonJS({ + "node_modules/semver/functions/gt.js"(exports, module) { + var compare = require_compare(); + var gt2 = (a2, b2, loose) => compare(a2, b2, loose) > 0; + module.exports = gt2; + } +}); + +// node_modules/semver/functions/lt.js +var require_lt = __commonJS({ + "node_modules/semver/functions/lt.js"(exports, module) { + var compare = require_compare(); + var lt2 = (a2, b2, loose) => compare(a2, b2, loose) < 0; + module.exports = lt2; + } +}); + +// node_modules/semver/functions/eq.js +var require_eq = __commonJS({ + "node_modules/semver/functions/eq.js"(exports, module) { + var compare = require_compare(); + var eq = (a2, b2, loose) => compare(a2, b2, loose) === 0; + module.exports = eq; + } +}); + +// node_modules/semver/functions/neq.js +var require_neq = __commonJS({ + "node_modules/semver/functions/neq.js"(exports, module) { + var compare = require_compare(); + var neq = (a2, b2, loose) => compare(a2, b2, loose) !== 0; + module.exports = neq; + } +}); + +// node_modules/semver/functions/gte.js +var require_gte = __commonJS({ + "node_modules/semver/functions/gte.js"(exports, module) { + var compare = require_compare(); + var gte = (a2, b2, loose) => compare(a2, b2, loose) >= 0; + module.exports = gte; + } +}); + +// node_modules/semver/functions/lte.js +var require_lte = __commonJS({ + "node_modules/semver/functions/lte.js"(exports, module) { + var compare = require_compare(); + var lte = (a2, b2, loose) => compare(a2, b2, loose) <= 0; + module.exports = lte; + } +}); + +// node_modules/semver/functions/cmp.js +var require_cmp = __commonJS({ + "node_modules/semver/functions/cmp.js"(exports, module) { + var eq = require_eq(); + var neq = require_neq(); + var gt2 = require_gt(); + var gte = require_gte(); + var lt2 = require_lt(); + var lte = require_lte(); + var cmp = (a2, op, b2, loose) => { + switch (op) { + case "===": + if (typeof a2 === "object") { + a2 = a2.version; + } + if (typeof b2 === "object") { + b2 = b2.version; + } + return a2 === b2; + case "!==": + if (typeof a2 === "object") { + a2 = a2.version; + } + if (typeof b2 === "object") { + b2 = b2.version; + } + return a2 !== b2; + case "": + case "=": + case "==": + return eq(a2, b2, loose); + case "!=": + return neq(a2, b2, loose); + case ">": + return gt2(a2, b2, loose); + case ">=": + return gte(a2, b2, loose); + case "<": + return lt2(a2, b2, loose); + case "<=": + return lte(a2, b2, loose); + default: + throw new TypeError(`Invalid operator: ${op}`); + } + }; + module.exports = cmp; + } +}); + +// node_modules/semver/functions/coerce.js +var require_coerce = __commonJS({ + "node_modules/semver/functions/coerce.js"(exports, module) { + var SemVer = require_semver(); + var parse5 = require_parse2(); + var { safeRe: re3, t: t2 } = require_re(); + var coerce = (version4, options) => { + if (version4 instanceof SemVer) { + return version4; + } + if (typeof version4 === "number") { + version4 = String(version4); + } + if (typeof version4 !== "string") { + return null; + } + options = options || {}; + let match = null; + if (!options.rtl) { + match = version4.match(re3[t2.COERCE]); + } else { + let next; + while ((next = re3[t2.COERCERTL].exec(version4)) && (!match || match.index + match[0].length !== version4.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; + } + re3[t2.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; + } + re3[t2.COERCERTL].lastIndex = -1; + } + if (match === null) { + return null; + } + return parse5(`${match[2]}.${match[3] || "0"}.${match[4] || "0"}`, options); + }; + module.exports = coerce; + } +}); + +// node_modules/semver/node_modules/yallist/iterator.js +var require_iterator = __commonJS({ + "node_modules/semver/node_modules/yallist/iterator.js"(exports, module) { + "use strict"; + module.exports = function(Yallist) { + Yallist.prototype[Symbol.iterator] = function* () { + for (let walker = this.head; walker; walker = walker.next) { + yield walker.value; + } + }; + }; + } +}); + +// node_modules/semver/node_modules/yallist/yallist.js +var require_yallist = __commonJS({ + "node_modules/semver/node_modules/yallist/yallist.js"(exports, module) { + "use strict"; + module.exports = Yallist; + Yallist.Node = Node; + Yallist.create = Yallist; + function Yallist(list3) { + var self2 = this; + if (!(self2 instanceof Yallist)) { + self2 = new Yallist(); + } + self2.tail = null; + self2.head = null; + self2.length = 0; + if (list3 && typeof list3.forEach === "function") { + list3.forEach(function(item) { + self2.push(item); + }); + } else if (arguments.length > 0) { + for (var i2 = 0, l2 = arguments.length; i2 < l2; i2++) { + self2.push(arguments[i2]); + } + } + return self2; + } + Yallist.prototype.removeNode = function(node) { + if (node.list !== this) { + throw new Error("removing node which does not belong to this list"); + } + var next = node.next; + var prev = node.prev; + if (next) { + next.prev = prev; + } + if (prev) { + prev.next = next; + } + if (node === this.head) { + this.head = next; + } + if (node === this.tail) { + this.tail = prev; + } + node.list.length--; + node.next = null; + node.prev = null; + node.list = null; + return next; + }; + Yallist.prototype.unshiftNode = function(node) { + if (node === this.head) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + var head = this.head; + node.list = this; + node.next = head; + if (head) { + head.prev = node; + } + this.head = node; + if (!this.tail) { + this.tail = node; + } + this.length++; + }; + Yallist.prototype.pushNode = function(node) { + if (node === this.tail) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + var tail = this.tail; + node.list = this; + node.prev = tail; + if (tail) { + tail.next = node; + } + this.tail = node; + if (!this.head) { + this.head = node; + } + this.length++; + }; + Yallist.prototype.push = function() { + for (var i2 = 0, l2 = arguments.length; i2 < l2; i2++) { + push(this, arguments[i2]); + } + return this.length; + }; + Yallist.prototype.unshift = function() { + for (var i2 = 0, l2 = arguments.length; i2 < l2; i2++) { + unshift(this, arguments[i2]); + } + return this.length; + }; + Yallist.prototype.pop = function() { + if (!this.tail) { + return void 0; + } + var res = this.tail.value; + this.tail = this.tail.prev; + if (this.tail) { + this.tail.next = null; + } else { + this.head = null; + } + this.length--; + return res; + }; + Yallist.prototype.shift = function() { + if (!this.head) { + return void 0; + } + var res = this.head.value; + this.head = this.head.next; + if (this.head) { + this.head.prev = null; + } else { + this.tail = null; + } + this.length--; + return res; + }; + Yallist.prototype.forEach = function(fn2, thisp) { + thisp = thisp || this; + for (var walker = this.head, i2 = 0; walker !== null; i2++) { + fn2.call(thisp, walker.value, i2, this); + walker = walker.next; + } + }; + Yallist.prototype.forEachReverse = function(fn2, thisp) { + thisp = thisp || this; + for (var walker = this.tail, i2 = this.length - 1; walker !== null; i2--) { + fn2.call(thisp, walker.value, i2, this); + walker = walker.prev; + } + }; + Yallist.prototype.get = function(n2) { + for (var i2 = 0, walker = this.head; walker !== null && i2 < n2; i2++) { + walker = walker.next; + } + if (i2 === n2 && walker !== null) { + return walker.value; + } + }; + Yallist.prototype.getReverse = function(n2) { + for (var i2 = 0, walker = this.tail; walker !== null && i2 < n2; i2++) { + walker = walker.prev; + } + if (i2 === n2 && walker !== null) { + return walker.value; + } + }; + Yallist.prototype.map = function(fn2, thisp) { + thisp = thisp || this; + var res = new Yallist(); + for (var walker = this.head; walker !== null; ) { + res.push(fn2.call(thisp, walker.value, this)); + walker = walker.next; + } + return res; + }; + Yallist.prototype.mapReverse = function(fn2, thisp) { + thisp = thisp || this; + var res = new Yallist(); + for (var walker = this.tail; walker !== null; ) { + res.push(fn2.call(thisp, walker.value, this)); + walker = walker.prev; + } + return res; + }; + Yallist.prototype.reduce = function(fn2, initial) { + var acc; + var walker = this.head; + if (arguments.length > 1) { + acc = initial; + } else if (this.head) { + walker = this.head.next; + acc = this.head.value; + } else { + throw new TypeError("Reduce of empty list with no initial value"); + } + for (var i2 = 0; walker !== null; i2++) { + acc = fn2(acc, walker.value, i2); + walker = walker.next; + } + return acc; + }; + Yallist.prototype.reduceReverse = function(fn2, initial) { + var acc; + var walker = this.tail; + if (arguments.length > 1) { + acc = initial; + } else if (this.tail) { + walker = this.tail.prev; + acc = this.tail.value; + } else { + throw new TypeError("Reduce of empty list with no initial value"); + } + for (var i2 = this.length - 1; walker !== null; i2--) { + acc = fn2(acc, walker.value, i2); + walker = walker.prev; + } + return acc; + }; + Yallist.prototype.toArray = function() { + var arr = new Array(this.length); + for (var i2 = 0, walker = this.head; walker !== null; i2++) { + arr[i2] = walker.value; + walker = walker.next; + } + return arr; + }; + Yallist.prototype.toArrayReverse = function() { + var arr = new Array(this.length); + for (var i2 = 0, walker = this.tail; walker !== null; i2++) { + arr[i2] = walker.value; + walker = walker.prev; + } + return arr; + }; + Yallist.prototype.slice = function(from, to2) { + to2 = to2 || this.length; + if (to2 < 0) { + to2 += this.length; + } + from = from || 0; + if (from < 0) { + from += this.length; + } + var ret = new Yallist(); + if (to2 < from || to2 < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to2 > this.length) { + to2 = this.length; + } + for (var i2 = 0, walker = this.head; walker !== null && i2 < from; i2++) { + walker = walker.next; + } + for (; walker !== null && i2 < to2; i2++, walker = walker.next) { + ret.push(walker.value); + } + return ret; + }; + Yallist.prototype.sliceReverse = function(from, to2) { + to2 = to2 || this.length; + if (to2 < 0) { + to2 += this.length; + } + from = from || 0; + if (from < 0) { + from += this.length; + } + var ret = new Yallist(); + if (to2 < from || to2 < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to2 > this.length) { + to2 = this.length; + } + for (var i2 = this.length, walker = this.tail; walker !== null && i2 > to2; i2--) { + walker = walker.prev; + } + for (; walker !== null && i2 > from; i2--, walker = walker.prev) { + ret.push(walker.value); + } + return ret; + }; + Yallist.prototype.splice = function(start, deleteCount, ...nodes) { + if (start > this.length) { + start = this.length - 1; + } + if (start < 0) { + start = this.length + start; + } + for (var i2 = 0, walker = this.head; walker !== null && i2 < start; i2++) { + walker = walker.next; + } + var ret = []; + for (var i2 = 0; walker && i2 < deleteCount; i2++) { + ret.push(walker.value); + walker = this.removeNode(walker); + } + if (walker === null) { + walker = this.tail; + } + if (walker !== this.head && walker !== this.tail) { + walker = walker.prev; + } + for (var i2 = 0; i2 < nodes.length; i2++) { + walker = insert(this, walker, nodes[i2]); + } + return ret; + }; + Yallist.prototype.reverse = function() { + var head = this.head; + var tail = this.tail; + for (var walker = head; walker !== null; walker = walker.prev) { + var p2 = walker.prev; + walker.prev = walker.next; + walker.next = p2; + } + this.head = tail; + this.tail = head; + return this; + }; + function insert(self2, node, value) { + var inserted = node === self2.head ? new Node(value, null, node, self2) : new Node(value, node, node.next, self2); + if (inserted.next === null) { + self2.tail = inserted; + } + if (inserted.prev === null) { + self2.head = inserted; + } + self2.length++; + return inserted; + } + function push(self2, item) { + self2.tail = new Node(item, self2.tail, null, self2); + if (!self2.head) { + self2.head = self2.tail; + } + self2.length++; + } + function unshift(self2, item) { + self2.head = new Node(item, null, self2.head, self2); + if (!self2.tail) { + self2.tail = self2.head; + } + self2.length++; + } + function Node(value, prev, next, list3) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list3); + } + this.list = list3; + this.value = value; + if (prev) { + prev.next = this; + this.prev = prev; + } else { + this.prev = null; + } + if (next) { + next.prev = this; + this.next = next; + } else { + this.next = null; + } + } + try { + require_iterator()(Yallist); + } catch (er2) { + } + } +}); + +// node_modules/semver/node_modules/lru-cache/index.js +var require_lru_cache = __commonJS({ + "node_modules/semver/node_modules/lru-cache/index.js"(exports, module) { + "use strict"; + var Yallist = require_yallist(); + var MAX = Symbol("max"); + var LENGTH = Symbol("length"); + var LENGTH_CALCULATOR = Symbol("lengthCalculator"); + var ALLOW_STALE = Symbol("allowStale"); + var MAX_AGE = Symbol("maxAge"); + var DISPOSE = Symbol("dispose"); + var NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet"); + var LRU_LIST = Symbol("lruList"); + var CACHE = Symbol("cache"); + var UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet"); + var naiveLength = () => 1; + var LRUCache = class { + constructor(options) { + if (typeof options === "number") + options = { max: options }; + if (!options) + options = {}; + if (options.max && (typeof options.max !== "number" || options.max < 0)) + throw new TypeError("max must be a non-negative number"); + const max = this[MAX] = options.max || Infinity; + const lc = options.length || naiveLength; + this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc; + this[ALLOW_STALE] = options.stale || false; + if (options.maxAge && typeof options.maxAge !== "number") + throw new TypeError("maxAge must be a number"); + this[MAX_AGE] = options.maxAge || 0; + this[DISPOSE] = options.dispose; + this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false; + this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false; + this.reset(); + } + // resize the cache when the max changes. + set max(mL) { + if (typeof mL !== "number" || mL < 0) + throw new TypeError("max must be a non-negative number"); + this[MAX] = mL || Infinity; + trim(this); + } + get max() { + return this[MAX]; + } + set allowStale(allowStale) { + this[ALLOW_STALE] = !!allowStale; + } + get allowStale() { + return this[ALLOW_STALE]; + } + set maxAge(mA) { + if (typeof mA !== "number") + throw new TypeError("maxAge must be a non-negative number"); + this[MAX_AGE] = mA; + trim(this); + } + get maxAge() { + return this[MAX_AGE]; + } + // resize the cache when the lengthCalculator changes. + set lengthCalculator(lC) { + if (typeof lC !== "function") + lC = naiveLength; + if (lC !== this[LENGTH_CALCULATOR]) { + this[LENGTH_CALCULATOR] = lC; + this[LENGTH] = 0; + this[LRU_LIST].forEach((hit) => { + hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key); + this[LENGTH] += hit.length; + }); + } + trim(this); + } + get lengthCalculator() { + return this[LENGTH_CALCULATOR]; + } + get length() { + return this[LENGTH]; + } + get itemCount() { + return this[LRU_LIST].length; + } + rforEach(fn2, thisp) { + thisp = thisp || this; + for (let walker = this[LRU_LIST].tail; walker !== null; ) { + const prev = walker.prev; + forEachStep(this, fn2, walker, thisp); + walker = prev; + } + } + forEach(fn2, thisp) { + thisp = thisp || this; + for (let walker = this[LRU_LIST].head; walker !== null; ) { + const next = walker.next; + forEachStep(this, fn2, walker, thisp); + walker = next; + } + } + keys() { + return this[LRU_LIST].toArray().map((k2) => k2.key); + } + values() { + return this[LRU_LIST].toArray().map((k2) => k2.value); + } + reset() { + if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) { + this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value)); + } + this[CACHE] = /* @__PURE__ */ new Map(); + this[LRU_LIST] = new Yallist(); + this[LENGTH] = 0; + } + dump() { + return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : { + k: hit.key, + v: hit.value, + e: hit.now + (hit.maxAge || 0) + }).toArray().filter((h2) => h2); + } + dumpLru() { + return this[LRU_LIST]; + } + set(key, value, maxAge) { + maxAge = maxAge || this[MAX_AGE]; + if (maxAge && typeof maxAge !== "number") + throw new TypeError("maxAge must be a number"); + const now = maxAge ? Date.now() : 0; + const len = this[LENGTH_CALCULATOR](value, key); + if (this[CACHE].has(key)) { + if (len > this[MAX]) { + del(this, this[CACHE].get(key)); + return false; + } + const node = this[CACHE].get(key); + const item = node.value; + if (this[DISPOSE]) { + if (!this[NO_DISPOSE_ON_SET]) + this[DISPOSE](key, item.value); + } + item.now = now; + item.maxAge = maxAge; + item.value = value; + this[LENGTH] += len - item.length; + item.length = len; + this.get(key); + trim(this); + return true; + } + const hit = new Entry(key, value, len, now, maxAge); + if (hit.length > this[MAX]) { + if (this[DISPOSE]) + this[DISPOSE](key, value); + return false; + } + this[LENGTH] += hit.length; + this[LRU_LIST].unshift(hit); + this[CACHE].set(key, this[LRU_LIST].head); + trim(this); + return true; + } + has(key) { + if (!this[CACHE].has(key)) + return false; + const hit = this[CACHE].get(key).value; + return !isStale(this, hit); + } + get(key) { + return get(this, key, true); + } + peek(key) { + return get(this, key, false); + } + pop() { + const node = this[LRU_LIST].tail; + if (!node) + return null; + del(this, node); + return node.value; + } + del(key) { + del(this, this[CACHE].get(key)); + } + load(arr) { + this.reset(); + const now = Date.now(); + for (let l2 = arr.length - 1; l2 >= 0; l2--) { + const hit = arr[l2]; + const expiresAt = hit.e || 0; + if (expiresAt === 0) + this.set(hit.k, hit.v); + else { + const maxAge = expiresAt - now; + if (maxAge > 0) { + this.set(hit.k, hit.v, maxAge); + } + } + } + } + prune() { + this[CACHE].forEach((value, key) => get(this, key, false)); + } + }; + var get = (self2, key, doUse) => { + const node = self2[CACHE].get(key); + if (node) { + const hit = node.value; + if (isStale(self2, hit)) { + del(self2, node); + if (!self2[ALLOW_STALE]) + return void 0; + } else { + if (doUse) { + if (self2[UPDATE_AGE_ON_GET]) + node.value.now = Date.now(); + self2[LRU_LIST].unshiftNode(node); + } + } + return hit.value; + } + }; + var isStale = (self2, hit) => { + if (!hit || !hit.maxAge && !self2[MAX_AGE]) + return false; + const diff = Date.now() - hit.now; + return hit.maxAge ? diff > hit.maxAge : self2[MAX_AGE] && diff > self2[MAX_AGE]; + }; + var trim = (self2) => { + if (self2[LENGTH] > self2[MAX]) { + for (let walker = self2[LRU_LIST].tail; self2[LENGTH] > self2[MAX] && walker !== null; ) { + const prev = walker.prev; + del(self2, walker); + walker = prev; + } + } + }; + var del = (self2, node) => { + if (node) { + const hit = node.value; + if (self2[DISPOSE]) + self2[DISPOSE](hit.key, hit.value); + self2[LENGTH] -= hit.length; + self2[CACHE].delete(hit.key); + self2[LRU_LIST].removeNode(node); + } + }; + var Entry = class { + constructor(key, value, length, now, maxAge) { + this.key = key; + this.value = value; + this.length = length; + this.now = now; + this.maxAge = maxAge || 0; + } + }; + var forEachStep = (self2, fn2, node, thisp) => { + let hit = node.value; + if (isStale(self2, hit)) { + del(self2, node); + if (!self2[ALLOW_STALE]) + hit = void 0; + } + if (hit) + fn2.call(thisp, hit.value, hit.key, self2); + }; + module.exports = LRUCache; + } +}); + +// node_modules/semver/classes/range.js +var require_range = __commonJS({ + "node_modules/semver/classes/range.js"(exports, module) { + var Range3 = class _Range { + constructor(range2, options) { + options = parseOptions(options); + if (range2 instanceof _Range) { + if (range2.loose === !!options.loose && range2.includePrerelease === !!options.includePrerelease) { + return range2; + } else { + return new _Range(range2.raw, options); + } + } + if (range2 instanceof Comparator) { + this.raw = range2.value; + this.set = [[range2]]; + this.format(); + return this; + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range2.trim().split(/\s+/).join(" "); + this.set = this.raw.split("||").map((r2) => this.parseRange(r2.trim())).filter((c2) => c2.length); + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`); + } + if (this.set.length > 1) { + const first = this.set[0]; + this.set = this.set.filter((c2) => !isNullSet(c2[0])); + if (this.set.length === 0) { + this.set = [first]; + } else if (this.set.length > 1) { + for (const c2 of this.set) { + if (c2.length === 1 && isAny(c2[0])) { + this.set = [c2]; + break; + } + } + } + } + this.format(); + } + format() { + this.range = this.set.map((comps) => comps.join(" ").trim()).join("||").trim(); + return this.range; + } + toString() { + return this.range; + } + parseRange(range2) { + const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); + const memoKey = memoOpts + ":" + range2; + const cached = cache.get(memoKey); + if (cached) { + return cached; + } + const loose = this.options.loose; + const hr2 = loose ? re3[t2.HYPHENRANGELOOSE] : re3[t2.HYPHENRANGE]; + range2 = range2.replace(hr2, hyphenReplace(this.options.includePrerelease)); + debug3("hyphen replace", range2); + range2 = range2.replace(re3[t2.COMPARATORTRIM], comparatorTrimReplace); + debug3("comparator trim", range2); + range2 = range2.replace(re3[t2.TILDETRIM], tildeTrimReplace); + debug3("tilde trim", range2); + range2 = range2.replace(re3[t2.CARETTRIM], caretTrimReplace); + debug3("caret trim", range2); + let rangeList = range2.split(" ").map((comp26) => parseComparator(comp26, this.options)).join(" ").split(/\s+/).map((comp26) => replaceGTE0(comp26, this.options)); + if (loose) { + rangeList = rangeList.filter((comp26) => { + debug3("loose invalid filter", comp26, this.options); + return !!comp26.match(re3[t2.COMPARATORLOOSE]); + }); + } + debug3("range list", rangeList); + const rangeMap = /* @__PURE__ */ new Map(); + const comparators = rangeList.map((comp26) => new Comparator(comp26, this.options)); + for (const comp26 of comparators) { + if (isNullSet(comp26)) { + return [comp26]; + } + rangeMap.set(comp26.value, comp26); + } + if (rangeMap.size > 1 && rangeMap.has("")) { + rangeMap.delete(""); + } + const result = [...rangeMap.values()]; + cache.set(memoKey, result); + return result; + } + intersects(range2, options) { + if (!(range2 instanceof _Range)) { + throw new TypeError("a Range is required"); + } + return this.set.some((thisComparators) => { + return isSatisfiable(thisComparators, options) && range2.set.some((rangeComparators) => { + return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options); + }); + }); + }); + }); + } + // if ANY of the sets match ALL of its comparators, then pass + test(version4) { + if (!version4) { + return false; + } + if (typeof version4 === "string") { + try { + version4 = new SemVer(version4, this.options); + } catch (er2) { + return false; + } + } + for (let i2 = 0; i2 < this.set.length; i2++) { + if (testSet(this.set[i2], version4, this.options)) { + return true; + } + } + return false; + } + }; + module.exports = Range3; + var LRU = require_lru_cache(); + var cache = new LRU({ max: 1e3 }); + var parseOptions = require_parse_options(); + var Comparator = require_comparator(); + var debug3 = require_debug(); + var SemVer = require_semver(); + var { + safeRe: re3, + t: t2, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace + } = require_re(); + var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants5(); + var isNullSet = (c2) => c2.value === "<0.0.0-0"; + var isAny = (c2) => c2.value === ""; + var isSatisfiable = (comparators, options) => { + let result = true; + const remainingComparators = comparators.slice(); + let testComparator = remainingComparators.pop(); + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options); + }); + testComparator = remainingComparators.pop(); + } + return result; + }; + var parseComparator = (comp26, options) => { + debug3("comp", comp26, options); + comp26 = replaceCarets(comp26, options); + debug3("caret", comp26); + comp26 = replaceTildes(comp26, options); + debug3("tildes", comp26); + comp26 = replaceXRanges(comp26, options); + debug3("xrange", comp26); + comp26 = replaceStars(comp26, options); + debug3("stars", comp26); + return comp26; + }; + var isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; + var replaceTildes = (comp26, options) => { + return comp26.trim().split(/\s+/).map((c2) => replaceTilde(c2, options)).join(" "); + }; + var replaceTilde = (comp26, options) => { + const r2 = options.loose ? re3[t2.TILDELOOSE] : re3[t2.TILDE]; + return comp26.replace(r2, (_2, M2, m3, p2, pr2) => { + debug3("tilde", comp26, _2, M2, m3, p2, pr2); + let ret; + if (isX(M2)) { + ret = ""; + } else if (isX(m3)) { + ret = `>=${M2}.0.0 <${+M2 + 1}.0.0-0`; + } else if (isX(p2)) { + ret = `>=${M2}.${m3}.0 <${M2}.${+m3 + 1}.0-0`; + } else if (pr2) { + debug3("replaceTilde pr", pr2); + ret = `>=${M2}.${m3}.${p2}-${pr2} <${M2}.${+m3 + 1}.0-0`; + } else { + ret = `>=${M2}.${m3}.${p2} <${M2}.${+m3 + 1}.0-0`; + } + debug3("tilde return", ret); + return ret; + }); + }; + var replaceCarets = (comp26, options) => { + return comp26.trim().split(/\s+/).map((c2) => replaceCaret(c2, options)).join(" "); + }; + var replaceCaret = (comp26, options) => { + debug3("caret", comp26, options); + const r2 = options.loose ? re3[t2.CARETLOOSE] : re3[t2.CARET]; + const z2 = options.includePrerelease ? "-0" : ""; + return comp26.replace(r2, (_2, M2, m3, p2, pr2) => { + debug3("caret", comp26, _2, M2, m3, p2, pr2); + let ret; + if (isX(M2)) { + ret = ""; + } else if (isX(m3)) { + ret = `>=${M2}.0.0${z2} <${+M2 + 1}.0.0-0`; + } else if (isX(p2)) { + if (M2 === "0") { + ret = `>=${M2}.${m3}.0${z2} <${M2}.${+m3 + 1}.0-0`; + } else { + ret = `>=${M2}.${m3}.0${z2} <${+M2 + 1}.0.0-0`; + } + } else if (pr2) { + debug3("replaceCaret pr", pr2); + if (M2 === "0") { + if (m3 === "0") { + ret = `>=${M2}.${m3}.${p2}-${pr2} <${M2}.${m3}.${+p2 + 1}-0`; + } else { + ret = `>=${M2}.${m3}.${p2}-${pr2} <${M2}.${+m3 + 1}.0-0`; + } + } else { + ret = `>=${M2}.${m3}.${p2}-${pr2} <${+M2 + 1}.0.0-0`; + } + } else { + debug3("no pr"); + if (M2 === "0") { + if (m3 === "0") { + ret = `>=${M2}.${m3}.${p2}${z2} <${M2}.${m3}.${+p2 + 1}-0`; + } else { + ret = `>=${M2}.${m3}.${p2}${z2} <${M2}.${+m3 + 1}.0-0`; + } + } else { + ret = `>=${M2}.${m3}.${p2} <${+M2 + 1}.0.0-0`; + } + } + debug3("caret return", ret); + return ret; + }); + }; + var replaceXRanges = (comp26, options) => { + debug3("replaceXRanges", comp26, options); + return comp26.split(/\s+/).map((c2) => replaceXRange(c2, options)).join(" "); + }; + var replaceXRange = (comp26, options) => { + comp26 = comp26.trim(); + const r2 = options.loose ? re3[t2.XRANGELOOSE] : re3[t2.XRANGE]; + return comp26.replace(r2, (ret, gtlt, M2, m3, p2, pr2) => { + debug3("xRange", comp26, ret, gtlt, M2, m3, p2, pr2); + const xM = isX(M2); + const xm = xM || isX(m3); + const xp = xm || isX(p2); + const anyX = xp; + if (gtlt === "=" && anyX) { + gtlt = ""; + } + pr2 = options.includePrerelease ? "-0" : ""; + if (xM) { + if (gtlt === ">" || gtlt === "<") { + ret = "<0.0.0-0"; + } else { + ret = "*"; + } + } else if (gtlt && anyX) { + if (xm) { + m3 = 0; + } + p2 = 0; + if (gtlt === ">") { + gtlt = ">="; + if (xm) { + M2 = +M2 + 1; + m3 = 0; + p2 = 0; + } else { + m3 = +m3 + 1; + p2 = 0; + } + } else if (gtlt === "<=") { + gtlt = "<"; + if (xm) { + M2 = +M2 + 1; + } else { + m3 = +m3 + 1; + } + } + if (gtlt === "<") { + pr2 = "-0"; + } + ret = `${gtlt + M2}.${m3}.${p2}${pr2}`; + } else if (xm) { + ret = `>=${M2}.0.0${pr2} <${+M2 + 1}.0.0-0`; + } else if (xp) { + ret = `>=${M2}.${m3}.0${pr2} <${M2}.${+m3 + 1}.0-0`; + } + debug3("xRange return", ret); + return ret; + }); + }; + var replaceStars = (comp26, options) => { + debug3("replaceStars", comp26, options); + return comp26.trim().replace(re3[t2.STAR], ""); + }; + var replaceGTE0 = (comp26, options) => { + debug3("replaceGTE0", comp26, options); + return comp26.trim().replace(re3[options.includePrerelease ? t2.GTE0PRE : t2.GTE0], ""); + }; + var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to2, tM, tm, tp, tpr, tb) => { + if (isX(fM)) { + from = ""; + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? "-0" : ""}`; + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`; + } else if (fpr) { + from = `>=${from}`; + } else { + from = `>=${from}${incPr ? "-0" : ""}`; + } + if (isX(tM)) { + to2 = ""; + } else if (isX(tm)) { + to2 = `<${+tM + 1}.0.0-0`; + } else if (isX(tp)) { + to2 = `<${tM}.${+tm + 1}.0-0`; + } else if (tpr) { + to2 = `<=${tM}.${tm}.${tp}-${tpr}`; + } else if (incPr) { + to2 = `<${tM}.${tm}.${+tp + 1}-0`; + } else { + to2 = `<=${to2}`; + } + return `${from} ${to2}`.trim(); + }; + var testSet = (set2, version4, options) => { + for (let i2 = 0; i2 < set2.length; i2++) { + if (!set2[i2].test(version4)) { + return false; + } + } + if (version4.prerelease.length && !options.includePrerelease) { + for (let i2 = 0; i2 < set2.length; i2++) { + debug3(set2[i2].semver); + if (set2[i2].semver === Comparator.ANY) { + continue; + } + if (set2[i2].semver.prerelease.length > 0) { + const allowed = set2[i2].semver; + if (allowed.major === version4.major && allowed.minor === version4.minor && allowed.patch === version4.patch) { + return true; + } + } + } + return false; + } + return true; + }; + } +}); + +// node_modules/semver/classes/comparator.js +var require_comparator = __commonJS({ + "node_modules/semver/classes/comparator.js"(exports, module) { + var ANY = Symbol("SemVer ANY"); + var Comparator = class _Comparator { + static get ANY() { + return ANY; + } + constructor(comp26, options) { + options = parseOptions(options); + if (comp26 instanceof _Comparator) { + if (comp26.loose === !!options.loose) { + return comp26; + } else { + comp26 = comp26.value; + } + } + comp26 = comp26.trim().split(/\s+/).join(" "); + debug3("comparator", comp26, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp26); + if (this.semver === ANY) { + this.value = ""; + } else { + this.value = this.operator + this.semver.version; + } + debug3("comp", this); + } + parse(comp26) { + const r2 = this.options.loose ? re3[t2.COMPARATORLOOSE] : re3[t2.COMPARATOR]; + const m3 = comp26.match(r2); + if (!m3) { + throw new TypeError(`Invalid comparator: ${comp26}`); + } + this.operator = m3[1] !== void 0 ? m3[1] : ""; + if (this.operator === "=") { + this.operator = ""; + } + if (!m3[2]) { + this.semver = ANY; + } else { + this.semver = new SemVer(m3[2], this.options.loose); + } + } + toString() { + return this.value; + } + test(version4) { + debug3("Comparator.test", version4, this.options.loose); + if (this.semver === ANY || version4 === ANY) { + return true; + } + if (typeof version4 === "string") { + try { + version4 = new SemVer(version4, this.options); + } catch (er2) { + return false; + } + } + return cmp(version4, this.operator, this.semver, this.options); + } + intersects(comp26, options) { + if (!(comp26 instanceof _Comparator)) { + throw new TypeError("a Comparator is required"); + } + if (this.operator === "") { + if (this.value === "") { + return true; + } + return new Range3(comp26.value, options).test(this.value); + } else if (comp26.operator === "") { + if (comp26.value === "") { + return true; + } + return new Range3(this.value, options).test(comp26.semver); + } + options = parseOptions(options); + if (options.includePrerelease && (this.value === "<0.0.0-0" || comp26.value === "<0.0.0-0")) { + return false; + } + if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp26.value.startsWith("<0.0.0"))) { + return false; + } + if (this.operator.startsWith(">") && comp26.operator.startsWith(">")) { + return true; + } + if (this.operator.startsWith("<") && comp26.operator.startsWith("<")) { + return true; + } + if (this.semver.version === comp26.semver.version && this.operator.includes("=") && comp26.operator.includes("=")) { + return true; + } + if (cmp(this.semver, "<", comp26.semver, options) && this.operator.startsWith(">") && comp26.operator.startsWith("<")) { + return true; + } + if (cmp(this.semver, ">", comp26.semver, options) && this.operator.startsWith("<") && comp26.operator.startsWith(">")) { + return true; + } + return false; + } + }; + module.exports = Comparator; + var parseOptions = require_parse_options(); + var { safeRe: re3, t: t2 } = require_re(); + var cmp = require_cmp(); + var debug3 = require_debug(); + var SemVer = require_semver(); + var Range3 = require_range(); + } +}); + +// node_modules/semver/functions/satisfies.js +var require_satisfies = __commonJS({ + "node_modules/semver/functions/satisfies.js"(exports, module) { + var Range3 = require_range(); + var satisfies = (version4, range2, options) => { + try { + range2 = new Range3(range2, options); + } catch (er2) { + return false; + } + return range2.test(version4); + }; + module.exports = satisfies; + } +}); + +// node_modules/semver/ranges/to-comparators.js +var require_to_comparators = __commonJS({ + "node_modules/semver/ranges/to-comparators.js"(exports, module) { + var Range3 = require_range(); + var toComparators = (range2, options) => new Range3(range2, options).set.map((comp26) => comp26.map((c2) => c2.value).join(" ").trim().split(" ")); + module.exports = toComparators; + } +}); + +// node_modules/semver/ranges/max-satisfying.js +var require_max_satisfying = __commonJS({ + "node_modules/semver/ranges/max-satisfying.js"(exports, module) { + var SemVer = require_semver(); + var Range3 = require_range(); + var maxSatisfying = (versions, range2, options) => { + let max = null; + let maxSV = null; + let rangeObj = null; + try { + rangeObj = new Range3(range2, options); + } catch (er2) { + return null; + } + versions.forEach((v2) => { + if (rangeObj.test(v2)) { + if (!max || maxSV.compare(v2) === -1) { + max = v2; + maxSV = new SemVer(max, options); + } + } + }); + return max; + }; + module.exports = maxSatisfying; + } +}); + +// node_modules/semver/ranges/min-satisfying.js +var require_min_satisfying = __commonJS({ + "node_modules/semver/ranges/min-satisfying.js"(exports, module) { + var SemVer = require_semver(); + var Range3 = require_range(); + var minSatisfying = (versions, range2, options) => { + let min = null; + let minSV = null; + let rangeObj = null; + try { + rangeObj = new Range3(range2, options); + } catch (er2) { + return null; + } + versions.forEach((v2) => { + if (rangeObj.test(v2)) { + if (!min || minSV.compare(v2) === 1) { + min = v2; + minSV = new SemVer(min, options); + } + } + }); + return min; + }; + module.exports = minSatisfying; + } +}); + +// node_modules/semver/ranges/min-version.js +var require_min_version = __commonJS({ + "node_modules/semver/ranges/min-version.js"(exports, module) { + var SemVer = require_semver(); + var Range3 = require_range(); + var gt2 = require_gt(); + var minVersion = (range2, loose) => { + range2 = new Range3(range2, loose); + let minver = new SemVer("0.0.0"); + if (range2.test(minver)) { + return minver; + } + minver = new SemVer("0.0.0-0"); + if (range2.test(minver)) { + return minver; + } + minver = null; + for (let i2 = 0; i2 < range2.set.length; ++i2) { + const comparators = range2.set[i2]; + let setMin = null; + comparators.forEach((comparator) => { + const compver = new SemVer(comparator.semver.version); + switch (comparator.operator) { + case ">": + if (compver.prerelease.length === 0) { + compver.patch++; + } else { + compver.prerelease.push(0); + } + compver.raw = compver.format(); + case "": + case ">=": + if (!setMin || gt2(compver, setMin)) { + setMin = compver; + } + break; + case "<": + case "<=": + break; + default: + throw new Error(`Unexpected operation: ${comparator.operator}`); + } + }); + if (setMin && (!minver || gt2(minver, setMin))) { + minver = setMin; + } + } + if (minver && range2.test(minver)) { + return minver; + } + return null; + }; + module.exports = minVersion; + } +}); + +// node_modules/semver/ranges/valid.js +var require_valid2 = __commonJS({ + "node_modules/semver/ranges/valid.js"(exports, module) { + var Range3 = require_range(); + var validRange = (range2, options) => { + try { + return new Range3(range2, options).range || "*"; + } catch (er2) { + return null; + } + }; + module.exports = validRange; + } +}); + +// node_modules/semver/ranges/outside.js +var require_outside = __commonJS({ + "node_modules/semver/ranges/outside.js"(exports, module) { + var SemVer = require_semver(); + var Comparator = require_comparator(); + var { ANY } = Comparator; + var Range3 = require_range(); + var satisfies = require_satisfies(); + var gt2 = require_gt(); + var lt2 = require_lt(); + var lte = require_lte(); + var gte = require_gte(); + var outside = (version4, range2, hilo, options) => { + version4 = new SemVer(version4, options); + range2 = new Range3(range2, options); + let gtfn, ltefn, ltfn, comp26, ecomp; + switch (hilo) { + case ">": + gtfn = gt2; + ltefn = lte; + ltfn = lt2; + comp26 = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt2; + ltefn = gte; + ltfn = gt2; + comp26 = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + if (satisfies(version4, range2, options)) { + return false; + } + for (let i2 = 0; i2 < range2.set.length; ++i2) { + const comparators = range2.set[i2]; + let high = null; + let low = null; + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator(">=0.0.0"); + } + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator; + } + }); + if (high.operator === comp26 || high.operator === ecomp) { + return false; + } + if ((!low.operator || low.operator === comp26) && ltefn(version4, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version4, low.semver)) { + return false; + } + } + return true; + }; + module.exports = outside; + } +}); + +// node_modules/semver/ranges/gtr.js +var require_gtr = __commonJS({ + "node_modules/semver/ranges/gtr.js"(exports, module) { + var outside = require_outside(); + var gtr = (version4, range2, options) => outside(version4, range2, ">", options); + module.exports = gtr; + } +}); + +// node_modules/semver/ranges/ltr.js +var require_ltr = __commonJS({ + "node_modules/semver/ranges/ltr.js"(exports, module) { + var outside = require_outside(); + var ltr = (version4, range2, options) => outside(version4, range2, "<", options); + module.exports = ltr; + } +}); + +// node_modules/semver/ranges/intersects.js +var require_intersects = __commonJS({ + "node_modules/semver/ranges/intersects.js"(exports, module) { + var Range3 = require_range(); + var intersects = (r1, r2, options) => { + r1 = new Range3(r1, options); + r2 = new Range3(r2, options); + return r1.intersects(r2, options); + }; + module.exports = intersects; + } +}); + +// node_modules/semver/ranges/simplify.js +var require_simplify = __commonJS({ + "node_modules/semver/ranges/simplify.js"(exports, module) { + var satisfies = require_satisfies(); + var compare = require_compare(); + module.exports = (versions, range2, options) => { + const set2 = []; + let first = null; + let prev = null; + const v2 = versions.sort((a2, b2) => compare(a2, b2, options)); + for (const version4 of v2) { + const included = satisfies(version4, range2, options); + if (included) { + prev = version4; + if (!first) { + first = version4; + } + } else { + if (prev) { + set2.push([first, prev]); + } + prev = null; + first = null; + } + } + if (first) { + set2.push([first, null]); + } + const ranges = []; + for (const [min, max] of set2) { + if (min === max) { + ranges.push(min); + } else if (!max && min === v2[0]) { + ranges.push("*"); + } else if (!max) { + ranges.push(`>=${min}`); + } else if (min === v2[0]) { + ranges.push(`<=${max}`); + } else { + ranges.push(`${min} - ${max}`); + } + } + const simplified = ranges.join(" || "); + const original = typeof range2.raw === "string" ? range2.raw : String(range2); + return simplified.length < original.length ? simplified : range2; + }; + } +}); + +// node_modules/semver/ranges/subset.js +var require_subset = __commonJS({ + "node_modules/semver/ranges/subset.js"(exports, module) { + var Range3 = require_range(); + var Comparator = require_comparator(); + var { ANY } = Comparator; + var satisfies = require_satisfies(); + var compare = require_compare(); + var subset = (sub, dom, options = {}) => { + if (sub === dom) { + return true; + } + sub = new Range3(sub, options); + dom = new Range3(dom, options); + let sawNonNull = false; + OUTER: + for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options); + sawNonNull = sawNonNull || isSub !== null; + if (isSub) { + continue OUTER; + } + } + if (sawNonNull) { + return false; + } + } + return true; + }; + var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")]; + var minimumVersion = [new Comparator(">=0.0.0")]; + var simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true; + } + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) { + return true; + } else if (options.includePrerelease) { + sub = minimumVersionWithPreRelease; + } else { + sub = minimumVersion; + } + } + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true; + } else { + dom = minimumVersion; + } + } + const eqSet = /* @__PURE__ */ new Set(); + let gt2, lt2; + for (const c2 of sub) { + if (c2.operator === ">" || c2.operator === ">=") { + gt2 = higherGT(gt2, c2, options); + } else if (c2.operator === "<" || c2.operator === "<=") { + lt2 = lowerLT(lt2, c2, options); + } else { + eqSet.add(c2.semver); + } + } + if (eqSet.size > 1) { + return null; + } + let gtltComp; + if (gt2 && lt2) { + gtltComp = compare(gt2.semver, lt2.semver, options); + if (gtltComp > 0) { + return null; + } else if (gtltComp === 0 && (gt2.operator !== ">=" || lt2.operator !== "<=")) { + return null; + } + } + for (const eq of eqSet) { + if (gt2 && !satisfies(eq, String(gt2), options)) { + return null; + } + if (lt2 && !satisfies(eq, String(lt2), options)) { + return null; + } + for (const c2 of dom) { + if (!satisfies(eq, String(c2), options)) { + return false; + } + } + return true; + } + let higher, lower; + let hasDomLT, hasDomGT; + let needDomLTPre = lt2 && !options.includePrerelease && lt2.semver.prerelease.length ? lt2.semver : false; + let needDomGTPre = gt2 && !options.includePrerelease && gt2.semver.prerelease.length ? gt2.semver : false; + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt2.operator === "<" && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false; + } + for (const c2 of dom) { + hasDomGT = hasDomGT || c2.operator === ">" || c2.operator === ">="; + hasDomLT = hasDomLT || c2.operator === "<" || c2.operator === "<="; + if (gt2) { + if (needDomGTPre) { + if (c2.semver.prerelease && c2.semver.prerelease.length && c2.semver.major === needDomGTPre.major && c2.semver.minor === needDomGTPre.minor && c2.semver.patch === needDomGTPre.patch) { + needDomGTPre = false; + } + } + if (c2.operator === ">" || c2.operator === ">=") { + higher = higherGT(gt2, c2, options); + if (higher === c2 && higher !== gt2) { + return false; + } + } else if (gt2.operator === ">=" && !satisfies(gt2.semver, String(c2), options)) { + return false; + } + } + if (lt2) { + if (needDomLTPre) { + if (c2.semver.prerelease && c2.semver.prerelease.length && c2.semver.major === needDomLTPre.major && c2.semver.minor === needDomLTPre.minor && c2.semver.patch === needDomLTPre.patch) { + needDomLTPre = false; + } + } + if (c2.operator === "<" || c2.operator === "<=") { + lower = lowerLT(lt2, c2, options); + if (lower === c2 && lower !== lt2) { + return false; + } + } else if (lt2.operator === "<=" && !satisfies(lt2.semver, String(c2), options)) { + return false; + } + } + if (!c2.operator && (lt2 || gt2) && gtltComp !== 0) { + return false; + } + } + if (gt2 && hasDomLT && !lt2 && gtltComp !== 0) { + return false; + } + if (lt2 && hasDomGT && !gt2 && gtltComp !== 0) { + return false; + } + if (needDomGTPre || needDomLTPre) { + return false; + } + return true; + }; + var higherGT = (a2, b2, options) => { + if (!a2) { + return b2; + } + const comp26 = compare(a2.semver, b2.semver, options); + return comp26 > 0 ? a2 : comp26 < 0 ? b2 : b2.operator === ">" && a2.operator === ">=" ? b2 : a2; + }; + var lowerLT = (a2, b2, options) => { + if (!a2) { + return b2; + } + const comp26 = compare(a2.semver, b2.semver, options); + return comp26 < 0 ? a2 : comp26 > 0 ? b2 : b2.operator === "<" && a2.operator === "<=" ? b2 : a2; + }; + module.exports = subset; + } +}); + +// node_modules/semver/index.js +var require_semver2 = __commonJS({ + "node_modules/semver/index.js"(exports, module) { + var internalRe = require_re(); + var constants = require_constants5(); + var SemVer = require_semver(); + var identifiers = require_identifiers(); + var parse5 = require_parse2(); + var valid = require_valid(); + var clean = require_clean(); + var inc = require_inc(); + var diff = require_diff(); + var major2 = require_major(); + var minor = require_minor(); + var patch2 = require_patch(); + var prerelease = require_prerelease(); + var compare = require_compare(); + var rcompare = require_rcompare(); + var compareLoose = require_compare_loose(); + var compareBuild = require_compare_build(); + var sort = require_sort(); + var rsort = require_rsort(); + var gt2 = require_gt(); + var lt2 = require_lt(); + var eq = require_eq(); + var neq = require_neq(); + var gte = require_gte(); + var lte = require_lte(); + var cmp = require_cmp(); + var coerce = require_coerce(); + var Comparator = require_comparator(); + var Range3 = require_range(); + var satisfies = require_satisfies(); + var toComparators = require_to_comparators(); + var maxSatisfying = require_max_satisfying(); + var minSatisfying = require_min_satisfying(); + var minVersion = require_min_version(); + var validRange = require_valid2(); + var outside = require_outside(); + var gtr = require_gtr(); + var ltr = require_ltr(); + var intersects = require_intersects(); + var simplifyRange = require_simplify(); + var subset = require_subset(); + module.exports = { + parse: parse5, + valid, + clean, + inc, + diff, + major: major2, + minor, + patch: patch2, + prerelease, + compare, + rcompare, + compareLoose, + compareBuild, + sort, + rsort, + gt: gt2, + lt: lt2, + eq, + neq, + gte, + lte, + cmp, + coerce, + Comparator, + Range: Range3, + satisfies, + toComparators, + maxSatisfying, + minSatisfying, + minVersion, + validRange, + outside, + gtr, + ltr, + intersects, + simplifyRange, + subset, + SemVer, + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants.RELEASE_TYPES, + compareIdentifiers: identifiers.compareIdentifiers, + rcompareIdentifiers: identifiers.rcompareIdentifiers + }; + } +}); + +// node_modules/uuid/lib/rng.js +var require_rng = __commonJS({ + "node_modules/uuid/lib/rng.js"(exports, module) { + var crypto5 = __require("crypto"); + module.exports = function nodeRNG() { + return crypto5.randomBytes(16); + }; + } +}); + +// node_modules/uuid/lib/bytesToUuid.js +var require_bytesToUuid = __commonJS({ + "node_modules/uuid/lib/bytesToUuid.js"(exports, module) { + var byteToHex3 = []; + for (i2 = 0; i2 < 256; ++i2) { + byteToHex3[i2] = (i2 + 256).toString(16).substr(1); + } + var i2; + function bytesToUuid(buf, offset) { + var i3 = offset || 0; + var bth = byteToHex3; + return [ + bth[buf[i3++]], + bth[buf[i3++]], + bth[buf[i3++]], + bth[buf[i3++]], + "-", + bth[buf[i3++]], + bth[buf[i3++]], + "-", + bth[buf[i3++]], + bth[buf[i3++]], + "-", + bth[buf[i3++]], + bth[buf[i3++]], + "-", + bth[buf[i3++]], + bth[buf[i3++]], + bth[buf[i3++]], + bth[buf[i3++]], + bth[buf[i3++]], + bth[buf[i3++]] + ].join(""); + } + module.exports = bytesToUuid; + } +}); + +// node_modules/uuid/v1.js +var require_v1 = __commonJS({ + "node_modules/uuid/v1.js"(exports, module) { + var rng3 = require_rng(); + var bytesToUuid = require_bytesToUuid(); + var _nodeId2; + var _clockseq2; + var _lastMSecs2 = 0; + var _lastNSecs2 = 0; + function v12(options, buf, offset) { + var i2 = buf && offset || 0; + var b2 = buf || []; + options = options || {}; + var node = options.node || _nodeId2; + var clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq2; + if (node == null || clockseq == null) { + var seedBytes = rng3(); + if (node == null) { + node = _nodeId2 = [ + seedBytes[0] | 1, + seedBytes[1], + seedBytes[2], + seedBytes[3], + seedBytes[4], + seedBytes[5] + ]; + } + if (clockseq == null) { + clockseq = _clockseq2 = (seedBytes[6] << 8 | seedBytes[7]) & 16383; + } + } + var msecs = options.msecs !== void 0 ? options.msecs : (/* @__PURE__ */ new Date()).getTime(); + var nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs2 + 1; + var dt2 = msecs - _lastMSecs2 + (nsecs - _lastNSecs2) / 1e4; + if (dt2 < 0 && options.clockseq === void 0) { + clockseq = clockseq + 1 & 16383; + } + if ((dt2 < 0 || msecs > _lastMSecs2) && options.nsecs === void 0) { + nsecs = 0; + } + if (nsecs >= 1e4) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + _lastMSecs2 = msecs; + _lastNSecs2 = nsecs; + _clockseq2 = clockseq; + msecs += 122192928e5; + var tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296; + b2[i2++] = tl >>> 24 & 255; + b2[i2++] = tl >>> 16 & 255; + b2[i2++] = tl >>> 8 & 255; + b2[i2++] = tl & 255; + var tmh = msecs / 4294967296 * 1e4 & 268435455; + b2[i2++] = tmh >>> 8 & 255; + b2[i2++] = tmh & 255; + b2[i2++] = tmh >>> 24 & 15 | 16; + b2[i2++] = tmh >>> 16 & 255; + b2[i2++] = clockseq >>> 8 | 128; + b2[i2++] = clockseq & 255; + for (var n2 = 0; n2 < 6; ++n2) { + b2[i2 + n2] = node[n2]; + } + return buf ? buf : bytesToUuid(b2); + } + module.exports = v12; + } +}); + +// node_modules/uuid/v4.js +var require_v4 = __commonJS({ + "node_modules/uuid/v4.js"(exports, module) { + var rng3 = require_rng(); + var bytesToUuid = require_bytesToUuid(); + function v43(options, buf, offset) { + var i2 = buf && offset || 0; + if (typeof options == "string") { + buf = options === "binary" ? new Array(16) : null; + options = null; + } + options = options || {}; + var rnds = options.random || (options.rng || rng3)(); + rnds[6] = rnds[6] & 15 | 64; + rnds[8] = rnds[8] & 63 | 128; + if (buf) { + for (var ii = 0; ii < 16; ++ii) { + buf[i2 + ii] = rnds[ii]; + } + } + return buf || bytesToUuid(rnds); + } + module.exports = v43; + } +}); + +// node_modules/uuid/index.js +var require_uuid = __commonJS({ + "node_modules/uuid/index.js"(exports, module) { + var v12 = require_v1(); + var v43 = require_v4(); + var uuid = v43; + uuid.v1 = v12; + uuid.v4 = v43; + module.exports = uuid; + } +}); + +// node_modules/@actions/cache/lib/internal/constants.js +var require_constants6 = __commonJS({ + "node_modules/@actions/cache/lib/internal/constants.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ManifestFilename = exports.TarFilename = exports.SystemTarPathOnWindows = exports.GnuTarPathOnWindows = exports.SocketTimeout = exports.DefaultRetryDelay = exports.DefaultRetryAttempts = exports.ArchiveToolType = exports.CompressionMethod = exports.CacheFilename = void 0; + var CacheFilename; + (function(CacheFilename2) { + CacheFilename2["Gzip"] = "cache.tgz"; + CacheFilename2["Zstd"] = "cache.tzst"; + })(CacheFilename = exports.CacheFilename || (exports.CacheFilename = {})); + var CompressionMethod; + (function(CompressionMethod2) { + CompressionMethod2["Gzip"] = "gzip"; + CompressionMethod2["ZstdWithoutLong"] = "zstd-without-long"; + CompressionMethod2["Zstd"] = "zstd"; + })(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {})); + var ArchiveToolType; + (function(ArchiveToolType2) { + ArchiveToolType2["GNU"] = "gnu"; + ArchiveToolType2["BSD"] = "bsd"; + })(ArchiveToolType = exports.ArchiveToolType || (exports.ArchiveToolType = {})); + exports.DefaultRetryAttempts = 2; + exports.DefaultRetryDelay = 5e3; + exports.SocketTimeout = 5e3; + exports.GnuTarPathOnWindows = `${process.env["PROGRAMFILES"]}\\Git\\usr\\bin\\tar.exe`; + exports.SystemTarPathOnWindows = `${process.env["SYSTEMDRIVE"]}\\Windows\\System32\\tar.exe`; + exports.TarFilename = "cache.tar"; + exports.ManifestFilename = "manifest.txt"; + } +}); + +// node_modules/@actions/cache/lib/internal/cacheUtils.js +var require_cacheUtils = __commonJS({ + "node_modules/@actions/cache/lib/internal/cacheUtils.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + var desc = Object.getOwnPropertyDescriptor(m3, k2); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m3[k2]; + } }; + } + Object.defineProperty(o2, k22, desc); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve2) { + resolve2(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var __asyncValues2 = exports && exports.__asyncValues || function(o2) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m3 = o2[Symbol.asyncIterator], i2; + return m3 ? m3.call(o2) : (o2 = typeof __values === "function" ? __values(o2) : o2[Symbol.iterator](), i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { + return this; + }, i2); + function verb(n2) { + i2[n2] = o2[n2] && function(v2) { + return new Promise(function(resolve2, reject) { + v2 = o2[n2](v2), settle(resolve2, reject, v2.done, v2.value); + }); + }; + } + function settle(resolve2, reject, d2, v2) { + Promise.resolve(v2).then(function(v6) { + resolve2({ value: v6, done: d2 }); + }, reject); + } + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isGhes = exports.assertDefined = exports.getGnuTarPathOnWindows = exports.getCacheFileName = exports.getCompressionMethod = exports.unlinkFile = exports.resolvePaths = exports.getArchiveFileSizeInBytes = exports.createTempDirectory = void 0; + var core2 = __importStar(require_core()); + var exec2 = __importStar(require_exec()); + var glob = __importStar(require_glob()); + var io2 = __importStar(require_io()); + var fs3 = __importStar(__require("fs")); + var path14 = __importStar(__require("path")); + var semver2 = __importStar(require_semver2()); + var util3 = __importStar(__require("util")); + var uuid_1 = require_uuid(); + var constants_1 = require_constants6(); + function createTempDirectory() { + return __awaiter(this, void 0, void 0, function* () { + const IS_WINDOWS = process.platform === "win32"; + let tempDirectory = process.env["RUNNER_TEMP"] || ""; + if (!tempDirectory) { + let baseLocation; + if (IS_WINDOWS) { + baseLocation = process.env["USERPROFILE"] || "C:\\"; + } else { + if (process.platform === "darwin") { + baseLocation = "/Users"; + } else { + baseLocation = "/home"; + } + } + tempDirectory = path14.join(baseLocation, "actions", "temp"); + } + const dest = path14.join(tempDirectory, (0, uuid_1.v4)()); + yield io2.mkdirP(dest); + return dest; + }); + } + exports.createTempDirectory = createTempDirectory; + function getArchiveFileSizeInBytes(filePath) { + return fs3.statSync(filePath).size; + } + exports.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; + function resolvePaths(patterns) { + var _a2, e_1, _b2, _c2; + var _d2; + return __awaiter(this, void 0, void 0, function* () { + const paths = []; + const workspace = (_d2 = process.env["GITHUB_WORKSPACE"]) !== null && _d2 !== void 0 ? _d2 : process.cwd(); + const globber = yield glob.create(patterns.join("\n"), { + implicitDescendants: false + }); + try { + for (var _e2 = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a2 = _g.done, !_a2; ) { + _c2 = _g.value; + _e2 = false; + try { + const file = _c2; + const relativeFile = path14.relative(workspace, file).replace(new RegExp(`\\${path14.sep}`, "g"), "/"); + core2.debug(`Matched: ${relativeFile}`); + if (relativeFile === "") { + paths.push("."); + } else { + paths.push(`${relativeFile}`); + } + } finally { + _e2 = true; + } + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e2 && !_a2 && (_b2 = _f.return)) + yield _b2.call(_f); + } finally { + if (e_1) + throw e_1.error; + } + } + return paths; + }); + } + exports.resolvePaths = resolvePaths; + function unlinkFile(filePath) { + return __awaiter(this, void 0, void 0, function* () { + return util3.promisify(fs3.unlink)(filePath); + }); + } + exports.unlinkFile = unlinkFile; + function getVersion(app, additionalArgs = []) { + return __awaiter(this, void 0, void 0, function* () { + let versionOutput = ""; + additionalArgs.push("--version"); + core2.debug(`Checking ${app} ${additionalArgs.join(" ")}`); + try { + yield exec2.exec(`${app}`, additionalArgs, { + ignoreReturnCode: true, + silent: true, + listeners: { + stdout: (data) => versionOutput += data.toString(), + stderr: (data) => versionOutput += data.toString() + } + }); + } catch (err) { + core2.debug(err.message); + } + versionOutput = versionOutput.trim(); + core2.debug(versionOutput); + return versionOutput; + }); + } + function getCompressionMethod() { + return __awaiter(this, void 0, void 0, function* () { + const versionOutput = yield getVersion("zstd", ["--quiet"]); + const version4 = semver2.clean(versionOutput); + core2.debug(`zstd version: ${version4}`); + if (versionOutput === "") { + return constants_1.CompressionMethod.Gzip; + } else { + return constants_1.CompressionMethod.ZstdWithoutLong; + } + }); + } + exports.getCompressionMethod = getCompressionMethod; + function getCacheFileName(compressionMethod) { + return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; + } + exports.getCacheFileName = getCacheFileName; + function getGnuTarPathOnWindows() { + return __awaiter(this, void 0, void 0, function* () { + if (fs3.existsSync(constants_1.GnuTarPathOnWindows)) { + return constants_1.GnuTarPathOnWindows; + } + const versionOutput = yield getVersion("tar"); + return versionOutput.toLowerCase().includes("gnu tar") ? io2.which("tar") : ""; + }); + } + exports.getGnuTarPathOnWindows = getGnuTarPathOnWindows; + function assertDefined(name2, value) { + if (value === void 0) { + throw Error(`Expected ${name2} but value was undefiend`); + } + return value; + } + exports.assertDefined = assertDefined; + function isGhes() { + const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); + return ghUrl.hostname.toUpperCase() !== "GITHUB.COM"; + } + exports.isGhes = isGhes; + } +}); + +// node_modules/@azure/core-http/dist-esm/src/httpHeaders.js +function getHeaderKey(headerName) { + return headerName.toLowerCase(); +} +function isHttpHeadersLike(object) { + if (object && typeof object === "object") { + const castObject = object; + if (typeof castObject.rawHeaders === "function" && typeof castObject.clone === "function" && typeof castObject.get === "function" && typeof castObject.set === "function" && typeof castObject.contains === "function" && typeof castObject.remove === "function" && typeof castObject.headersArray === "function" && typeof castObject.headerValues === "function" && typeof castObject.headerNames === "function" && typeof castObject.toJson === "function") { + return true; + } + } + return false; +} +var HttpHeaders; +var init_httpHeaders = __esm({ + "node_modules/@azure/core-http/dist-esm/src/httpHeaders.js"() { + HttpHeaders = class _HttpHeaders { + constructor(rawHeaders) { + this._headersMap = {}; + if (rawHeaders) { + for (const headerName in rawHeaders) { + this.set(headerName, rawHeaders[headerName]); + } + } + } + /** + * Set a header in this collection with the provided name and value. The name is + * case-insensitive. + * @param headerName - The name of the header to set. This value is case-insensitive. + * @param headerValue - The value of the header to set. + */ + set(headerName, headerValue) { + this._headersMap[getHeaderKey(headerName)] = { + name: headerName, + value: headerValue.toString() + }; + } + /** + * Get the header value for the provided header name, or undefined if no header exists in this + * collection with the provided name. + * @param headerName - The name of the header. + */ + get(headerName) { + const header = this._headersMap[getHeaderKey(headerName)]; + return !header ? void 0 : header.value; + } + /** + * Get whether or not this header collection contains a header entry for the provided header name. + */ + contains(headerName) { + return !!this._headersMap[getHeaderKey(headerName)]; + } + /** + * Remove the header with the provided headerName. Return whether or not the header existed and + * was removed. + * @param headerName - The name of the header to remove. + */ + remove(headerName) { + const result = this.contains(headerName); + delete this._headersMap[getHeaderKey(headerName)]; + return result; + } + /** + * Get the headers that are contained this collection as an object. + */ + rawHeaders() { + return this.toJson({ preserveCase: true }); + } + /** + * Get the headers that are contained in this collection as an array. + */ + headersArray() { + const headers = []; + for (const headerKey in this._headersMap) { + headers.push(this._headersMap[headerKey]); + } + return headers; + } + /** + * Get the header names that are contained in this collection. + */ + headerNames() { + const headerNames = []; + const headers = this.headersArray(); + for (let i2 = 0; i2 < headers.length; ++i2) { + headerNames.push(headers[i2].name); + } + return headerNames; + } + /** + * Get the header values that are contained in this collection. + */ + headerValues() { + const headerValues = []; + const headers = this.headersArray(); + for (let i2 = 0; i2 < headers.length; ++i2) { + headerValues.push(headers[i2].value); + } + return headerValues; + } + /** + * Get the JSON object representation of this HTTP header collection. + */ + toJson(options = {}) { + const result = {}; + if (options.preserveCase) { + for (const headerKey in this._headersMap) { + const header = this._headersMap[headerKey]; + result[header.name] = header.value; + } + } else { + for (const headerKey in this._headersMap) { + const header = this._headersMap[headerKey]; + result[getHeaderKey(header.name)] = header.value; + } + } + return result; + } + /** + * Get the string representation of this HTTP header collection. + */ + toString() { + return JSON.stringify(this.toJson({ preserveCase: true })); + } + /** + * Create a deep clone/copy of this HttpHeaders collection. + */ + clone() { + const resultPreservingCasing = {}; + for (const headerKey in this._headersMap) { + const header = this._headersMap[headerKey]; + resultPreservingCasing[header.name] = header.value; + } + return new _HttpHeaders(resultPreservingCasing); + } + }; + } +}); + +// node_modules/@azure/core-http/dist-esm/src/util/base64.js +function encodeByteArray(value) { + const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); + return bufferValue.toString("base64"); +} +function decodeString(value) { + return Buffer.from(value, "base64"); +} +var init_base64 = __esm({ + "node_modules/@azure/core-http/dist-esm/src/util/base64.js"() { + } +}); + +// node_modules/@azure/core-http/dist-esm/src/util/constants.js +var Constants; +var init_constants = __esm({ + "node_modules/@azure/core-http/dist-esm/src/util/constants.js"() { + Constants = { + /** + * The core-http version + */ + coreHttpVersion: "3.0.3", + /** + * Specifies HTTP. + */ + HTTP: "http:", + /** + * Specifies HTTPS. + */ + HTTPS: "https:", + /** + * Specifies HTTP Proxy. + */ + HTTP_PROXY: "HTTP_PROXY", + /** + * Specifies HTTPS Proxy. + */ + HTTPS_PROXY: "HTTPS_PROXY", + /** + * Specifies NO Proxy. + */ + NO_PROXY: "NO_PROXY", + /** + * Specifies ALL Proxy. + */ + ALL_PROXY: "ALL_PROXY", + HttpConstants: { + /** + * Http Verbs + */ + HttpVerbs: { + PUT: "PUT", + GET: "GET", + DELETE: "DELETE", + POST: "POST", + MERGE: "MERGE", + HEAD: "HEAD", + PATCH: "PATCH" + }, + StatusCodes: { + TooManyRequests: 429, + ServiceUnavailable: 503 + } }, - "video/x-ms-wmx": { - source: "apache", - extensions: ["wmx"] + /** + * Defines constants for use with HTTP headers. + */ + HeaderConstants: { + /** + * The Authorization header. + */ + AUTHORIZATION: "authorization", + AUTHORIZATION_SCHEME: "Bearer", + /** + * The Retry-After response-header field can be used with a 503 (Service + * Unavailable) or 349 (Too Many Requests) responses to indicate how long + * the service is expected to be unavailable to the requesting client. + */ + RETRY_AFTER: "Retry-After", + /** + * The UserAgent header. + */ + USER_AGENT: "User-Agent" + } + }; + } +}); + +// node_modules/@azure/core-http/dist-esm/src/util/serializer.common.js +var XML_ATTRKEY, XML_CHARKEY; +var init_serializer_common = __esm({ + "node_modules/@azure/core-http/dist-esm/src/util/serializer.common.js"() { + XML_ATTRKEY = "$"; + XML_CHARKEY = "_"; + } +}); + +// node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/rng.js +import crypto4 from "crypto"; +function rng2() { + if (poolPtr2 > rnds8Pool2.length - 16) { + crypto4.randomFillSync(rnds8Pool2); + poolPtr2 = 0; + } + return rnds8Pool2.slice(poolPtr2, poolPtr2 += 16); +} +var rnds8Pool2, poolPtr2; +var init_rng2 = __esm({ + "node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/rng.js"() { + rnds8Pool2 = new Uint8Array(256); + poolPtr2 = rnds8Pool2.length; + } +}); + +// node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/regex.js +var regex_default2; +var init_regex2 = __esm({ + "node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/regex.js"() { + regex_default2 = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; + } +}); + +// node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/validate.js +function validate2(uuid) { + return typeof uuid === "string" && regex_default2.test(uuid); +} +var validate_default2; +var init_validate2 = __esm({ + "node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/validate.js"() { + init_regex2(); + validate_default2 = validate2; + } +}); + +// node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/stringify.js +function stringify2(arr, offset = 0) { + const uuid = (byteToHex2[arr[offset + 0]] + byteToHex2[arr[offset + 1]] + byteToHex2[arr[offset + 2]] + byteToHex2[arr[offset + 3]] + "-" + byteToHex2[arr[offset + 4]] + byteToHex2[arr[offset + 5]] + "-" + byteToHex2[arr[offset + 6]] + byteToHex2[arr[offset + 7]] + "-" + byteToHex2[arr[offset + 8]] + byteToHex2[arr[offset + 9]] + "-" + byteToHex2[arr[offset + 10]] + byteToHex2[arr[offset + 11]] + byteToHex2[arr[offset + 12]] + byteToHex2[arr[offset + 13]] + byteToHex2[arr[offset + 14]] + byteToHex2[arr[offset + 15]]).toLowerCase(); + if (!validate_default2(uuid)) { + throw TypeError("Stringified UUID is invalid"); + } + return uuid; +} +var byteToHex2, stringify_default2; +var init_stringify2 = __esm({ + "node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/stringify.js"() { + init_validate2(); + byteToHex2 = []; + for (let i2 = 0; i2 < 256; ++i2) { + byteToHex2.push((i2 + 256).toString(16).substr(1)); + } + stringify_default2 = stringify2; + } +}); + +// node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/v4.js +function v42(options, buf, offset) { + options = options || {}; + const rnds = options.random || (options.rng || rng2)(); + rnds[6] = rnds[6] & 15 | 64; + rnds[8] = rnds[8] & 63 | 128; + if (buf) { + offset = offset || 0; + for (let i2 = 0; i2 < 16; ++i2) { + buf[offset + i2] = rnds[i2]; + } + return buf; + } + return stringify_default2(rnds); +} +var v4_default2; +var init_v42 = __esm({ + "node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/v4.js"() { + init_rng2(); + init_stringify2(); + v4_default2 = v42; + } +}); + +// node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/index.js +var init_esm_node2 = __esm({ + "node_modules/@azure/core-http/node_modules/uuid/dist/esm-node/index.js"() { + init_v42(); + } +}); + +// node_modules/@azure/core-http/dist-esm/src/util/utils.js +function isValidUuid(uuid) { + return validUuidRegex.test(uuid); +} +function generateUuid() { + return v4_default2(); +} +function prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { + if (!Array.isArray(obj)) { + obj = [obj]; + } + if (!xmlNamespaceKey || !xmlNamespace) { + return { [elementName]: obj }; + } + const result = { [elementName]: obj }; + result[XML_ATTRKEY] = { [xmlNamespaceKey]: xmlNamespace }; + return result; +} +function isDuration(value) { + return validateISODuration.test(value); +} +function replaceAll(value, searchValue, replaceValue) { + return !value || !searchValue ? value : value.split(searchValue).join(replaceValue || ""); +} +function isPrimitiveType(value) { + return typeof value !== "object" && typeof value !== "function" || value === null; +} +function getEnvironmentValue(name2) { + if (process.env[name2]) { + return process.env[name2]; + } else if (process.env[name2.toLowerCase()]) { + return process.env[name2.toLowerCase()]; + } + return void 0; +} +function isObject(input) { + return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); +} +var validUuidRegex, validateISODuration; +var init_utils = __esm({ + "node_modules/@azure/core-http/dist-esm/src/util/utils.js"() { + init_serializer_common(); + init_esm_node2(); + validUuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i; + validateISODuration = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; + } +}); + +// node_modules/@azure/core-http/dist-esm/src/serializer.js +function trimEnd(str, ch) { + let len = str.length; + while (len - 1 >= 0 && str[len - 1] === ch) { + --len; + } + return str.substr(0, len); +} +function bufferToBase64Url(buffer) { + if (!buffer) { + return void 0; + } + if (!(buffer instanceof Uint8Array)) { + throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); + } + const str = encodeByteArray(buffer); + return trimEnd(str, "=").replace(/\+/g, "-").replace(/\//g, "_"); +} +function base64UrlToByteArray(str) { + if (!str) { + return void 0; + } + if (str && typeof str.valueOf() !== "string") { + throw new Error("Please provide an input of type string for converting to Uint8Array"); + } + str = str.replace(/-/g, "+").replace(/_/g, "/"); + return decodeString(str); +} +function splitSerializeName(prop) { + const classes = []; + let partialclass = ""; + if (prop) { + const subwords = prop.split("."); + for (const item of subwords) { + if (item.charAt(item.length - 1) === "\\") { + partialclass += item.substr(0, item.length - 1) + "."; + } else { + partialclass += item; + classes.push(partialclass); + partialclass = ""; + } + } + } + return classes; +} +function dateToUnixTime(d2) { + if (!d2) { + return void 0; + } + if (typeof d2.valueOf() === "string") { + d2 = new Date(d2); + } + return Math.floor(d2.getTime() / 1e3); +} +function unixTimeToDate(n2) { + if (!n2) { + return void 0; + } + return new Date(n2 * 1e3); +} +function serializeBasicTypes(typeName, objectName, value) { + if (value !== null && value !== void 0) { + if (typeName.match(/^Number$/i) !== null) { + if (typeof value !== "number") { + throw new Error(`${objectName} with value ${value} must be of type number.`); + } + } else if (typeName.match(/^String$/i) !== null) { + if (typeof value.valueOf() !== "string") { + throw new Error(`${objectName} with value "${value}" must be of type string.`); + } + } else if (typeName.match(/^Uuid$/i) !== null) { + if (!(typeof value.valueOf() === "string" && isValidUuid(value))) { + throw new Error(`${objectName} with value "${value}" must be of type string and a valid uuid.`); + } + } else if (typeName.match(/^Boolean$/i) !== null) { + if (typeof value !== "boolean") { + throw new Error(`${objectName} with value ${value} must be of type boolean.`); + } + } else if (typeName.match(/^Stream$/i) !== null) { + const objectType = typeof value; + if (objectType !== "string" && objectType !== "function" && !(value instanceof ArrayBuffer) && !ArrayBuffer.isView(value) && !((typeof Blob === "function" || typeof Blob === "object") && value instanceof Blob)) { + throw new Error(`${objectName} must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream.`); + } + } + } + return value; +} +function serializeEnumType(objectName, allowedValues, value) { + if (!allowedValues) { + throw new Error(`Please provide a set of allowedValues to validate ${objectName} as an Enum Type.`); + } + const isPresent = allowedValues.some((item) => { + if (typeof item.valueOf() === "string") { + return item.toLowerCase() === value.toLowerCase(); + } + return item === value; + }); + if (!isPresent) { + throw new Error(`${value} is not a valid value for ${objectName}. The valid values are: ${JSON.stringify(allowedValues)}.`); + } + return value; +} +function serializeByteArrayType(objectName, value) { + let returnValue = ""; + if (value != void 0) { + if (!(value instanceof Uint8Array)) { + throw new Error(`${objectName} must be of type Uint8Array.`); + } + returnValue = encodeByteArray(value); + } + return returnValue; +} +function serializeBase64UrlType(objectName, value) { + let returnValue = ""; + if (value != void 0) { + if (!(value instanceof Uint8Array)) { + throw new Error(`${objectName} must be of type Uint8Array.`); + } + returnValue = bufferToBase64Url(value) || ""; + } + return returnValue; +} +function serializeDateTypes(typeName, value, objectName) { + if (value != void 0) { + if (typeName.match(/^Date$/i) !== null) { + if (!(value instanceof Date || typeof value.valueOf() === "string" && !isNaN(Date.parse(value)))) { + throw new Error(`${objectName} must be an instanceof Date or a string in ISO8601 format.`); + } + value = value instanceof Date ? value.toISOString().substring(0, 10) : new Date(value).toISOString().substring(0, 10); + } else if (typeName.match(/^DateTime$/i) !== null) { + if (!(value instanceof Date || typeof value.valueOf() === "string" && !isNaN(Date.parse(value)))) { + throw new Error(`${objectName} must be an instanceof Date or a string in ISO8601 format.`); + } + value = value instanceof Date ? value.toISOString() : new Date(value).toISOString(); + } else if (typeName.match(/^DateTimeRfc1123$/i) !== null) { + if (!(value instanceof Date || typeof value.valueOf() === "string" && !isNaN(Date.parse(value)))) { + throw new Error(`${objectName} must be an instanceof Date or a string in RFC-1123 format.`); + } + value = value instanceof Date ? value.toUTCString() : new Date(value).toUTCString(); + } else if (typeName.match(/^UnixTime$/i) !== null) { + if (!(value instanceof Date || typeof value.valueOf() === "string" && !isNaN(Date.parse(value)))) { + throw new Error(`${objectName} must be an instanceof Date or a string in RFC-1123/ISO8601 format for it to be serialized in UnixTime/Epoch format.`); + } + value = dateToUnixTime(value); + } else if (typeName.match(/^TimeSpan$/i) !== null) { + if (!isDuration(value)) { + throw new Error(`${objectName} must be a string in ISO 8601 format. Instead was "${value}".`); + } + } + } + return value; +} +function serializeSequenceType(serializer4, mapper, object, objectName, isXml, options) { + if (!Array.isArray(object)) { + throw new Error(`${objectName} must be of type Array.`); + } + const elementType = mapper.type.element; + if (!elementType || typeof elementType !== "object") { + throw new Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${objectName}.`); + } + const tempArray = []; + for (let i2 = 0; i2 < object.length; i2++) { + const serializedValue = serializer4.serialize(elementType, object[i2], objectName, options); + if (isXml && elementType.xmlNamespace) { + const xmlnsKey = elementType.xmlNamespacePrefix ? `xmlns:${elementType.xmlNamespacePrefix}` : "xmlns"; + if (elementType.type.name === "Composite") { + tempArray[i2] = Object.assign({}, serializedValue); + tempArray[i2][XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + } else { + tempArray[i2] = {}; + tempArray[i2][options.xmlCharKey] = serializedValue; + tempArray[i2][XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + } + } else { + tempArray[i2] = serializedValue; + } + } + return tempArray; +} +function serializeDictionaryType(serializer4, mapper, object, objectName, isXml, options) { + if (typeof object !== "object") { + throw new Error(`${objectName} must be of type object.`); + } + const valueType = mapper.type.value; + if (!valueType || typeof valueType !== "object") { + throw new Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${objectName}.`); + } + const tempDictionary = {}; + for (const key of Object.keys(object)) { + const serializedValue = serializer4.serialize(valueType, object[key], objectName, options); + tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); + } + if (isXml && mapper.xmlNamespace) { + const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; + const result = tempDictionary; + result[XML_ATTRKEY] = { [xmlnsKey]: mapper.xmlNamespace }; + return result; + } + return tempDictionary; +} +function resolveAdditionalProperties(serializer4, mapper, objectName) { + const additionalProperties = mapper.type.additionalProperties; + if (!additionalProperties && mapper.type.className) { + const modelMapper = resolveReferencedMapper(serializer4, mapper, objectName); + return modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; + } + return additionalProperties; +} +function resolveReferencedMapper(serializer4, mapper, objectName) { + const className = mapper.type.className; + if (!className) { + throw new Error(`Class name for model "${objectName}" is not provided in the mapper "${JSON.stringify(mapper, void 0, 2)}".`); + } + return serializer4.modelMappers[className]; +} +function resolveModelProperties(serializer4, mapper, objectName) { + let modelProps = mapper.type.modelProperties; + if (!modelProps) { + const modelMapper = resolveReferencedMapper(serializer4, mapper, objectName); + if (!modelMapper) { + throw new Error(`mapper() cannot be null or undefined for model "${mapper.type.className}".`); + } + modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.modelProperties; + if (!modelProps) { + throw new Error(`modelProperties cannot be null or undefined in the mapper "${JSON.stringify(modelMapper)}" of type "${mapper.type.className}" for object "${objectName}".`); + } + } + return modelProps; +} +function serializeCompositeType(serializer4, mapper, object, objectName, isXml, options) { + if (getPolymorphicDiscriminatorRecursively(serializer4, mapper)) { + mapper = getPolymorphicMapper(serializer4, mapper, object, "clientName"); + } + if (object != void 0) { + const payload = {}; + const modelProps = resolveModelProperties(serializer4, mapper, objectName); + for (const key of Object.keys(modelProps)) { + const propertyMapper = modelProps[key]; + if (propertyMapper.readOnly) { + continue; + } + let propName; + let parentObject = payload; + if (serializer4.isXML) { + if (propertyMapper.xmlIsWrapped) { + propName = propertyMapper.xmlName; + } else { + propName = propertyMapper.xmlElementName || propertyMapper.xmlName; + } + } else { + const paths = splitSerializeName(propertyMapper.serializedName); + propName = paths.pop(); + for (const pathName of paths) { + const childObject = parentObject[pathName]; + if (childObject == void 0 && (object[key] != void 0 || propertyMapper.defaultValue !== void 0)) { + parentObject[pathName] = {}; + } + parentObject = parentObject[pathName]; + } + } + if (parentObject != void 0) { + if (isXml && mapper.xmlNamespace) { + const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; + parentObject[XML_ATTRKEY] = Object.assign(Object.assign({}, parentObject[XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace }); + } + const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; + let toSerialize = object[key]; + const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer4, mapper); + if (polymorphicDiscriminator && polymorphicDiscriminator.clientName === key && toSerialize == void 0) { + toSerialize = mapper.serializedName; + } + const serializedValue = serializer4.serialize(propertyMapper, toSerialize, propertyObjectName, options); + if (serializedValue !== void 0 && propName != void 0) { + const value = getXmlObjectValue(propertyMapper, serializedValue, isXml, options); + if (isXml && propertyMapper.xmlIsAttribute) { + parentObject[XML_ATTRKEY] = parentObject[XML_ATTRKEY] || {}; + parentObject[XML_ATTRKEY][propName] = serializedValue; + } else if (isXml && propertyMapper.xmlIsWrapped) { + parentObject[propName] = { [propertyMapper.xmlElementName]: value }; + } else { + parentObject[propName] = value; + } + } + } + } + const additionalPropertiesMapper = resolveAdditionalProperties(serializer4, mapper, objectName); + if (additionalPropertiesMapper) { + const propNames = Object.keys(modelProps); + for (const clientPropName in object) { + const isAdditionalProperty = propNames.every((pn2) => pn2 !== clientPropName); + if (isAdditionalProperty) { + payload[clientPropName] = serializer4.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + } + } + } + return payload; + } + return object; +} +function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { + if (!isXml || !propertyMapper.xmlNamespace) { + return serializedValue; + } + const xmlnsKey = propertyMapper.xmlNamespacePrefix ? `xmlns:${propertyMapper.xmlNamespacePrefix}` : "xmlns"; + const xmlNamespace = { [xmlnsKey]: propertyMapper.xmlNamespace }; + if (["Composite"].includes(propertyMapper.type.name)) { + if (serializedValue[XML_ATTRKEY]) { + return serializedValue; + } else { + const result2 = Object.assign({}, serializedValue); + result2[XML_ATTRKEY] = xmlNamespace; + return result2; + } + } + const result = {}; + result[options.xmlCharKey] = serializedValue; + result[XML_ATTRKEY] = xmlNamespace; + return result; +} +function isSpecialXmlProperty(propertyName, options) { + return [XML_ATTRKEY, options.xmlCharKey].includes(propertyName); +} +function deserializeCompositeType(serializer4, mapper, responseBody, objectName, options) { + var _a2, _b2; + const xmlCharKey = (_a2 = options.xmlCharKey) !== null && _a2 !== void 0 ? _a2 : XML_CHARKEY; + if (getPolymorphicDiscriminatorRecursively(serializer4, mapper)) { + mapper = getPolymorphicMapper(serializer4, mapper, responseBody, "serializedName"); + } + const modelProps = resolveModelProperties(serializer4, mapper, objectName); + let instance = {}; + const handledPropertyNames = []; + for (const key of Object.keys(modelProps)) { + const propertyMapper = modelProps[key]; + const paths = splitSerializeName(modelProps[key].serializedName); + handledPropertyNames.push(paths[0]); + const { serializedName, xmlName, xmlElementName } = propertyMapper; + let propertyObjectName = objectName; + if (serializedName !== "" && serializedName !== void 0) { + propertyObjectName = objectName + "." + serializedName; + } + const headerCollectionPrefix = propertyMapper.headerCollectionPrefix; + if (headerCollectionPrefix) { + const dictionary = {}; + for (const headerKey of Object.keys(responseBody)) { + if (headerKey.startsWith(headerCollectionPrefix)) { + dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer4.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName, options); + } + handledPropertyNames.push(headerKey); + } + instance[key] = dictionary; + } else if (serializer4.isXML) { + if (propertyMapper.xmlIsAttribute && responseBody[XML_ATTRKEY]) { + instance[key] = serializer4.deserialize(propertyMapper, responseBody[XML_ATTRKEY][xmlName], propertyObjectName, options); + } else if (propertyMapper.xmlIsMsText) { + if (responseBody[xmlCharKey] !== void 0) { + instance[key] = responseBody[xmlCharKey]; + } else if (typeof responseBody === "string") { + instance[key] = responseBody; + } + } else { + const propertyName = xmlElementName || xmlName || serializedName; + if (propertyMapper.xmlIsWrapped) { + const wrapped = responseBody[xmlName]; + const elementList = (_b2 = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b2 !== void 0 ? _b2 : []; + instance[key] = serializer4.deserialize(propertyMapper, elementList, propertyObjectName, options); + handledPropertyNames.push(xmlName); + } else { + const property = responseBody[propertyName]; + instance[key] = serializer4.deserialize(propertyMapper, property, propertyObjectName, options); + handledPropertyNames.push(propertyName); + } + } + } else { + let propertyInstance; + let res = responseBody; + for (const item of paths) { + if (!res) + break; + res = res[item]; + } + propertyInstance = res; + const polymorphicDiscriminator = mapper.type.polymorphicDiscriminator; + if (polymorphicDiscriminator && key === polymorphicDiscriminator.clientName && propertyInstance == void 0) { + propertyInstance = mapper.serializedName; + } + let serializedValue; + if (Array.isArray(responseBody[key]) && modelProps[key].serializedName === "") { + propertyInstance = responseBody[key]; + const arrayInstance = serializer4.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); + for (const [k2, v2] of Object.entries(instance)) { + if (!Object.prototype.hasOwnProperty.call(arrayInstance, k2)) { + arrayInstance[k2] = v2; + } + } + instance = arrayInstance; + } else if (propertyInstance !== void 0 || propertyMapper.defaultValue !== void 0) { + serializedValue = serializer4.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); + instance[key] = serializedValue; + } + } + } + const additionalPropertiesMapper = mapper.type.additionalProperties; + if (additionalPropertiesMapper) { + const isAdditionalProperty = (responsePropName) => { + for (const clientPropName in modelProps) { + const paths = splitSerializeName(modelProps[clientPropName].serializedName); + if (paths[0] === responsePropName) { + return false; + } + } + return true; + }; + for (const responsePropName in responseBody) { + if (isAdditionalProperty(responsePropName)) { + instance[responsePropName] = serializer4.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '["' + responsePropName + '"]', options); + } + } + } else if (responseBody) { + for (const key of Object.keys(responseBody)) { + if (instance[key] === void 0 && !handledPropertyNames.includes(key) && !isSpecialXmlProperty(key, options)) { + instance[key] = responseBody[key]; + } + } + } + return instance; +} +function deserializeDictionaryType(serializer4, mapper, responseBody, objectName, options) { + const value = mapper.type.value; + if (!value || typeof value !== "object") { + throw new Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${objectName}`); + } + if (responseBody) { + const tempDictionary = {}; + for (const key of Object.keys(responseBody)) { + tempDictionary[key] = serializer4.deserialize(value, responseBody[key], objectName, options); + } + return tempDictionary; + } + return responseBody; +} +function deserializeSequenceType(serializer4, mapper, responseBody, objectName, options) { + const element = mapper.type.element; + if (!element || typeof element !== "object") { + throw new Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${objectName}`); + } + if (responseBody) { + if (!Array.isArray(responseBody)) { + responseBody = [responseBody]; + } + const tempArray = []; + for (let i2 = 0; i2 < responseBody.length; i2++) { + tempArray[i2] = serializer4.deserialize(element, responseBody[i2], `${objectName}[${i2}]`, options); + } + return tempArray; + } + return responseBody; +} +function getPolymorphicMapper(serializer4, mapper, object, polymorphicPropertyName) { + const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer4, mapper); + if (polymorphicDiscriminator) { + const discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; + if (discriminatorName != void 0) { + const discriminatorValue = object[discriminatorName]; + if (discriminatorValue != void 0) { + const typeName = mapper.type.uberParent || mapper.type.className; + const indexDiscriminator = discriminatorValue === typeName ? discriminatorValue : typeName + "." + discriminatorValue; + const polymorphicMapper = serializer4.modelMappers.discriminators[indexDiscriminator]; + if (polymorphicMapper) { + mapper = polymorphicMapper; + } + } + } + } + return mapper; +} +function getPolymorphicDiscriminatorRecursively(serializer4, mapper) { + return mapper.type.polymorphicDiscriminator || getPolymorphicDiscriminatorSafely(serializer4, mapper.type.uberParent) || getPolymorphicDiscriminatorSafely(serializer4, mapper.type.className); +} +function getPolymorphicDiscriminatorSafely(serializer4, typeName) { + return typeName && serializer4.modelMappers[typeName] && serializer4.modelMappers[typeName].type.polymorphicDiscriminator; +} +function strEnum(o2) { + const result = {}; + for (const key of o2) { + result[key] = key; + } + return result; +} +var Serializer, MapperType; +var init_serializer = __esm({ + "node_modules/@azure/core-http/dist-esm/src/serializer.js"() { + init_base64(); + init_utils(); + init_serializer_common(); + Serializer = class { + constructor(modelMappers = {}, isXML) { + this.modelMappers = modelMappers; + this.isXML = isXML; + } + /** + * Validates constraints, if any. This function will throw if the provided value does not respect those constraints. + * @param mapper - The definition of data models. + * @param value - The value. + * @param objectName - Name of the object. Used in the error messages. + * @deprecated Removing the constraints validation on client side. + */ + validateConstraints(mapper, value, objectName) { + const failValidation = (constraintName, constraintValue) => { + throw new Error(`"${objectName}" with value "${value}" should satisfy the constraint "${constraintName}": ${constraintValue}.`); + }; + if (mapper.constraints && value != void 0) { + const valueAsNumber = value; + const { ExclusiveMaximum, ExclusiveMinimum, InclusiveMaximum, InclusiveMinimum, MaxItems, MaxLength, MinItems, MinLength, MultipleOf, Pattern, UniqueItems } = mapper.constraints; + if (ExclusiveMaximum != void 0 && valueAsNumber >= ExclusiveMaximum) { + failValidation("ExclusiveMaximum", ExclusiveMaximum); + } + if (ExclusiveMinimum != void 0 && valueAsNumber <= ExclusiveMinimum) { + failValidation("ExclusiveMinimum", ExclusiveMinimum); + } + if (InclusiveMaximum != void 0 && valueAsNumber > InclusiveMaximum) { + failValidation("InclusiveMaximum", InclusiveMaximum); + } + if (InclusiveMinimum != void 0 && valueAsNumber < InclusiveMinimum) { + failValidation("InclusiveMinimum", InclusiveMinimum); + } + const valueAsArray = value; + if (MaxItems != void 0 && valueAsArray.length > MaxItems) { + failValidation("MaxItems", MaxItems); + } + if (MaxLength != void 0 && valueAsArray.length > MaxLength) { + failValidation("MaxLength", MaxLength); + } + if (MinItems != void 0 && valueAsArray.length < MinItems) { + failValidation("MinItems", MinItems); + } + if (MinLength != void 0 && valueAsArray.length < MinLength) { + failValidation("MinLength", MinLength); + } + if (MultipleOf != void 0 && valueAsNumber % MultipleOf !== 0) { + failValidation("MultipleOf", MultipleOf); + } + if (Pattern) { + const pattern = typeof Pattern === "string" ? new RegExp(Pattern) : Pattern; + if (typeof value !== "string" || value.match(pattern) === null) { + failValidation("Pattern", Pattern); + } + } + if (UniqueItems && valueAsArray.some((item, i2, ar2) => ar2.indexOf(item) !== i2)) { + failValidation("UniqueItems", UniqueItems); + } + } + } + /** + * Serialize the given object based on its metadata defined in the mapper. + * + * @param mapper - The mapper which defines the metadata of the serializable object. + * @param object - A valid Javascript object to be serialized. + * @param objectName - Name of the serialized object. + * @param options - additional options to deserialization. + * @returns A valid serialized Javascript object. + */ + serialize(mapper, object, objectName, options = {}) { + var _a2, _b2, _c2; + const updatedOptions = { + rootName: (_a2 = options.rootName) !== null && _a2 !== void 0 ? _a2 : "", + includeRoot: (_b2 = options.includeRoot) !== null && _b2 !== void 0 ? _b2 : false, + xmlCharKey: (_c2 = options.xmlCharKey) !== null && _c2 !== void 0 ? _c2 : XML_CHARKEY + }; + let payload = {}; + const mapperType = mapper.type.name; + if (!objectName) { + objectName = mapper.serializedName; + } + if (mapperType.match(/^Sequence$/i) !== null) { + payload = []; + } + if (mapper.isConstant) { + object = mapper.defaultValue; + } + const { required, nullable } = mapper; + if (required && nullable && object === void 0) { + throw new Error(`${objectName} cannot be undefined.`); + } + if (required && !nullable && object == void 0) { + throw new Error(`${objectName} cannot be null or undefined.`); + } + if (!required && nullable === false && object === null) { + throw new Error(`${objectName} cannot be null.`); + } + if (object == void 0) { + payload = object; + } else { + if (mapperType.match(/^any$/i) !== null) { + payload = object; + } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { + payload = serializeBasicTypes(mapperType, objectName, object); + } else if (mapperType.match(/^Enum$/i) !== null) { + const enumMapper = mapper; + payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); + } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { + payload = serializeDateTypes(mapperType, object, objectName); + } else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = serializeByteArrayType(objectName, object); + } else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = serializeBase64UrlType(objectName, object); + } else if (mapperType.match(/^Sequence$/i) !== null) { + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Composite$/i) !== null) { + payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } + } + return payload; + } + /** + * Deserialize the given object based on its metadata defined in the mapper. + * + * @param mapper - The mapper which defines the metadata of the serializable object. + * @param responseBody - A valid Javascript entity to be deserialized. + * @param objectName - Name of the deserialized object. + * @param options - Controls behavior of XML parser and builder. + * @returns A valid deserialized Javascript object. + */ + deserialize(mapper, responseBody, objectName, options = {}) { + var _a2, _b2, _c2; + const updatedOptions = { + rootName: (_a2 = options.rootName) !== null && _a2 !== void 0 ? _a2 : "", + includeRoot: (_b2 = options.includeRoot) !== null && _b2 !== void 0 ? _b2 : false, + xmlCharKey: (_c2 = options.xmlCharKey) !== null && _c2 !== void 0 ? _c2 : XML_CHARKEY + }; + if (responseBody == void 0) { + if (this.isXML && mapper.type.name === "Sequence" && !mapper.xmlIsWrapped) { + responseBody = []; + } + if (mapper.defaultValue !== void 0) { + responseBody = mapper.defaultValue; + } + return responseBody; + } + let payload; + const mapperType = mapper.type.name; + if (!objectName) { + objectName = mapper.serializedName; + } + if (mapperType.match(/^Composite$/i) !== null) { + payload = deserializeCompositeType(this, mapper, responseBody, objectName, updatedOptions); + } else { + if (this.isXML) { + const xmlCharKey = updatedOptions.xmlCharKey; + const castResponseBody = responseBody; + if (castResponseBody[XML_ATTRKEY] != void 0 && castResponseBody[xmlCharKey] != void 0) { + responseBody = castResponseBody[xmlCharKey]; + } + } + if (mapperType.match(/^Number$/i) !== null) { + payload = parseFloat(responseBody); + if (isNaN(payload)) { + payload = responseBody; + } + } else if (mapperType.match(/^Boolean$/i) !== null) { + if (responseBody === "true") { + payload = true; + } else if (responseBody === "false") { + payload = false; + } else { + payload = responseBody; + } + } else if (mapperType.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i) !== null) { + payload = responseBody; + } else if (mapperType.match(/^(Date|DateTime|DateTimeRfc1123)$/i) !== null) { + payload = new Date(responseBody); + } else if (mapperType.match(/^UnixTime$/i) !== null) { + payload = unixTimeToDate(responseBody); + } else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = decodeString(responseBody); + } else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = base64UrlToByteArray(responseBody); + } else if (mapperType.match(/^Sequence$/i) !== null) { + payload = deserializeSequenceType(this, mapper, responseBody, objectName, updatedOptions); + } else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = deserializeDictionaryType(this, mapper, responseBody, objectName, updatedOptions); + } + } + if (mapper.isConstant) { + payload = mapper.defaultValue; + } + return payload; + } + }; + MapperType = strEnum([ + "Base64Url", + "Boolean", + "ByteArray", + "Composite", + "Date", + "DateTime", + "DateTimeRfc1123", + "Dictionary", + "Enum", + "Number", + "Object", + "Sequence", + "String", + "Stream", + "TimeSpan", + "UnixTime" + ]); + } +}); + +// node_modules/@azure/core-http/dist-esm/src/webResource.js +function isWebResourceLike(object) { + if (object && typeof object === "object") { + const castObject = object; + if (typeof castObject.url === "string" && typeof castObject.method === "string" && typeof castObject.headers === "object" && isHttpHeadersLike(castObject.headers) && typeof castObject.validateRequestProperties === "function" && typeof castObject.prepare === "function" && typeof castObject.clone === "function") { + return true; + } + } + return false; +} +var WebResource; +var init_webResource = __esm({ + "node_modules/@azure/core-http/dist-esm/src/webResource.js"() { + init_httpHeaders(); + init_serializer(); + init_utils(); + WebResource = class _WebResource { + constructor(url2, method, body2, query, headers, streamResponseBody, withCredentials, abortSignal, timeout, onUploadProgress, onDownloadProgress, proxySettings, keepAlive, decompressResponse, streamResponseStatusCodes) { + this.streamResponseBody = streamResponseBody; + this.streamResponseStatusCodes = streamResponseStatusCodes; + this.url = url2 || ""; + this.method = method || "GET"; + this.headers = isHttpHeadersLike(headers) ? headers : new HttpHeaders(headers); + this.body = body2; + this.query = query; + this.formData = void 0; + this.withCredentials = withCredentials || false; + this.abortSignal = abortSignal; + this.timeout = timeout || 0; + this.onUploadProgress = onUploadProgress; + this.onDownloadProgress = onDownloadProgress; + this.proxySettings = proxySettings; + this.keepAlive = keepAlive; + this.decompressResponse = decompressResponse; + this.requestId = this.headers.get("x-ms-client-request-id") || generateUuid(); + } + /** + * Validates that the required properties such as method, url, headers["Content-Type"], + * headers["accept-language"] are defined. It will throw an error if one of the above + * mentioned properties are not defined. + */ + validateRequestProperties() { + if (!this.method) { + throw new Error("WebResource.method is required."); + } + if (!this.url) { + throw new Error("WebResource.url is required."); + } + } + /** + * Prepares the request. + * @param options - Options to provide for preparing the request. + * @returns Returns the prepared WebResource (HTTP Request) object that needs to be given to the request pipeline. + */ + prepare(options) { + if (!options) { + throw new Error("options object is required"); + } + if (options.method === void 0 || options.method === null || typeof options.method.valueOf() !== "string") { + throw new Error("options.method must be a string."); + } + if (options.url && options.pathTemplate) { + throw new Error("options.url and options.pathTemplate are mutually exclusive. Please provide exactly one of them."); + } + if ((options.pathTemplate === void 0 || options.pathTemplate === null || typeof options.pathTemplate.valueOf() !== "string") && (options.url === void 0 || options.url === null || typeof options.url.valueOf() !== "string")) { + throw new Error("Please provide exactly one of options.pathTemplate or options.url."); + } + if (options.url) { + if (typeof options.url !== "string") { + throw new Error('options.url must be of type "string".'); + } + this.url = options.url; + } + if (options.method) { + const validMethods = ["GET", "PUT", "HEAD", "DELETE", "OPTIONS", "POST", "PATCH", "TRACE"]; + if (validMethods.indexOf(options.method.toUpperCase()) === -1) { + throw new Error('The provided method "' + options.method + '" is invalid. Supported HTTP methods are: ' + JSON.stringify(validMethods)); + } + } + this.method = options.method.toUpperCase(); + if (options.pathTemplate) { + const { pathTemplate, pathParameters } = options; + if (typeof pathTemplate !== "string") { + throw new Error('options.pathTemplate must be of type "string".'); + } + if (!options.baseUrl) { + options.baseUrl = "https://management.azure.com"; + } + const baseUrl = options.baseUrl; + let url2 = baseUrl + (baseUrl.endsWith("/") ? "" : "/") + (pathTemplate.startsWith("/") ? pathTemplate.slice(1) : pathTemplate); + const segments = url2.match(/({[\w-]*\s*[\w-]*})/gi); + if (segments && segments.length) { + if (!pathParameters) { + throw new Error(`pathTemplate: ${pathTemplate} has been provided. Hence, options.pathParameters must also be provided.`); + } + segments.forEach(function(item) { + const pathParamName = item.slice(1, -1); + const pathParam = pathParameters[pathParamName]; + if (pathParam === null || pathParam === void 0 || !(typeof pathParam === "string" || typeof pathParam === "object")) { + const stringifiedPathParameters = JSON.stringify(pathParameters, void 0, 2); + throw new Error(`pathTemplate: ${pathTemplate} contains the path parameter ${pathParamName} however, it is not present in parameters: ${stringifiedPathParameters}.The value of the path parameter can either be a "string" of the form { ${pathParamName}: "some sample value" } or it can be an "object" of the form { "${pathParamName}": { value: "some sample value", skipUrlEncoding: true } }.`); + } + if (typeof pathParam.valueOf() === "string") { + url2 = url2.replace(item, encodeURIComponent(pathParam)); + } + if (typeof pathParam.valueOf() === "object") { + if (!pathParam.value) { + throw new Error(`options.pathParameters[${pathParamName}] is of type "object" but it does not contain a "value" property.`); + } + if (pathParam.skipUrlEncoding) { + url2 = url2.replace(item, pathParam.value); + } else { + url2 = url2.replace(item, encodeURIComponent(pathParam.value)); + } + } + }); + } + this.url = url2; + } + if (options.queryParameters) { + const queryParameters = options.queryParameters; + if (typeof queryParameters !== "object") { + throw new Error(`options.queryParameters must be of type object. It should be a JSON object of "query-parameter-name" as the key and the "query-parameter-value" as the value. The "query-parameter-value" may be fo type "string" or an "object" of the form { value: "query-parameter-value", skipUrlEncoding: true }.`); + } + if (this.url && this.url.indexOf("?") === -1) { + this.url += "?"; + } + const queryParams = []; + this.query = {}; + for (const queryParamName in queryParameters) { + const queryParam = queryParameters[queryParamName]; + if (queryParam) { + if (typeof queryParam === "string") { + queryParams.push(queryParamName + "=" + encodeURIComponent(queryParam)); + this.query[queryParamName] = encodeURIComponent(queryParam); + } else if (typeof queryParam === "object") { + if (!queryParam.value) { + throw new Error(`options.queryParameters[${queryParamName}] is of type "object" but it does not contain a "value" property.`); + } + if (queryParam.skipUrlEncoding) { + queryParams.push(queryParamName + "=" + queryParam.value); + this.query[queryParamName] = queryParam.value; + } else { + queryParams.push(queryParamName + "=" + encodeURIComponent(queryParam.value)); + this.query[queryParamName] = encodeURIComponent(queryParam.value); + } + } + } + } + this.url += queryParams.join("&"); + } + if (options.headers) { + const headers = options.headers; + for (const headerName of Object.keys(options.headers)) { + this.headers.set(headerName, headers[headerName]); + } + } + if (!this.headers.get("accept-language")) { + this.headers.set("accept-language", "en-US"); + } + if (!this.headers.get("x-ms-client-request-id") && !options.disableClientRequestId) { + this.headers.set("x-ms-client-request-id", this.requestId); + } + if (!this.headers.get("Content-Type")) { + this.headers.set("Content-Type", "application/json; charset=utf-8"); + } + this.body = options.body; + if (options.body !== void 0 && options.body !== null) { + if (options.bodyIsStream) { + if (!this.headers.get("Transfer-Encoding")) { + this.headers.set("Transfer-Encoding", "chunked"); + } + if (this.headers.get("Content-Type") !== "application/octet-stream") { + this.headers.set("Content-Type", "application/octet-stream"); + } + } else { + if (options.serializationMapper) { + this.body = new Serializer(options.mappers).serialize(options.serializationMapper, options.body, "requestBody"); + } + if (!options.disableJsonStringifyOnBody) { + this.body = JSON.stringify(options.body); + } + } + } + if (options.spanOptions) { + this.spanOptions = options.spanOptions; + } + if (options.tracingContext) { + this.tracingContext = options.tracingContext; + } + this.abortSignal = options.abortSignal; + this.onDownloadProgress = options.onDownloadProgress; + this.onUploadProgress = options.onUploadProgress; + return this; + } + /** + * Clone this WebResource HTTP request object. + * @returns The clone of this WebResource HTTP request object. + */ + clone() { + const result = new _WebResource(this.url, this.method, this.body, this.query, this.headers && this.headers.clone(), this.streamResponseBody, this.withCredentials, this.abortSignal, this.timeout, this.onUploadProgress, this.onDownloadProgress, this.proxySettings, this.keepAlive, this.decompressResponse, this.streamResponseStatusCodes); + if (this.formData) { + result.formData = this.formData; + } + if (this.operationSpec) { + result.operationSpec = this.operationSpec; + } + if (this.shouldDeserialize) { + result.shouldDeserialize = this.shouldDeserialize; + } + if (this.operationResponseGetter) { + result.operationResponseGetter = this.operationResponseGetter; + } + return result; + } + }; + } +}); + +// node_modules/node-fetch/lib/index.mjs +import Stream from "stream"; +import http from "http"; +import Url from "url"; +import whatwgUrl from "node:url"; +import https from "https"; +import zlib from "zlib"; +function FetchError(message, type3, systemError) { + Error.call(this, message); + this.message = message; + this.type = type3; + if (systemError) { + this.code = this.errno = systemError.code; + } + Error.captureStackTrace(this, this.constructor); +} +function Body(body2) { + var _this = this; + var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref$size = _ref.size; + let size = _ref$size === void 0 ? 0 : _ref$size; + var _ref$timeout = _ref.timeout; + let timeout = _ref$timeout === void 0 ? 0 : _ref$timeout; + if (body2 == null) { + body2 = null; + } else if (isURLSearchParams(body2)) { + body2 = Buffer.from(body2.toString()); + } else if (isBlob(body2)) + ; + else if (Buffer.isBuffer(body2)) + ; + else if (Object.prototype.toString.call(body2) === "[object ArrayBuffer]") { + body2 = Buffer.from(body2); + } else if (ArrayBuffer.isView(body2)) { + body2 = Buffer.from(body2.buffer, body2.byteOffset, body2.byteLength); + } else if (body2 instanceof Stream) + ; + else { + body2 = Buffer.from(String(body2)); + } + this[INTERNALS] = { + body: body2, + disturbed: false, + error: null + }; + this.size = size; + this.timeout = timeout; + if (body2 instanceof Stream) { + body2.on("error", function(err) { + const error = err.name === "AbortError" ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, "system", err); + _this[INTERNALS].error = error; + }); + } +} +function consumeBody() { + var _this4 = this; + if (this[INTERNALS].disturbed) { + return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); + } + this[INTERNALS].disturbed = true; + if (this[INTERNALS].error) { + return Body.Promise.reject(this[INTERNALS].error); + } + let body2 = this.body; + if (body2 === null) { + return Body.Promise.resolve(Buffer.alloc(0)); + } + if (isBlob(body2)) { + body2 = body2.stream(); + } + if (Buffer.isBuffer(body2)) { + return Body.Promise.resolve(body2); + } + if (!(body2 instanceof Stream)) { + return Body.Promise.resolve(Buffer.alloc(0)); + } + let accum = []; + let accumBytes = 0; + let abort = false; + return new Body.Promise(function(resolve2, reject) { + let resTimeout; + if (_this4.timeout) { + resTimeout = setTimeout(function() { + abort = true; + reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, "body-timeout")); + }, _this4.timeout); + } + body2.on("error", function(err) { + if (err.name === "AbortError") { + abort = true; + reject(err); + } else { + reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, "system", err)); + } + }); + body2.on("data", function(chunk) { + if (abort || chunk === null) { + return; + } + if (_this4.size && accumBytes + chunk.length > _this4.size) { + abort = true; + reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, "max-size")); + return; + } + accumBytes += chunk.length; + accum.push(chunk); + }); + body2.on("end", function() { + if (abort) { + return; + } + clearTimeout(resTimeout); + try { + resolve2(Buffer.concat(accum, accumBytes)); + } catch (err) { + reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err)); + } + }); + }); +} +function convertBody(buffer, headers) { + if (typeof convert !== "function") { + throw new Error("The package `encoding` must be installed to use the textConverted() function"); + } + const ct2 = headers.get("content-type"); + let charset = "utf-8"; + let res, str; + if (ct2) { + res = /charset=([^;]*)/i.exec(ct2); + } + str = buffer.slice(0, 1024).toString(); + if (!res && str) { + res = / 1 && arguments[1] !== void 0 ? arguments[1] : "key+value"; + const keys = Object.keys(headers[MAP]).sort(); + return keys.map(kind === "key" ? function(k2) { + return k2.toLowerCase(); + } : kind === "value" ? function(k2) { + return headers[MAP][k2].join(", "); + } : function(k2) { + return [k2.toLowerCase(), headers[MAP][k2].join(", ")]; + }); +} +function createHeadersIterator(target, kind) { + const iterator = Object.create(HeadersIteratorPrototype); + iterator[INTERNAL] = { + target, + kind, + index: 0 + }; + return iterator; +} +function exportNodeCompatibleHeaders(headers) { + const obj = Object.assign({ __proto__: null }, headers[MAP]); + const hostHeaderKey = find(headers[MAP], "Host"); + if (hostHeaderKey !== void 0) { + obj[hostHeaderKey] = obj[hostHeaderKey][0]; + } + return obj; +} +function createHeadersLenient(obj) { + const headers = new Headers(); + for (const name2 of Object.keys(obj)) { + if (invalidTokenRegex.test(name2)) { + continue; + } + if (Array.isArray(obj[name2])) { + for (const val of obj[name2]) { + if (invalidHeaderCharRegex.test(val)) { + continue; + } + if (headers[MAP][name2] === void 0) { + headers[MAP][name2] = [val]; + } else { + headers[MAP][name2].push(val); + } + } + } else if (!invalidHeaderCharRegex.test(obj[name2])) { + headers[MAP][name2] = [obj[name2]]; + } + } + return headers; +} +function parseURL(urlStr) { + if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { + urlStr = new URL3(urlStr).toString(); + } + return parse_url(urlStr); +} +function isRequest(input) { + return typeof input === "object" && typeof input[INTERNALS$2] === "object"; +} +function isAbortSignal(signal) { + const proto = signal && typeof signal === "object" && Object.getPrototypeOf(signal); + return !!(proto && proto.constructor.name === "AbortSignal"); +} +function getNodeRequestOptions(request) { + const parsedURL = request[INTERNALS$2].parsedURL; + const headers = new Headers(request[INTERNALS$2].headers); + if (!headers.has("Accept")) { + headers.set("Accept", "*/*"); + } + if (!parsedURL.protocol || !parsedURL.hostname) { + throw new TypeError("Only absolute URLs are supported"); + } + if (!/^https?:$/.test(parsedURL.protocol)) { + throw new TypeError("Only HTTP(S) protocols are supported"); + } + if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { + throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8"); + } + let contentLengthValue = null; + if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { + contentLengthValue = "0"; + } + if (request.body != null) { + const totalBytes = getTotalBytes(request); + if (typeof totalBytes === "number") { + contentLengthValue = String(totalBytes); + } + } + if (contentLengthValue) { + headers.set("Content-Length", contentLengthValue); + } + if (!headers.has("User-Agent")) { + headers.set("User-Agent", "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"); + } + if (request.compress && !headers.has("Accept-Encoding")) { + headers.set("Accept-Encoding", "gzip,deflate"); + } + let agent = request.agent; + if (typeof agent === "function") { + agent = agent(parsedURL); + } + return Object.assign({}, parsedURL, { + method: request.method, + headers: exportNodeCompatibleHeaders(headers), + agent + }); +} +function AbortError(message) { + Error.call(this, message); + this.type = "aborted"; + this.message = message; + Error.captureStackTrace(this, this.constructor); +} +function fetch(url2, opts) { + if (!fetch.Promise) { + throw new Error("native promise missing, set fetch.Promise to your favorite alternative"); + } + Body.Promise = fetch.Promise; + return new fetch.Promise(function(resolve2, reject) { + const request = new Request(url2, opts); + const options = getNodeRequestOptions(request); + const send = (options.protocol === "https:" ? https : http).request; + const signal = request.signal; + let response = null; + const abort = function abort2() { + let error = new AbortError("The user aborted a request."); + reject(error); + if (request.body && request.body instanceof Stream.Readable) { + destroyStream(request.body, error); + } + if (!response || !response.body) + return; + response.body.emit("error", error); + }; + if (signal && signal.aborted) { + abort(); + return; + } + const abortAndFinalize = function abortAndFinalize2() { + abort(); + finalize(); + }; + const req = send(options); + let reqTimeout; + if (signal) { + signal.addEventListener("abort", abortAndFinalize); + } + function finalize() { + req.abort(); + if (signal) + signal.removeEventListener("abort", abortAndFinalize); + clearTimeout(reqTimeout); + } + if (request.timeout) { + req.once("socket", function(socket) { + reqTimeout = setTimeout(function() { + reject(new FetchError(`network timeout at: ${request.url}`, "request-timeout")); + finalize(); + }, request.timeout); + }); + } + req.on("error", function(err) { + reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, "system", err)); + if (response && response.body) { + destroyStream(response.body, err); + } + finalize(); + }); + fixResponseChunkedTransferBadEnding(req, function(err) { + if (signal && signal.aborted) { + return; + } + if (response && response.body) { + destroyStream(response.body, err); + } + }); + if (parseInt(process.version.substring(1)) < 14) { + req.on("socket", function(s2) { + s2.addListener("close", function(hadError) { + const hasDataListener = s2.listenerCount("data") > 0; + if (response && hasDataListener && !hadError && !(signal && signal.aborted)) { + const err = new Error("Premature close"); + err.code = "ERR_STREAM_PREMATURE_CLOSE"; + response.body.emit("error", err); + } + }); + }); + } + req.on("response", function(res) { + clearTimeout(reqTimeout); + const headers = createHeadersLenient(res.headers); + if (fetch.isRedirect(res.statusCode)) { + const location = headers.get("Location"); + let locationURL = null; + try { + locationURL = location === null ? null : new URL$1(location, request.url).toString(); + } catch (err) { + if (request.redirect !== "manual") { + reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, "invalid-redirect")); + finalize(); + return; + } + } + switch (request.redirect) { + case "error": + reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, "no-redirect")); + finalize(); + return; + case "manual": + if (locationURL !== null) { + try { + headers.set("Location", locationURL); + } catch (err) { + reject(err); + } + } + break; + case "follow": + if (locationURL === null) { + break; + } + if (request.counter >= request.follow) { + reject(new FetchError(`maximum redirect reached at: ${request.url}`, "max-redirect")); + finalize(); + return; + } + const requestOpts = { + headers: new Headers(request.headers), + follow: request.follow, + counter: request.counter + 1, + agent: request.agent, + compress: request.compress, + method: request.method, + body: request.body, + signal: request.signal, + timeout: request.timeout, + size: request.size + }; + if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) { + for (const name2 of ["authorization", "www-authenticate", "cookie", "cookie2"]) { + requestOpts.headers.delete(name2); + } + } + if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { + reject(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect")); + finalize(); + return; + } + if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === "POST") { + requestOpts.method = "GET"; + requestOpts.body = void 0; + requestOpts.headers.delete("content-length"); + } + resolve2(fetch(new Request(locationURL, requestOpts))); + finalize(); + return; + } + } + res.once("end", function() { + if (signal) + signal.removeEventListener("abort", abortAndFinalize); + }); + let body2 = res.pipe(new PassThrough$1()); + const response_options = { + url: request.url, + status: res.statusCode, + statusText: res.statusMessage, + headers, + size: request.size, + timeout: request.timeout, + counter: request.counter + }; + const codings = headers.get("Content-Encoding"); + if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) { + response = new Response(body2, response_options); + resolve2(response); + return; + } + const zlibOptions = { + flush: zlib.Z_SYNC_FLUSH, + finishFlush: zlib.Z_SYNC_FLUSH + }; + if (codings == "gzip" || codings == "x-gzip") { + body2 = body2.pipe(zlib.createGunzip(zlibOptions)); + response = new Response(body2, response_options); + resolve2(response); + return; + } + if (codings == "deflate" || codings == "x-deflate") { + const raw = res.pipe(new PassThrough$1()); + raw.once("data", function(chunk) { + if ((chunk[0] & 15) === 8) { + body2 = body2.pipe(zlib.createInflate()); + } else { + body2 = body2.pipe(zlib.createInflateRaw()); + } + response = new Response(body2, response_options); + resolve2(response); + }); + raw.on("end", function() { + if (!response) { + response = new Response(body2, response_options); + resolve2(response); + } + }); + return; + } + if (codings == "br" && typeof zlib.createBrotliDecompress === "function") { + body2 = body2.pipe(zlib.createBrotliDecompress()); + response = new Response(body2, response_options); + resolve2(response); + return; + } + response = new Response(body2, response_options); + resolve2(response); + }); + writeToStream(req, request); + }); +} +function fixResponseChunkedTransferBadEnding(request, errorCallback) { + let socket; + request.on("socket", function(s2) { + socket = s2; + }); + request.on("response", function(response) { + const headers = response.headers; + if (headers["transfer-encoding"] === "chunked" && !headers["content-length"]) { + response.once("close", function(hadError) { + const hasDataListener = socket && socket.listenerCount("data") > 0; + if (hasDataListener && !hadError) { + const err = new Error("Premature close"); + err.code = "ERR_STREAM_PREMATURE_CLOSE"; + errorCallback(err); + } + }); + } + }); +} +function destroyStream(stream, err) { + if (stream.destroy) { + stream.destroy(err); + } else { + stream.emit("error", err); + stream.end(); + } +} +var Readable, BUFFER, TYPE, Blob2, convert, INTERNALS, PassThrough, invalidTokenRegex, invalidHeaderCharRegex, MAP, Headers, INTERNAL, HeadersIteratorPrototype, INTERNALS$1, STATUS_CODES, Response, INTERNALS$2, URL3, parse_url, format_url, streamDestructionSupported, Request, URL$1, PassThrough$1, isDomainOrSubdomain, isSameProtocol, lib_default; +var init_lib = __esm({ + "node_modules/node-fetch/lib/index.mjs"() { + Readable = Stream.Readable; + BUFFER = Symbol("buffer"); + TYPE = Symbol("type"); + Blob2 = class _Blob { + constructor() { + this[TYPE] = ""; + const blobParts = arguments[0]; + const options = arguments[1]; + const buffers = []; + let size = 0; + if (blobParts) { + const a2 = blobParts; + const length = Number(a2.length); + for (let i2 = 0; i2 < length; i2++) { + const element = a2[i2]; + let buffer; + if (element instanceof Buffer) { + buffer = element; + } else if (ArrayBuffer.isView(element)) { + buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); + } else if (element instanceof ArrayBuffer) { + buffer = Buffer.from(element); + } else if (element instanceof _Blob) { + buffer = element[BUFFER]; + } else { + buffer = Buffer.from(typeof element === "string" ? element : String(element)); + } + size += buffer.length; + buffers.push(buffer); + } + } + this[BUFFER] = Buffer.concat(buffers); + let type3 = options && options.type !== void 0 && String(options.type).toLowerCase(); + if (type3 && !/[^\u0020-\u007E]/.test(type3)) { + this[TYPE] = type3; + } + } + get size() { + return this[BUFFER].length; + } + get type() { + return this[TYPE]; + } + text() { + return Promise.resolve(this[BUFFER].toString()); + } + arrayBuffer() { + const buf = this[BUFFER]; + const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + return Promise.resolve(ab); + } + stream() { + const readable = new Readable(); + readable._read = function() { + }; + readable.push(this[BUFFER]); + readable.push(null); + return readable; + } + toString() { + return "[object Blob]"; + } + slice() { + const size = this.size; + const start = arguments[0]; + const end = arguments[1]; + let relativeStart, relativeEnd; + if (start === void 0) { + relativeStart = 0; + } else if (start < 0) { + relativeStart = Math.max(size + start, 0); + } else { + relativeStart = Math.min(start, size); + } + if (end === void 0) { + relativeEnd = size; + } else if (end < 0) { + relativeEnd = Math.max(size + end, 0); + } else { + relativeEnd = Math.min(end, size); + } + const span = Math.max(relativeEnd - relativeStart, 0); + const buffer = this[BUFFER]; + const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); + const blob = new _Blob([], { type: arguments[2] }); + blob[BUFFER] = slicedBuffer; + return blob; + } + }; + Object.defineProperties(Blob2.prototype, { + size: { enumerable: true }, + type: { enumerable: true }, + slice: { enumerable: true } + }); + Object.defineProperty(Blob2.prototype, Symbol.toStringTag, { + value: "Blob", + writable: false, + enumerable: false, + configurable: true + }); + FetchError.prototype = Object.create(Error.prototype); + FetchError.prototype.constructor = FetchError; + FetchError.prototype.name = "FetchError"; + try { + convert = __require("encoding").convert; + } catch (e2) { + } + INTERNALS = Symbol("Body internals"); + PassThrough = Stream.PassThrough; + Body.prototype = { + get body() { + return this[INTERNALS].body; }, - "video/x-ms-wvx": { - source: "apache", - extensions: ["wvx"] + get bodyUsed() { + return this[INTERNALS].disturbed; }, - "video/x-msvideo": { - source: "apache", - extensions: ["avi"] + /** + * Decode response as ArrayBuffer + * + * @return Promise + */ + arrayBuffer() { + return consumeBody.call(this).then(function(buf) { + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + }); }, - "video/x-sgi-movie": { - source: "apache", - extensions: ["movie"] + /** + * Return raw response as Blob + * + * @return Promise + */ + blob() { + let ct2 = this.headers && this.headers.get("content-type") || ""; + return consumeBody.call(this).then(function(buf) { + return Object.assign( + // Prevent copying + new Blob2([], { + type: ct2.toLowerCase() + }), + { + [BUFFER]: buf + } + ); + }); }, - "video/x-smv": { - source: "apache", - extensions: ["smv"] + /** + * Decode response as json + * + * @return Promise + */ + json() { + var _this2 = this; + return consumeBody.call(this).then(function(buffer) { + try { + return JSON.parse(buffer.toString()); + } catch (err) { + return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, "invalid-json")); + } + }); }, - "x-conference/x-cooltalk": { - source: "apache", - extensions: ["ice"] + /** + * Decode response as text + * + * @return Promise + */ + text() { + return consumeBody.call(this).then(function(buffer) { + return buffer.toString(); + }); }, - "x-shader/x-fragment": { - compressible: true + /** + * Decode response as buffer (non-spec api) + * + * @return Promise + */ + buffer() { + return consumeBody.call(this); }, - "x-shader/x-vertex": { - compressible: true + /** + * Decode response as text, while automatically detecting the encoding and + * trying to decode to UTF-8 (non-spec api) + * + * @return Promise + */ + textConverted() { + var _this3 = this; + return consumeBody.call(this).then(function(buffer) { + return convertBody(buffer, _this3.headers); + }); } }; - } -}); - -// node_modules/mime-db/index.js -var require_mime_db = __commonJS({ - "node_modules/mime-db/index.js"(exports, module) { - /*! - * mime-db - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015-2022 Douglas Christopher Wilson - * MIT Licensed - */ - module.exports = require_db(); - } -}); - -// node_modules/mime-types/index.js -var require_mime_types = __commonJS({ - "node_modules/mime-types/index.js"(exports) { - "use strict"; - /*! - * mime-types - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - var db = require_mime_db(); - var extname = __require("path").extname; - var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/; - var TEXT_TYPE_REGEXP = /^text\//i; - exports.charset = charset; - exports.charsets = { lookup: charset }; - exports.contentType = contentType2; - exports.extension = extension; - exports.extensions = /* @__PURE__ */ Object.create(null); - exports.lookup = lookup; - exports.types = /* @__PURE__ */ Object.create(null); - populateMaps(exports.extensions, exports.types); - function charset(type3) { - if (!type3 || typeof type3 !== "string") { - return false; + Object.defineProperties(Body.prototype, { + body: { enumerable: true }, + bodyUsed: { enumerable: true }, + arrayBuffer: { enumerable: true }, + blob: { enumerable: true }, + json: { enumerable: true }, + text: { enumerable: true } + }); + Body.mixIn = function(proto) { + for (const name2 of Object.getOwnPropertyNames(Body.prototype)) { + if (!(name2 in proto)) { + const desc = Object.getOwnPropertyDescriptor(Body.prototype, name2); + Object.defineProperty(proto, name2, desc); + } } - var match = EXTRACT_TYPE_REGEXP.exec(type3); - var mime = match && db[match[1].toLowerCase()]; - if (mime && mime.charset) { - return mime.charset; + }; + Body.Promise = global.Promise; + invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/; + invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/; + MAP = Symbol("map"); + Headers = class _Headers { + /** + * Headers class + * + * @param Object headers Response headers + * @return Void + */ + constructor() { + let init2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0; + this[MAP] = /* @__PURE__ */ Object.create(null); + if (init2 instanceof _Headers) { + const rawHeaders = init2.raw(); + const headerNames = Object.keys(rawHeaders); + for (const headerName of headerNames) { + for (const value of rawHeaders[headerName]) { + this.append(headerName, value); + } + } + return; + } + if (init2 == null) + ; + else if (typeof init2 === "object") { + const method = init2[Symbol.iterator]; + if (method != null) { + if (typeof method !== "function") { + throw new TypeError("Header pairs must be iterable"); + } + const pairs = []; + for (const pair of init2) { + if (typeof pair !== "object" || typeof pair[Symbol.iterator] !== "function") { + throw new TypeError("Each header pair must be iterable"); + } + pairs.push(Array.from(pair)); + } + for (const pair of pairs) { + if (pair.length !== 2) { + throw new TypeError("Each header pair must be a name/value tuple"); + } + this.append(pair[0], pair[1]); + } + } else { + for (const key of Object.keys(init2)) { + const value = init2[key]; + this.append(key, value); + } + } + } else { + throw new TypeError("Provided initializer must be an object"); + } } - if (match && TEXT_TYPE_REGEXP.test(match[1])) { - return "UTF-8"; + /** + * Return combined header value given name + * + * @param String name Header name + * @return Mixed + */ + get(name2) { + name2 = `${name2}`; + validateName(name2); + const key = find(this[MAP], name2); + if (key === void 0) { + return null; + } + return this[MAP][key].join(", "); } - return false; - } - function contentType2(str) { - if (!str || typeof str !== "string") { - return false; + /** + * Iterate over all headers + * + * @param Function callback Executed for each item with parameters (value, name, thisArg) + * @param Boolean thisArg `this` context for callback function + * @return Void + */ + forEach(callback) { + let thisArg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0; + let pairs = getHeaders(this); + let i2 = 0; + while (i2 < pairs.length) { + var _pairs$i = pairs[i2]; + const name2 = _pairs$i[0], value = _pairs$i[1]; + callback.call(thisArg, value, name2, this); + pairs = getHeaders(this); + i2++; + } } - var mime = str.indexOf("/") === -1 ? exports.lookup(str) : str; - if (!mime) { - return false; + /** + * Overwrite header values given name + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + set(name2, value) { + name2 = `${name2}`; + value = `${value}`; + validateName(name2); + validateValue(value); + const key = find(this[MAP], name2); + this[MAP][key !== void 0 ? key : name2] = [value]; + } + /** + * Append a value onto existing header + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + append(name2, value) { + name2 = `${name2}`; + value = `${value}`; + validateName(name2); + validateValue(value); + const key = find(this[MAP], name2); + if (key !== void 0) { + this[MAP][key].push(value); + } else { + this[MAP][name2] = [value]; + } + } + /** + * Check for header name existence + * + * @param String name Header name + * @return Boolean + */ + has(name2) { + name2 = `${name2}`; + validateName(name2); + return find(this[MAP], name2) !== void 0; + } + /** + * Delete all header values given name + * + * @param String name Header name + * @return Void + */ + delete(name2) { + name2 = `${name2}`; + validateName(name2); + const key = find(this[MAP], name2); + if (key !== void 0) { + delete this[MAP][key]; + } + } + /** + * Return raw headers (non-spec api) + * + * @return Object + */ + raw() { + return this[MAP]; + } + /** + * Get an iterator on keys. + * + * @return Iterator + */ + keys() { + return createHeadersIterator(this, "key"); + } + /** + * Get an iterator on values. + * + * @return Iterator + */ + values() { + return createHeadersIterator(this, "value"); + } + /** + * Get an iterator on entries. + * + * This is the default iterator of the Headers object. + * + * @return Iterator + */ + [Symbol.iterator]() { + return createHeadersIterator(this, "key+value"); + } + }; + Headers.prototype.entries = Headers.prototype[Symbol.iterator]; + Object.defineProperty(Headers.prototype, Symbol.toStringTag, { + value: "Headers", + writable: false, + enumerable: false, + configurable: true + }); + Object.defineProperties(Headers.prototype, { + get: { enumerable: true }, + forEach: { enumerable: true }, + set: { enumerable: true }, + append: { enumerable: true }, + has: { enumerable: true }, + delete: { enumerable: true }, + keys: { enumerable: true }, + values: { enumerable: true }, + entries: { enumerable: true } + }); + INTERNAL = Symbol("internal"); + HeadersIteratorPrototype = Object.setPrototypeOf({ + next() { + if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { + throw new TypeError("Value of `this` is not a HeadersIterator"); + } + var _INTERNAL = this[INTERNAL]; + const target = _INTERNAL.target, kind = _INTERNAL.kind, index = _INTERNAL.index; + const values = getHeaders(target, kind); + const len = values.length; + if (index >= len) { + return { + value: void 0, + done: true + }; + } + this[INTERNAL].index = index + 1; + return { + value: values[index], + done: false + }; + } + }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); + Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { + value: "HeadersIterator", + writable: false, + enumerable: false, + configurable: true + }); + INTERNALS$1 = Symbol("Response internals"); + STATUS_CODES = http.STATUS_CODES; + Response = class _Response { + constructor() { + let body2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null; + let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + Body.call(this, body2, opts); + const status = opts.status || 200; + const headers = new Headers(opts.headers); + if (body2 != null && !headers.has("Content-Type")) { + const contentType2 = extractContentType(body2); + if (contentType2) { + headers.append("Content-Type", contentType2); + } + } + this[INTERNALS$1] = { + url: opts.url, + status, + statusText: opts.statusText || STATUS_CODES[status], + headers, + counter: opts.counter + }; + } + get url() { + return this[INTERNALS$1].url || ""; + } + get status() { + return this[INTERNALS$1].status; + } + /** + * Convenience property representing if the request ended normally + */ + get ok() { + return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; + } + get redirected() { + return this[INTERNALS$1].counter > 0; + } + get statusText() { + return this[INTERNALS$1].statusText; + } + get headers() { + return this[INTERNALS$1].headers; + } + /** + * Clone this response + * + * @return Response + */ + clone() { + return new _Response(clone(this), { + url: this.url, + status: this.status, + statusText: this.statusText, + headers: this.headers, + ok: this.ok, + redirected: this.redirected + }); + } + }; + Body.mixIn(Response.prototype); + Object.defineProperties(Response.prototype, { + url: { enumerable: true }, + status: { enumerable: true }, + ok: { enumerable: true }, + redirected: { enumerable: true }, + statusText: { enumerable: true }, + headers: { enumerable: true }, + clone: { enumerable: true } + }); + Object.defineProperty(Response.prototype, Symbol.toStringTag, { + value: "Response", + writable: false, + enumerable: false, + configurable: true + }); + INTERNALS$2 = Symbol("Request internals"); + URL3 = Url.URL || whatwgUrl.URL; + parse_url = Url.parse; + format_url = Url.format; + streamDestructionSupported = "destroy" in Stream.Readable.prototype; + Request = class _Request { + constructor(input) { + let init2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + let parsedURL; + if (!isRequest(input)) { + if (input && input.href) { + parsedURL = parseURL(input.href); + } else { + parsedURL = parseURL(`${input}`); + } + input = {}; + } else { + parsedURL = parseURL(input.url); + } + let method = init2.method || input.method || "GET"; + method = method.toUpperCase(); + if ((init2.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) { + throw new TypeError("Request with GET/HEAD method cannot have body"); + } + let inputBody = init2.body != null ? init2.body : isRequest(input) && input.body !== null ? clone(input) : null; + Body.call(this, inputBody, { + timeout: init2.timeout || input.timeout || 0, + size: init2.size || input.size || 0 + }); + const headers = new Headers(init2.headers || input.headers || {}); + if (inputBody != null && !headers.has("Content-Type")) { + const contentType2 = extractContentType(inputBody); + if (contentType2) { + headers.append("Content-Type", contentType2); + } + } + let signal = isRequest(input) ? input.signal : null; + if ("signal" in init2) + signal = init2.signal; + if (signal != null && !isAbortSignal(signal)) { + throw new TypeError("Expected signal to be an instanceof AbortSignal"); + } + this[INTERNALS$2] = { + method, + redirect: init2.redirect || input.redirect || "follow", + headers, + parsedURL, + signal + }; + this.follow = init2.follow !== void 0 ? init2.follow : input.follow !== void 0 ? input.follow : 20; + this.compress = init2.compress !== void 0 ? init2.compress : input.compress !== void 0 ? input.compress : true; + this.counter = init2.counter || input.counter || 0; + this.agent = init2.agent || input.agent; + } + get method() { + return this[INTERNALS$2].method; } - if (mime.indexOf("charset") === -1) { - var charset2 = exports.charset(mime); - if (charset2) - mime += "; charset=" + charset2.toLowerCase(); + get url() { + return format_url(this[INTERNALS$2].parsedURL); } - return mime; - } - function extension(type3) { - if (!type3 || typeof type3 !== "string") { - return false; + get headers() { + return this[INTERNALS$2].headers; } - var match = EXTRACT_TYPE_REGEXP.exec(type3); - var exts = match && exports.extensions[match[1].toLowerCase()]; - if (!exts || !exts.length) { - return false; + get redirect() { + return this[INTERNALS$2].redirect; } - return exts[0]; - } - function lookup(path15) { - if (!path15 || typeof path15 !== "string") { - return false; + get signal() { + return this[INTERNALS$2].signal; } - var extension2 = extname("x." + path15).toLowerCase().substr(1); - if (!extension2) { - return false; + /** + * Clone this request + * + * @return Request + */ + clone() { + return new _Request(this); } - return exports.types[extension2] || false; - } - function populateMaps(extensions, types) { - var preference = ["nginx", "apache", void 0, "iana"]; - Object.keys(db).forEach(function forEachMimeType(type3) { - var mime = db[type3]; - var exts = mime.extensions; - if (!exts || !exts.length) { - return; - } - extensions[type3] = exts; - for (var i2 = 0; i2 < exts.length; i2++) { - var extension2 = exts[i2]; - if (types[extension2]) { - var from = preference.indexOf(db[types[extension2]].source); - var to2 = preference.indexOf(mime.source); - if (types[extension2] !== "application/octet-stream" && (from > to2 || from === to2 && types[extension2].substr(0, 12) === "application/")) { - continue; - } - } - types[extension2] = type3; - } - }); - } + }; + Body.mixIn(Request.prototype); + Object.defineProperty(Request.prototype, Symbol.toStringTag, { + value: "Request", + writable: false, + enumerable: false, + configurable: true + }); + Object.defineProperties(Request.prototype, { + method: { enumerable: true }, + url: { enumerable: true }, + headers: { enumerable: true }, + redirect: { enumerable: true }, + clone: { enumerable: true }, + signal: { enumerable: true } + }); + AbortError.prototype = Object.create(Error.prototype); + AbortError.prototype.constructor = AbortError; + AbortError.prototype.name = "AbortError"; + URL$1 = Url.URL || whatwgUrl.URL; + PassThrough$1 = Stream.PassThrough; + isDomainOrSubdomain = function isDomainOrSubdomain2(destination, original) { + const orig = new URL$1(original).hostname; + const dest = new URL$1(destination).hostname; + return orig === dest || orig[orig.length - dest.length - 1] === "." && orig.endsWith(dest); + }; + isSameProtocol = function isSameProtocol2(destination, original) { + const orig = new URL$1(original).protocol; + const dest = new URL$1(destination).protocol; + return orig === dest; + }; + fetch.isRedirect = function(code) { + return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; + }; + fetch.Promise = global.Promise; + lib_default = fetch; } }); -// node_modules/asynckit/lib/defer.js -var require_defer = __commonJS({ - "node_modules/asynckit/lib/defer.js"(exports, module) { - module.exports = defer; - function defer(fn2) { - var nextTick = typeof setImmediate == "function" ? setImmediate : typeof process == "object" && typeof process.nextTick == "function" ? process.nextTick : null; - if (nextTick) { - nextTick(fn2); - } else { - setTimeout(fn2, 0); - } - } - } +// src/shim/abort-controller.ts +var abort_controller_exports = {}; +__export(abort_controller_exports, { + AbortController: () => AbortController2, + AbortError: () => AbortError, + AbortSignal: () => AbortSignal2 }); - -// node_modules/asynckit/lib/async.js -var require_async = __commonJS({ - "node_modules/asynckit/lib/async.js"(exports, module) { - var defer = require_defer(); - module.exports = async; - function async(callback) { - var isAsync = false; - defer(function() { - isAsync = true; - }); - return function async_callback(err, result) { - if (isAsync) { - callback(err, result); - } else { - defer(function nextTick_callback() { - callback(err, result); - }); - } - }; - } +var AbortController2, AbortSignal2; +var init_abort_controller = __esm({ + "src/shim/abort-controller.ts"() { + "use strict"; + init_lib(); + ({ AbortController: AbortController2, AbortSignal: AbortSignal2 } = globalThis); } }); -// node_modules/asynckit/lib/abort.js -var require_abort = __commonJS({ - "node_modules/asynckit/lib/abort.js"(exports, module) { - module.exports = abort; - function abort(state) { - Object.keys(state.jobs).forEach(clean.bind(state)); - state.jobs = {}; - } - function clean(key) { - if (typeof this.jobs[key] == "function") { - this.jobs[key](); - } - } +// node_modules/@azure/core-http/dist-esm/src/url.js +function isAlphaNumericCharacter(character) { + const characterCode = character.charCodeAt(0); + return 48 <= characterCode && characterCode <= 57 || 65 <= characterCode && characterCode <= 90 || 97 <= characterCode && characterCode <= 122; +} +function readRemaining(tokenizer) { + let result = ""; + if (tokenizer._currentIndex < tokenizer._textLength) { + result = tokenizer._text.substring(tokenizer._currentIndex); + tokenizer._currentIndex = tokenizer._textLength; } -}); - -// node_modules/asynckit/lib/iterate.js -var require_iterate = __commonJS({ - "node_modules/asynckit/lib/iterate.js"(exports, module) { - var async = require_async(); - var abort = require_abort(); - module.exports = iterate; - function iterate(list3, iterator, state, callback) { - var key = state["keyedList"] ? state["keyedList"][state.index] : state.index; - state.jobs[key] = runJob(iterator, key, list3[key], function(error, output) { - if (!(key in state.jobs)) { - return; - } - delete state.jobs[key]; - if (error) { - abort(state); - } else { - state.results[key] = output; - } - callback(error, state.results); - }); - } - function runJob(iterator, key, item, callback) { - var aborter; - if (iterator.length == 2) { - aborter = iterator(item, async(callback)); - } else { - aborter = iterator(item, key, async(callback)); - } - return aborter; + return result; +} +function hasCurrentCharacter(tokenizer) { + return tokenizer._currentIndex < tokenizer._textLength; +} +function getCurrentCharacter(tokenizer) { + return tokenizer._text[tokenizer._currentIndex]; +} +function nextCharacter(tokenizer, step) { + if (hasCurrentCharacter(tokenizer)) { + if (!step) { + step = 1; } + tokenizer._currentIndex += step; } -}); - -// node_modules/asynckit/lib/state.js -var require_state = __commonJS({ - "node_modules/asynckit/lib/state.js"(exports, module) { - module.exports = state; - function state(list3, sortMethod) { - var isNamedList = !Array.isArray(list3), initState = { - index: 0, - keyedList: isNamedList || sortMethod ? Object.keys(list3) : null, - jobs: {}, - results: isNamedList ? {} : [], - size: isNamedList ? Object.keys(list3).length : list3.length - }; - if (sortMethod) { - initState.keyedList.sort(isNamedList ? sortMethod : function(a2, b2) { - return sortMethod(list3[a2], list3[b2]); - }); - } - return initState; - } +} +function peekCharacters(tokenizer, charactersToPeek) { + let endIndex = tokenizer._currentIndex + charactersToPeek; + if (tokenizer._textLength < endIndex) { + endIndex = tokenizer._textLength; } -}); - -// node_modules/asynckit/lib/terminator.js -var require_terminator = __commonJS({ - "node_modules/asynckit/lib/terminator.js"(exports, module) { - var abort = require_abort(); - var async = require_async(); - module.exports = terminator; - function terminator(callback) { - if (!Object.keys(this.jobs).length) { - return; - } - this.index = this.size; - abort(this); - async(callback)(null, this.results); + return tokenizer._text.substring(tokenizer._currentIndex, endIndex); +} +function readWhile(tokenizer, condition) { + let result = ""; + while (hasCurrentCharacter(tokenizer)) { + const currentCharacter = getCurrentCharacter(tokenizer); + if (!condition(currentCharacter)) { + break; + } else { + result += currentCharacter; + nextCharacter(tokenizer); } } -}); - -// node_modules/asynckit/parallel.js -var require_parallel = __commonJS({ - "node_modules/asynckit/parallel.js"(exports, module) { - var iterate = require_iterate(); - var initState = require_state(); - var terminator = require_terminator(); - module.exports = parallel; - function parallel(list3, iterator, callback) { - var state = initState(list3); - while (state.index < (state["keyedList"] || list3).length) { - iterate(list3, iterator, state, function(error, result) { - if (error) { - callback(error, result); - return; - } - if (Object.keys(state.jobs).length === 0) { - callback(null, state.results); - return; - } - }); - state.index++; - } - return terminator.bind(state, callback); - } + return result; +} +function readWhileLetterOrDigit(tokenizer) { + return readWhile(tokenizer, (character) => isAlphaNumericCharacter(character)); +} +function readUntilCharacter(tokenizer, ...terminatingCharacters) { + return readWhile(tokenizer, (character) => terminatingCharacters.indexOf(character) === -1); +} +function nextScheme(tokenizer) { + const scheme = readWhileLetterOrDigit(tokenizer); + tokenizer._currentToken = URLToken.scheme(scheme); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentState = "DONE"; + } else { + tokenizer._currentState = "HOST"; } -}); - -// node_modules/asynckit/serialOrdered.js -var require_serialOrdered = __commonJS({ - "node_modules/asynckit/serialOrdered.js"(exports, module) { - var iterate = require_iterate(); - var initState = require_state(); - var terminator = require_terminator(); - module.exports = serialOrdered; - module.exports.ascending = ascending; - module.exports.descending = descending; - function serialOrdered(list3, iterator, sortMethod, callback) { - var state = initState(list3, sortMethod); - iterate(list3, iterator, state, function iteratorHandler(error, result) { - if (error) { - callback(error, result); - return; - } - state.index++; - if (state.index < (state["keyedList"] || list3).length) { - iterate(list3, iterator, state, iteratorHandler); - return; - } - callback(null, state.results); - }); - return terminator.bind(state, callback); - } - function ascending(a2, b2) { - return a2 < b2 ? -1 : a2 > b2 ? 1 : 0; +} +function nextSchemeOrHost(tokenizer) { + const schemeOrHost = readUntilCharacter(tokenizer, ":", "/", "?"); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentToken = URLToken.host(schemeOrHost); + tokenizer._currentState = "DONE"; + } else if (getCurrentCharacter(tokenizer) === ":") { + if (peekCharacters(tokenizer, 3) === "://") { + tokenizer._currentToken = URLToken.scheme(schemeOrHost); + tokenizer._currentState = "HOST"; + } else { + tokenizer._currentToken = URLToken.host(schemeOrHost); + tokenizer._currentState = "PORT"; } - function descending(a2, b2) { - return -1 * ascending(a2, b2); + } else { + tokenizer._currentToken = URLToken.host(schemeOrHost); + if (getCurrentCharacter(tokenizer) === "/") { + tokenizer._currentState = "PATH"; + } else { + tokenizer._currentState = "QUERY"; } } -}); - -// node_modules/asynckit/serial.js -var require_serial = __commonJS({ - "node_modules/asynckit/serial.js"(exports, module) { - var serialOrdered = require_serialOrdered(); - module.exports = serial; - function serial(list3, iterator, callback) { - return serialOrdered(list3, iterator, null, callback); - } +} +function nextHost(tokenizer) { + if (peekCharacters(tokenizer, 3) === "://") { + nextCharacter(tokenizer, 3); } -}); - -// node_modules/asynckit/index.js -var require_asynckit = __commonJS({ - "node_modules/asynckit/index.js"(exports, module) { - module.exports = { - parallel: require_parallel(), - serial: require_serial(), - serialOrdered: require_serialOrdered() - }; + const host = readUntilCharacter(tokenizer, ":", "/", "?"); + tokenizer._currentToken = URLToken.host(host); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentState = "DONE"; + } else if (getCurrentCharacter(tokenizer) === ":") { + tokenizer._currentState = "PORT"; + } else if (getCurrentCharacter(tokenizer) === "/") { + tokenizer._currentState = "PATH"; + } else { + tokenizer._currentState = "QUERY"; } -}); - -// node_modules/@azure/core-http/node_modules/form-data/lib/populate.js -var require_populate = __commonJS({ - "node_modules/@azure/core-http/node_modules/form-data/lib/populate.js"(exports, module) { - module.exports = function(dst, src) { - Object.keys(src).forEach(function(prop) { - dst[prop] = dst[prop] || src[prop]; - }); - return dst; - }; +} +function nextPort(tokenizer) { + if (getCurrentCharacter(tokenizer) === ":") { + nextCharacter(tokenizer); } -}); - -// node_modules/@azure/core-http/node_modules/form-data/lib/form_data.js -var require_form_data = __commonJS({ - "node_modules/@azure/core-http/node_modules/form-data/lib/form_data.js"(exports, module) { - var CombinedStream = require_combined_stream(); - var util3 = __require("util"); - var path15 = __require("path"); - var http4 = __require("http"); - var https3 = __require("https"); - var parseUrl = __require("url").parse; - var fs3 = __require("fs"); - var Stream2 = __require("stream").Stream; - var mime = require_mime_types(); - var asynckit = require_asynckit(); - var populate = require_populate(); - module.exports = FormData2; - util3.inherits(FormData2, CombinedStream); - function FormData2(options) { - if (!(this instanceof FormData2)) { - return new FormData2(options); - } - this._overheadLength = 0; - this._valueLength = 0; - this._valuesToMeasure = []; - CombinedStream.call(this); - options = options || {}; - for (var option in options) { - this[option] = options[option]; - } - } - FormData2.LINE_BREAK = "\r\n"; - FormData2.DEFAULT_CONTENT_TYPE = "application/octet-stream"; - FormData2.prototype.append = function(field, value, options) { - options = options || {}; - if (typeof options == "string") { - options = { filename: options }; - } - var append = CombinedStream.prototype.append.bind(this); - if (typeof value == "number") { - value = "" + value; - } - if (util3.isArray(value)) { - this._error(new Error("Arrays are not supported.")); - return; - } - var header = this._multiPartHeader(field, value, options); - var footer = this._multiPartFooter(); - append(header); - append(value); - append(footer); - this._trackLength(header, value, options); - }; - FormData2.prototype._trackLength = function(header, value, options) { - var valueLength = 0; - if (options.knownLength != null) { - valueLength += +options.knownLength; - } else if (Buffer.isBuffer(value)) { - valueLength = value.length; - } else if (typeof value === "string") { - valueLength = Buffer.byteLength(value); - } - this._valueLength += valueLength; - this._overheadLength += Buffer.byteLength(header) + FormData2.LINE_BREAK.length; - if (!value || !value.path && !(value.readable && value.hasOwnProperty("httpVersion")) && !(value instanceof Stream2)) { - return; - } - if (!options.knownLength) { - this._valuesToMeasure.push(value); - } - }; - FormData2.prototype._lengthRetriever = function(value, callback) { - if (value.hasOwnProperty("fd")) { - if (value.end != void 0 && value.end != Infinity && value.start != void 0) { - callback(null, value.end + 1 - (value.start ? value.start : 0)); - } else { - fs3.stat(value.path, function(err, stat2) { - var fileSize; - if (err) { - callback(err); - return; - } - fileSize = stat2.size - (value.start ? value.start : 0); - callback(null, fileSize); - }); - } - } else if (value.hasOwnProperty("httpVersion")) { - callback(null, +value.headers["content-length"]); - } else if (value.hasOwnProperty("httpModule")) { - value.on("response", function(response) { - value.pause(); - callback(null, +response.headers["content-length"]); - }); - value.resume(); - } else { - callback("Unknown stream"); + const port = readUntilCharacter(tokenizer, "/", "?"); + tokenizer._currentToken = URLToken.port(port); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentState = "DONE"; + } else if (getCurrentCharacter(tokenizer) === "/") { + tokenizer._currentState = "PATH"; + } else { + tokenizer._currentState = "QUERY"; + } +} +function nextPath(tokenizer) { + const path14 = readUntilCharacter(tokenizer, "?"); + tokenizer._currentToken = URLToken.path(path14); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentState = "DONE"; + } else { + tokenizer._currentState = "QUERY"; + } +} +function nextQuery(tokenizer) { + if (getCurrentCharacter(tokenizer) === "?") { + nextCharacter(tokenizer); + } + const query = readRemaining(tokenizer); + tokenizer._currentToken = URLToken.query(query); + tokenizer._currentState = "DONE"; +} +var URLQuery, URLBuilder, URLToken, URLTokenizer; +var init_url = __esm({ + "node_modules/@azure/core-http/dist-esm/src/url.js"() { + init_utils(); + URLQuery = class _URLQuery { + constructor() { + this._rawQuery = {}; } - }; - FormData2.prototype._multiPartHeader = function(field, value, options) { - if (typeof options.header == "string") { - return options.header; + /** + * Get whether or not there any query parameters in this URLQuery. + */ + any() { + return Object.keys(this._rawQuery).length > 0; } - var contentDisposition = this._getContentDisposition(value, options); - var contentType2 = this._getContentType(value, options); - var contents = ""; - var headers = { - // add custom disposition as third element or keep it two elements if not - "Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []), - // if no content type. allow it to be empty array - "Content-Type": [].concat(contentType2 || []) - }; - if (typeof options.header == "object") { - populate(headers, options.header); + /** + * Get the keys of the query string. + */ + keys() { + return Object.keys(this._rawQuery); } - var header; - for (var prop in headers) { - if (!headers.hasOwnProperty(prop)) - continue; - header = headers[prop]; - if (header == null) { - continue; - } - if (!Array.isArray(header)) { - header = [header]; - } - if (header.length) { - contents += prop + ": " + header.join("; ") + FormData2.LINE_BREAK; + /** + * Set a query parameter with the provided name and value. If the parameterValue is undefined or + * empty, then this will attempt to remove an existing query parameter with the provided + * parameterName. + */ + set(parameterName, parameterValue) { + const caseParameterValue = parameterValue; + if (parameterName) { + if (caseParameterValue !== void 0 && caseParameterValue !== null) { + const newValue = Array.isArray(caseParameterValue) ? caseParameterValue : caseParameterValue.toString(); + this._rawQuery[parameterName] = newValue; + } else { + delete this._rawQuery[parameterName]; + } } } - return "--" + this.getBoundary() + FormData2.LINE_BREAK + contents + FormData2.LINE_BREAK; - }; - FormData2.prototype._getContentDisposition = function(value, options) { - var filename, contentDisposition; - if (typeof options.filepath === "string") { - filename = path15.normalize(options.filepath).replace(/\\/g, "/"); - } else if (options.filename || value.name || value.path) { - filename = path15.basename(options.filename || value.name || value.path); - } else if (value.readable && value.hasOwnProperty("httpVersion")) { - filename = path15.basename(value.client._httpMessage.path || ""); - } - if (filename) { - contentDisposition = 'filename="' + filename + '"'; - } - return contentDisposition; - }; - FormData2.prototype._getContentType = function(value, options) { - var contentType2 = options.contentType; - if (!contentType2 && value.name) { - contentType2 = mime.lookup(value.name); - } - if (!contentType2 && value.path) { - contentType2 = mime.lookup(value.path); - } - if (!contentType2 && value.readable && value.hasOwnProperty("httpVersion")) { - contentType2 = value.headers["content-type"]; - } - if (!contentType2 && (options.filepath || options.filename)) { - contentType2 = mime.lookup(options.filepath || options.filename); - } - if (!contentType2 && typeof value == "object") { - contentType2 = FormData2.DEFAULT_CONTENT_TYPE; + /** + * Get the value of the query parameter with the provided name. If no parameter exists with the + * provided parameter name, then undefined will be returned. + */ + get(parameterName) { + return parameterName ? this._rawQuery[parameterName] : void 0; } - return contentType2; - }; - FormData2.prototype._multiPartFooter = function() { - return function(next) { - var footer = FormData2.LINE_BREAK; - var lastPart = this._streams.length === 0; - if (lastPart) { - footer += this._lastBoundary(); - } - next(footer); - }.bind(this); - }; - FormData2.prototype._lastBoundary = function() { - return "--" + this.getBoundary() + "--" + FormData2.LINE_BREAK; - }; - FormData2.prototype.getHeaders = function(userHeaders) { - var header; - var formHeaders = { - "content-type": "multipart/form-data; boundary=" + this.getBoundary() - }; - for (header in userHeaders) { - if (userHeaders.hasOwnProperty(header)) { - formHeaders[header.toLowerCase()] = userHeaders[header]; + /** + * Get the string representation of this query. The return value will not start with a "?". + */ + toString() { + let result = ""; + for (const parameterName in this._rawQuery) { + if (result) { + result += "&"; + } + const parameterValue = this._rawQuery[parameterName]; + if (Array.isArray(parameterValue)) { + const parameterStrings = []; + for (const parameterValueElement of parameterValue) { + parameterStrings.push(`${parameterName}=${parameterValueElement}`); + } + result += parameterStrings.join("&"); + } else { + result += `${parameterName}=${parameterValue}`; + } } + return result; } - return formHeaders; - }; - FormData2.prototype.setBoundary = function(boundary) { - this._boundary = boundary; - }; - FormData2.prototype.getBoundary = function() { - if (!this._boundary) { - this._generateBoundary(); - } - return this._boundary; - }; - FormData2.prototype.getBuffer = function() { - var dataBuffer = new Buffer.alloc(0); - var boundary = this.getBoundary(); - for (var i2 = 0, len = this._streams.length; i2 < len; i2++) { - if (typeof this._streams[i2] !== "function") { - if (Buffer.isBuffer(this._streams[i2])) { - dataBuffer = Buffer.concat([dataBuffer, this._streams[i2]]); - } else { - dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i2])]); + /** + * Parse a URLQuery from the provided text. + */ + static parse(text) { + const result = new _URLQuery(); + if (text) { + if (text.startsWith("?")) { + text = text.substring(1); } - if (typeof this._streams[i2] !== "string" || this._streams[i2].substring(2, boundary.length + 2) !== boundary) { - dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData2.LINE_BREAK)]); + let currentState = "ParameterName"; + let parameterName = ""; + let parameterValue = ""; + for (let i2 = 0; i2 < text.length; ++i2) { + const currentCharacter = text[i2]; + switch (currentState) { + case "ParameterName": + switch (currentCharacter) { + case "=": + currentState = "ParameterValue"; + break; + case "&": + parameterName = ""; + parameterValue = ""; + break; + default: + parameterName += currentCharacter; + break; + } + break; + case "ParameterValue": + switch (currentCharacter) { + case "&": + result.set(parameterName, parameterValue); + parameterName = ""; + parameterValue = ""; + currentState = "ParameterName"; + break; + default: + parameterValue += currentCharacter; + break; + } + break; + default: + throw new Error("Unrecognized URLQuery parse state: " + currentState); + } + } + if (currentState === "ParameterValue") { + result.set(parameterName, parameterValue); } } + return result; } - return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]); }; - FormData2.prototype._generateBoundary = function() { - var boundary = "--------------------------"; - for (var i2 = 0; i2 < 24; i2++) { - boundary += Math.floor(Math.random() * 10).toString(16); + URLBuilder = class _URLBuilder { + /** + * Set the scheme/protocol for this URL. If the provided scheme contains other parts of a URL + * (such as a host, port, path, or query), those parts will be added to this URL as well. + */ + setScheme(scheme) { + if (!scheme) { + this._scheme = void 0; + } else { + this.set(scheme, "SCHEME"); + } } - this._boundary = boundary; - }; - FormData2.prototype.getLengthSync = function() { - var knownLength = this._overheadLength + this._valueLength; - if (this._streams.length) { - knownLength += this._lastBoundary().length; + /** + * Get the scheme that has been set in this URL. + */ + getScheme() { + return this._scheme; } - if (!this.hasKnownLength()) { - this._error(new Error("Cannot calculate proper length in synchronous way.")); + /** + * Set the host for this URL. If the provided host contains other parts of a URL (such as a + * port, path, or query), those parts will be added to this URL as well. + */ + setHost(host) { + if (!host) { + this._host = void 0; + } else { + this.set(host, "SCHEME_OR_HOST"); + } } - return knownLength; - }; - FormData2.prototype.hasKnownLength = function() { - var hasKnownLength = true; - if (this._valuesToMeasure.length) { - hasKnownLength = false; + /** + * Get the host that has been set in this URL. + */ + getHost() { + return this._host; } - return hasKnownLength; - }; - FormData2.prototype.getLength = function(cb) { - var knownLength = this._overheadLength + this._valueLength; - if (this._streams.length) { - knownLength += this._lastBoundary().length; + /** + * Set the port for this URL. If the provided port contains other parts of a URL (such as a + * path or query), those parts will be added to this URL as well. + */ + setPort(port) { + if (port === void 0 || port === null || port === "") { + this._port = void 0; + } else { + this.set(port.toString(), "PORT"); + } } - if (!this._valuesToMeasure.length) { - process.nextTick(cb.bind(this, null, knownLength)); - return; + /** + * Get the port that has been set in this URL. + */ + getPort() { + return this._port; } - asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { - if (err) { - cb(err); - return; + /** + * Set the path for this URL. If the provided path contains a query, then it will be added to + * this URL as well. + */ + setPath(path14) { + if (!path14) { + this._path = void 0; + } else { + const schemeIndex = path14.indexOf("://"); + if (schemeIndex !== -1) { + const schemeStart = path14.lastIndexOf("/", schemeIndex); + this.set(schemeStart === -1 ? path14 : path14.substr(schemeStart + 1), "SCHEME"); + } else { + this.set(path14, "PATH"); + } } - values.forEach(function(length) { - knownLength += length; - }); - cb(null, knownLength); - }); - }; - FormData2.prototype.submit = function(params, cb) { - var request, options, defaults = { method: "post" }; - if (typeof params == "string") { - params = parseUrl(params); - options = populate({ - port: params.port, - path: params.pathname, - host: params.hostname, - protocol: params.protocol - }, defaults); - } else { - options = populate(params, defaults); - if (!options.port) { - options.port = options.protocol == "https:" ? 443 : 80; + } + /** + * Append the provided path to this URL's existing path. If the provided path contains a query, + * then it will be added to this URL as well. + */ + appendPath(path14) { + if (path14) { + let currentPath = this.getPath(); + if (currentPath) { + if (!currentPath.endsWith("/")) { + currentPath += "/"; + } + if (path14.startsWith("/")) { + path14 = path14.substring(1); + } + path14 = currentPath + path14; + } + this.set(path14, "PATH"); } } - options.headers = this.getHeaders(params.headers); - if (options.protocol == "https:") { - request = https3.request(options); - } else { - request = http4.request(options); + /** + * Get the path that has been set in this URL. + */ + getPath() { + return this._path; } - this.getLength(function(err, length) { - if (err && err !== "Unknown stream") { - this._error(err); - return; - } - if (length) { - request.setHeader("Content-Length", length); - } - this.pipe(request); - if (cb) { - var onResponse; - var callback = function(error, responce) { - request.removeListener("error", callback); - request.removeListener("response", onResponse); - return cb.call(this, error, responce); - }; - onResponse = callback.bind(this, null); - request.on("error", callback); - request.on("response", onResponse); + /** + * Set the query in this URL. + */ + setQuery(query) { + if (!query) { + this._query = void 0; + } else { + this._query = URLQuery.parse(query); } - }.bind(this)); - return request; - }; - FormData2.prototype._error = function(err) { - if (!this.error) { - this.error = err; - this.pause(); - this.emit("error", err); - } - }; - FormData2.prototype.toString = function() { - return "[object FormData]"; - }; - } -}); - -// node_modules/@azure/core-http/dist-esm/src/util/sanitizer.js -var RedactedString, defaultAllowedHeaderNames, defaultAllowedQueryParameters, Sanitizer; -var init_sanitizer = __esm({ - "node_modules/@azure/core-http/dist-esm/src/util/sanitizer.js"() { - init_url(); - init_utils(); - RedactedString = "REDACTED"; - defaultAllowedHeaderNames = [ - "x-ms-client-request-id", - "x-ms-return-client-request-id", - "x-ms-useragent", - "x-ms-correlation-request-id", - "x-ms-request-id", - "client-request-id", - "ms-cv", - "return-client-request-id", - "traceparent", - "Access-Control-Allow-Credentials", - "Access-Control-Allow-Headers", - "Access-Control-Allow-Methods", - "Access-Control-Allow-Origin", - "Access-Control-Expose-Headers", - "Access-Control-Max-Age", - "Access-Control-Request-Headers", - "Access-Control-Request-Method", - "Origin", - "Accept", - "Accept-Encoding", - "Cache-Control", - "Connection", - "Content-Length", - "Content-Type", - "Date", - "ETag", - "Expires", - "If-Match", - "If-Modified-Since", - "If-None-Match", - "If-Unmodified-Since", - "Last-Modified", - "Pragma", - "Request-Id", - "Retry-After", - "Server", - "Transfer-Encoding", - "User-Agent", - "WWW-Authenticate" - ]; - defaultAllowedQueryParameters = ["api-version"]; - Sanitizer = class { - constructor({ allowedHeaderNames = [], allowedQueryParameters = [] } = {}) { - allowedHeaderNames = Array.isArray(allowedHeaderNames) ? defaultAllowedHeaderNames.concat(allowedHeaderNames) : defaultAllowedHeaderNames; - allowedQueryParameters = Array.isArray(allowedQueryParameters) ? defaultAllowedQueryParameters.concat(allowedQueryParameters) : defaultAllowedQueryParameters; - this.allowedHeaderNames = new Set(allowedHeaderNames.map((n2) => n2.toLowerCase())); - this.allowedQueryParameters = new Set(allowedQueryParameters.map((p2) => p2.toLowerCase())); } - sanitize(obj) { - const seen = /* @__PURE__ */ new Set(); - return JSON.stringify(obj, (key, value) => { - if (value instanceof Error) { - return Object.assign(Object.assign({}, value), { name: value.name, message: value.message }); - } - if (key === "_headersMap") { - return this.sanitizeHeaders(value); - } else if (key === "url") { - return this.sanitizeUrl(value); - } else if (key === "query") { - return this.sanitizeQuery(value); - } else if (key === "body") { - return void 0; - } else if (key === "response") { - return void 0; - } else if (key === "operationSpec") { - return void 0; - } else if (Array.isArray(value) || isObject(value)) { - if (seen.has(value)) { - return "[Circular]"; - } - seen.add(value); + /** + * Set a query parameter with the provided name and value in this URL's query. If the provided + * query parameter value is undefined or empty, then the query parameter will be removed if it + * existed. + */ + setQueryParameter(queryParameterName, queryParameterValue) { + if (queryParameterName) { + if (!this._query) { + this._query = new URLQuery(); } - return value; - }, 2); + this._query.set(queryParameterName, queryParameterValue); + } } - sanitizeHeaders(value) { - return this.sanitizeObject(value, this.allowedHeaderNames, (v2, k2) => v2[k2].value); + /** + * Get the value of the query parameter with the provided query parameter name. If no query + * parameter exists with the provided name, then undefined will be returned. + */ + getQueryParameterValue(queryParameterName) { + return this._query ? this._query.get(queryParameterName) : void 0; } - sanitizeQuery(value) { - return this.sanitizeObject(value, this.allowedQueryParameters, (v2, k2) => v2[k2]); + /** + * Get the query in this URL. + */ + getQuery() { + return this._query ? this._query.toString() : void 0; } - sanitizeObject(value, allowedKeys, accessor) { - if (typeof value !== "object" || value === null) { - return value; - } - const sanitized = {}; - for (const k2 of Object.keys(value)) { - if (allowedKeys.has(k2.toLowerCase())) { - sanitized[k2] = accessor(value, k2); - } else { - sanitized[k2] = RedactedString; + /** + * Set the parts of this URL by parsing the provided text using the provided startState. + */ + set(text, startState) { + const tokenizer = new URLTokenizer(text, startState); + while (tokenizer.next()) { + const token = tokenizer.current(); + let tokenPath; + if (token) { + switch (token.type) { + case "SCHEME": + this._scheme = token.text || void 0; + break; + case "HOST": + this._host = token.text || void 0; + break; + case "PORT": + this._port = token.text || void 0; + break; + case "PATH": + tokenPath = token.text || void 0; + if (!this._path || this._path === "/" || tokenPath !== "/") { + this._path = tokenPath; + } + break; + case "QUERY": + this._query = URLQuery.parse(token.text); + break; + default: + throw new Error(`Unrecognized URLTokenType: ${token.type}`); + } } } - return sanitized; } - sanitizeUrl(value) { - if (typeof value !== "string" || value === null) { - return value; + /** + * Serializes the URL as a string. + * @returns the URL as a string. + */ + toString() { + let result = ""; + if (this._scheme) { + result += `${this._scheme}://`; } - const urlBuilder = URLBuilder.parse(value); - const queryString = urlBuilder.getQuery(); - if (!queryString) { - return value; + if (this._host) { + result += this._host; } - const query = URLQuery.parse(queryString); - for (const k2 of query.keys()) { - if (!this.allowedQueryParameters.has(k2.toLowerCase())) { - query.set(k2, RedactedString); + if (this._port) { + result += `:${this._port}`; + } + if (this._path) { + if (!this._path.startsWith("/")) { + result += "/"; } + result += this._path; } - urlBuilder.setQuery(query.toString()); - return urlBuilder.toString(); + if (this._query && this._query.any()) { + result += `?${this._query.toString()}`; + } + return result; } - }; - } -}); - -// node_modules/@azure/core-http/dist-esm/src/util/inspect.js -import { inspect } from "util"; -var custom; -var init_inspect = __esm({ - "node_modules/@azure/core-http/dist-esm/src/util/inspect.js"() { - custom = inspect.custom; - } -}); - -// node_modules/@azure/core-http/dist-esm/src/restError.js -var errorSanitizer, RestError; -var init_restError = __esm({ - "node_modules/@azure/core-http/dist-esm/src/restError.js"() { - init_sanitizer(); - init_inspect(); - errorSanitizer = new Sanitizer(); - RestError = class _RestError extends Error { - constructor(message, code, statusCode, request, response) { - super(message); - this.name = "RestError"; - this.code = code; - this.statusCode = statusCode; - this.request = request; - this.response = response; - Object.setPrototypeOf(this, _RestError.prototype); + /** + * If the provided searchValue is found in this URLBuilder, then replace it with the provided + * replaceValue. + */ + replaceAll(searchValue, replaceValue) { + if (searchValue) { + this.setScheme(replaceAll(this.getScheme(), searchValue, replaceValue)); + this.setHost(replaceAll(this.getHost(), searchValue, replaceValue)); + this.setPort(replaceAll(this.getPort(), searchValue, replaceValue)); + this.setPath(replaceAll(this.getPath(), searchValue, replaceValue)); + this.setQuery(replaceAll(this.getQuery(), searchValue, replaceValue)); + } } /** - * Logging method for util.inspect in Node + * Parses a given string URL into a new {@link URLBuilder}. */ - [custom]() { - return `RestError: ${this.message} - ${errorSanitizer.sanitize(this)}`; + static parse(text) { + const result = new _URLBuilder(); + result.set(text, "SCHEME_OR_HOST"); + return result; } }; - RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - RestError.PARSE_ERROR = "PARSE_ERROR"; - } -}); - -// node_modules/@azure/logger/dist-esm/src/log.js -import { EOL } from "os"; -import util from "util"; -function log(message, ...args) { - process.stderr.write(`${util.format(message, ...args)}${EOL}`); -} -var init_log = __esm({ - "node_modules/@azure/logger/dist-esm/src/log.js"() { - } -}); - -// node_modules/@azure/logger/dist-esm/src/debug.js -function enable(namespaces) { - enabledString = namespaces; - enabledNamespaces = []; - skippedNamespaces = []; - const wildcard = /\*/g; - const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); - for (const ns of namespaceList) { - if (ns.startsWith("-")) { - skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); - } else { - enabledNamespaces.push(new RegExp(`^${ns}$`)); - } - } - for (const instance of debuggers) { - instance.enabled = enabled(instance.namespace); - } -} -function enabled(namespace) { - if (namespace.endsWith("*")) { - return true; - } - for (const skipped of skippedNamespaces) { - if (skipped.test(namespace)) { - return false; - } - } - for (const enabledNamespace of enabledNamespaces) { - if (enabledNamespace.test(namespace)) { - return true; - } - } - return false; -} -function disable() { - const result = enabledString || ""; - enable(""); - return result; -} -function createDebugger(namespace) { - const newDebugger = Object.assign(debug3, { - enabled: enabled(namespace), - destroy, - log: debugObj.log, - namespace, - extend - }); - function debug3(...args) { - if (!newDebugger.enabled) { - return; - } - if (args.length > 0) { - args[0] = `${namespace} ${args[0]}`; - } - newDebugger.log(...args); - } - debuggers.push(newDebugger); - return newDebugger; -} -function destroy() { - const index = debuggers.indexOf(this); - if (index >= 0) { - debuggers.splice(index, 1); - return true; - } - return false; -} -function extend(namespace) { - const newDebugger = createDebugger(`${this.namespace}:${namespace}`); - newDebugger.log = this.log; - return newDebugger; -} -var debugEnvVariable, enabledString, enabledNamespaces, skippedNamespaces, debuggers, debugObj, debug_default; -var init_debug = __esm({ - "node_modules/@azure/logger/dist-esm/src/debug.js"() { - init_log(); - debugEnvVariable = typeof process !== "undefined" && process.env && process.env.DEBUG || void 0; - enabledNamespaces = []; - skippedNamespaces = []; - debuggers = []; - if (debugEnvVariable) { - enable(debugEnvVariable); - } - debugObj = Object.assign((namespace) => { - return createDebugger(namespace); - }, { - enable, - enabled, - disable, - log - }); - debug_default = debugObj; - } -}); - -// node_modules/@azure/logger/dist-esm/src/index.js -function setLogLevel(level) { - if (level && !isAzureLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); - } - azureLogLevel = level; - const enabledNamespaces2 = []; - for (const logger4 of registeredLoggers) { - if (shouldEnable(logger4)) { - enabledNamespaces2.push(logger4.namespace); - } - } - debug_default.enable(enabledNamespaces2.join(",")); -} -function createClientLogger(namespace) { - const clientRootLogger = AzureLogger.extend(namespace); - patchLogMethod(AzureLogger, clientRootLogger); - return { - error: createLogger(clientRootLogger, "error"), - warning: createLogger(clientRootLogger, "warning"), - info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose") - }; -} -function patchLogMethod(parent, child) { - child.log = (...args) => { - parent.log(...args); - }; -} -function createLogger(parent, level) { - const logger4 = Object.assign(parent.extend(level), { - level - }); - patchLogMethod(parent, logger4); - if (shouldEnable(logger4)) { - const enabledNamespaces2 = debug_default.disable(); - debug_default.enable(enabledNamespaces2 + "," + logger4.namespace); - } - registeredLoggers.add(logger4); - return logger4; -} -function shouldEnable(logger4) { - return Boolean(azureLogLevel && levelMap[logger4.level] <= levelMap[azureLogLevel]); -} -function isAzureLogLevel(logLevel) { - return AZURE_LOG_LEVELS.includes(logLevel); -} -var registeredLoggers, logLevelFromEnv, azureLogLevel, AzureLogger, AZURE_LOG_LEVELS, levelMap; -var init_src = __esm({ - "node_modules/@azure/logger/dist-esm/src/index.js"() { - init_debug(); - registeredLoggers = /* @__PURE__ */ new Set(); - logLevelFromEnv = typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL || void 0; - AzureLogger = debug_default("azure"); - AzureLogger.log = (...args) => { - debug_default.log(...args); - }; - AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; - if (logLevelFromEnv) { - if (isAzureLogLevel(logLevelFromEnv)) { - setLogLevel(logLevelFromEnv); - } else { - console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); + URLToken = class _URLToken { + constructor(text, type3) { + this.text = text; + this.type = type3; } - } - levelMap = { - verbose: 400, - info: 300, - warning: 200, - error: 100 - }; - } -}); - -// node_modules/@azure/core-http/dist-esm/src/log.js -var logger; -var init_log2 = __esm({ - "node_modules/@azure/core-http/dist-esm/src/log.js"() { - init_src(); - logger = createClientLogger("core-http"); - } -}); - -// node_modules/node-fetch/lib/index.mjs -import Stream from "stream"; -import http from "http"; -import Url from "url"; -import whatwgUrl from "node:url"; -import https from "https"; -import zlib from "zlib"; -function FetchError(message, type3, systemError) { - Error.call(this, message); - this.message = message; - this.type = type3; - if (systemError) { - this.code = this.errno = systemError.code; - } - Error.captureStackTrace(this, this.constructor); -} -function Body(body2) { - var _this = this; - var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref$size = _ref.size; - let size = _ref$size === void 0 ? 0 : _ref$size; - var _ref$timeout = _ref.timeout; - let timeout = _ref$timeout === void 0 ? 0 : _ref$timeout; - if (body2 == null) { - body2 = null; - } else if (isURLSearchParams(body2)) { - body2 = Buffer.from(body2.toString()); - } else if (isBlob(body2)) - ; - else if (Buffer.isBuffer(body2)) - ; - else if (Object.prototype.toString.call(body2) === "[object ArrayBuffer]") { - body2 = Buffer.from(body2); - } else if (ArrayBuffer.isView(body2)) { - body2 = Buffer.from(body2.buffer, body2.byteOffset, body2.byteLength); - } else if (body2 instanceof Stream) - ; - else { - body2 = Buffer.from(String(body2)); - } - this[INTERNALS] = { - body: body2, - disturbed: false, - error: null - }; - this.size = size; - this.timeout = timeout; - if (body2 instanceof Stream) { - body2.on("error", function(err) { - const error = err.name === "AbortError" ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, "system", err); - _this[INTERNALS].error = error; - }); - } -} -function consumeBody() { - var _this4 = this; - if (this[INTERNALS].disturbed) { - return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); - } - this[INTERNALS].disturbed = true; - if (this[INTERNALS].error) { - return Body.Promise.reject(this[INTERNALS].error); - } - let body2 = this.body; - if (body2 === null) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - if (isBlob(body2)) { - body2 = body2.stream(); - } - if (Buffer.isBuffer(body2)) { - return Body.Promise.resolve(body2); - } - if (!(body2 instanceof Stream)) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - let accum = []; - let accumBytes = 0; - let abort = false; - return new Body.Promise(function(resolve2, reject) { - let resTimeout; - if (_this4.timeout) { - resTimeout = setTimeout(function() { - abort = true; - reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, "body-timeout")); - }, _this4.timeout); - } - body2.on("error", function(err) { - if (err.name === "AbortError") { - abort = true; - reject(err); - } else { - reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, "system", err)); + static scheme(text) { + return new _URLToken(text, "SCHEME"); } - }); - body2.on("data", function(chunk) { - if (abort || chunk === null) { - return; + static host(text) { + return new _URLToken(text, "HOST"); } - if (_this4.size && accumBytes + chunk.length > _this4.size) { - abort = true; - reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, "max-size")); - return; + static port(text) { + return new _URLToken(text, "PORT"); } - accumBytes += chunk.length; - accum.push(chunk); - }); - body2.on("end", function() { - if (abort) { - return; + static path(text) { + return new _URLToken(text, "PATH"); } - clearTimeout(resTimeout); - try { - resolve2(Buffer.concat(accum, accumBytes)); - } catch (err) { - reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err)); + static query(text) { + return new _URLToken(text, "QUERY"); } - }); - }); -} -function convertBody(buffer, headers) { - if (typeof convert !== "function") { - throw new Error("The package `encoding` must be installed to use the textConverted() function"); - } - const ct2 = headers.get("content-type"); - let charset = "utf-8"; - let res, str; - if (ct2) { - res = /charset=([^;]*)/i.exec(ct2); - } - str = buffer.slice(0, 1024).toString(); - if (!res && str) { - res = / 1 && arguments[1] !== void 0 ? arguments[1] : "key+value"; - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === "key" ? function(k2) { - return k2.toLowerCase(); - } : kind === "value" ? function(k2) { - return headers[MAP][k2].join(", "); - } : function(k2) { - return [k2.toLowerCase(), headers[MAP][k2].join(", ")]; - }); -} -function createHeadersIterator(target, kind) { - const iterator = Object.create(HeadersIteratorPrototype); - iterator[INTERNAL] = { - target, - kind, - index: 0 - }; - return iterator; -} -function exportNodeCompatibleHeaders(headers) { - const obj = Object.assign({ __proto__: null }, headers[MAP]); - const hostHeaderKey = find(headers[MAP], "Host"); - if (hostHeaderKey !== void 0) { - obj[hostHeaderKey] = obj[hostHeaderKey][0]; - } - return obj; -} -function createHeadersLenient(obj) { - const headers = new Headers(); - for (const name2 of Object.keys(obj)) { - if (invalidTokenRegex.test(name2)) { - continue; +}); + +// node_modules/combined-stream/lib/combined_stream.js +var require_combined_stream = __commonJS({ + "node_modules/combined-stream/lib/combined_stream.js"(exports, module) { + var util3 = __require("util"); + var Stream2 = __require("stream").Stream; + var DelayedStream = require_delayed_stream(); + module.exports = CombinedStream; + function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; + this._released = false; + this._streams = []; + this._currentStream = null; + this._insideLoop = false; + this._pendingNext = false; } - if (Array.isArray(obj[name2])) { - for (const val of obj[name2]) { - if (invalidHeaderCharRegex.test(val)) { - continue; + util3.inherits(CombinedStream, Stream2); + CombinedStream.create = function(options) { + var combinedStream = new this(); + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } + return combinedStream; + }; + CombinedStream.isStreamLike = function(stream) { + return typeof stream !== "function" && typeof stream !== "string" && typeof stream !== "boolean" && typeof stream !== "number" && !Buffer.isBuffer(stream); + }; + CombinedStream.prototype.append = function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + if (!(stream instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams + }); + stream.on("data", this._checkDataSize.bind(this)); + stream = newStream; } - if (headers[MAP][name2] === void 0) { - headers[MAP][name2] = [val]; - } else { - headers[MAP][name2].push(val); + this._handleErrors(stream); + if (this.pauseStreams) { + stream.pause(); + } + } + this._streams.push(stream); + return this; + }; + CombinedStream.prototype.pipe = function(dest, options) { + Stream2.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; + }; + CombinedStream.prototype._getNext = function() { + this._currentStream = null; + if (this._insideLoop) { + this._pendingNext = true; + return; + } + this._insideLoop = true; + try { + do { + this._pendingNext = false; + this._realGetNext(); + } while (this._pendingNext); + } finally { + this._insideLoop = false; + } + }; + CombinedStream.prototype._realGetNext = function() { + var stream = this._streams.shift(); + if (typeof stream == "undefined") { + this.end(); + return; + } + if (typeof stream !== "function") { + this._pipeNext(stream); + return; + } + var getStream = stream; + getStream(function(stream2) { + var isStreamLike = CombinedStream.isStreamLike(stream2); + if (isStreamLike) { + stream2.on("data", this._checkDataSize.bind(this)); + this._handleErrors(stream2); + } + this._pipeNext(stream2); + }.bind(this)); + }; + CombinedStream.prototype._pipeNext = function(stream) { + this._currentStream = stream; + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on("end", this._getNext.bind(this)); + stream.pipe(this, { end: false }); + return; + } + var value = stream; + this.write(value); + this._getNext(); + }; + CombinedStream.prototype._handleErrors = function(stream) { + var self2 = this; + stream.on("error", function(err) { + self2._emitError(err); + }); + }; + CombinedStream.prototype.write = function(data) { + this.emit("data", data); + }; + CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; + } + if (this.pauseStreams && this._currentStream && typeof this._currentStream.pause == "function") + this._currentStream.pause(); + this.emit("pause"); + }; + CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); + } + if (this.pauseStreams && this._currentStream && typeof this._currentStream.resume == "function") + this._currentStream.resume(); + this.emit("resume"); + }; + CombinedStream.prototype.end = function() { + this._reset(); + this.emit("end"); + }; + CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit("close"); + }; + CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; + }; + CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; + } + var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; + this._emitError(new Error(message)); + }; + CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; + var self2 = this; + this._streams.forEach(function(stream) { + if (!stream.dataSize) { + return; } + self2.dataSize += stream.dataSize; + }); + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } + }; + CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit("error", err); + }; + } +}); + +// node_modules/mime-db/db.json +var require_db = __commonJS({ + "node_modules/mime-db/db.json"(exports, module) { + module.exports = { + "application/1d-interleaved-parityfec": { + source: "iana" + }, + "application/3gpdash-qoe-report+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/3gpp-ims+xml": { + source: "iana", + compressible: true + }, + "application/3gpphal+json": { + source: "iana", + compressible: true + }, + "application/3gpphalforms+json": { + source: "iana", + compressible: true + }, + "application/a2l": { + source: "iana" + }, + "application/ace+cbor": { + source: "iana" + }, + "application/activemessage": { + source: "iana" + }, + "application/activity+json": { + source: "iana", + compressible: true + }, + "application/alto-costmap+json": { + source: "iana", + compressible: true + }, + "application/alto-costmapfilter+json": { + source: "iana", + compressible: true + }, + "application/alto-directory+json": { + source: "iana", + compressible: true + }, + "application/alto-endpointcost+json": { + source: "iana", + compressible: true + }, + "application/alto-endpointcostparams+json": { + source: "iana", + compressible: true + }, + "application/alto-endpointprop+json": { + source: "iana", + compressible: true + }, + "application/alto-endpointpropparams+json": { + source: "iana", + compressible: true + }, + "application/alto-error+json": { + source: "iana", + compressible: true + }, + "application/alto-networkmap+json": { + source: "iana", + compressible: true + }, + "application/alto-networkmapfilter+json": { + source: "iana", + compressible: true + }, + "application/alto-updatestreamcontrol+json": { + source: "iana", + compressible: true + }, + "application/alto-updatestreamparams+json": { + source: "iana", + compressible: true + }, + "application/aml": { + source: "iana" + }, + "application/andrew-inset": { + source: "iana", + extensions: ["ez"] + }, + "application/applefile": { + source: "iana" + }, + "application/applixware": { + source: "apache", + extensions: ["aw"] + }, + "application/at+jwt": { + source: "iana" + }, + "application/atf": { + source: "iana" + }, + "application/atfx": { + source: "iana" + }, + "application/atom+xml": { + source: "iana", + compressible: true, + extensions: ["atom"] + }, + "application/atomcat+xml": { + source: "iana", + compressible: true, + extensions: ["atomcat"] + }, + "application/atomdeleted+xml": { + source: "iana", + compressible: true, + extensions: ["atomdeleted"] + }, + "application/atomicmail": { + source: "iana" + }, + "application/atomsvc+xml": { + source: "iana", + compressible: true, + extensions: ["atomsvc"] + }, + "application/atsc-dwd+xml": { + source: "iana", + compressible: true, + extensions: ["dwd"] + }, + "application/atsc-dynamic-event-message": { + source: "iana" + }, + "application/atsc-held+xml": { + source: "iana", + compressible: true, + extensions: ["held"] + }, + "application/atsc-rdt+json": { + source: "iana", + compressible: true + }, + "application/atsc-rsat+xml": { + source: "iana", + compressible: true, + extensions: ["rsat"] + }, + "application/atxml": { + source: "iana" + }, + "application/auth-policy+xml": { + source: "iana", + compressible: true + }, + "application/bacnet-xdd+zip": { + source: "iana", + compressible: false + }, + "application/batch-smtp": { + source: "iana" + }, + "application/bdoc": { + compressible: false, + extensions: ["bdoc"] + }, + "application/beep+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/calendar+json": { + source: "iana", + compressible: true + }, + "application/calendar+xml": { + source: "iana", + compressible: true, + extensions: ["xcs"] + }, + "application/call-completion": { + source: "iana" + }, + "application/cals-1840": { + source: "iana" + }, + "application/captive+json": { + source: "iana", + compressible: true + }, + "application/cbor": { + source: "iana" + }, + "application/cbor-seq": { + source: "iana" + }, + "application/cccex": { + source: "iana" + }, + "application/ccmp+xml": { + source: "iana", + compressible: true + }, + "application/ccxml+xml": { + source: "iana", + compressible: true, + extensions: ["ccxml"] + }, + "application/cdfx+xml": { + source: "iana", + compressible: true, + extensions: ["cdfx"] + }, + "application/cdmi-capability": { + source: "iana", + extensions: ["cdmia"] + }, + "application/cdmi-container": { + source: "iana", + extensions: ["cdmic"] + }, + "application/cdmi-domain": { + source: "iana", + extensions: ["cdmid"] + }, + "application/cdmi-object": { + source: "iana", + extensions: ["cdmio"] + }, + "application/cdmi-queue": { + source: "iana", + extensions: ["cdmiq"] + }, + "application/cdni": { + source: "iana" + }, + "application/cea": { + source: "iana" + }, + "application/cea-2018+xml": { + source: "iana", + compressible: true + }, + "application/cellml+xml": { + source: "iana", + compressible: true + }, + "application/cfw": { + source: "iana" + }, + "application/city+json": { + source: "iana", + compressible: true + }, + "application/clr": { + source: "iana" + }, + "application/clue+xml": { + source: "iana", + compressible: true + }, + "application/clue_info+xml": { + source: "iana", + compressible: true + }, + "application/cms": { + source: "iana" + }, + "application/cnrp+xml": { + source: "iana", + compressible: true + }, + "application/coap-group+json": { + source: "iana", + compressible: true + }, + "application/coap-payload": { + source: "iana" + }, + "application/commonground": { + source: "iana" + }, + "application/conference-info+xml": { + source: "iana", + compressible: true + }, + "application/cose": { + source: "iana" + }, + "application/cose-key": { + source: "iana" + }, + "application/cose-key-set": { + source: "iana" + }, + "application/cpl+xml": { + source: "iana", + compressible: true, + extensions: ["cpl"] + }, + "application/csrattrs": { + source: "iana" + }, + "application/csta+xml": { + source: "iana", + compressible: true + }, + "application/cstadata+xml": { + source: "iana", + compressible: true + }, + "application/csvm+json": { + source: "iana", + compressible: true + }, + "application/cu-seeme": { + source: "apache", + extensions: ["cu"] + }, + "application/cwt": { + source: "iana" + }, + "application/cybercash": { + source: "iana" + }, + "application/dart": { + compressible: true + }, + "application/dash+xml": { + source: "iana", + compressible: true, + extensions: ["mpd"] + }, + "application/dash-patch+xml": { + source: "iana", + compressible: true, + extensions: ["mpp"] + }, + "application/dashdelta": { + source: "iana" + }, + "application/davmount+xml": { + source: "iana", + compressible: true, + extensions: ["davmount"] + }, + "application/dca-rft": { + source: "iana" + }, + "application/dcd": { + source: "iana" + }, + "application/dec-dx": { + source: "iana" + }, + "application/dialog-info+xml": { + source: "iana", + compressible: true + }, + "application/dicom": { + source: "iana" + }, + "application/dicom+json": { + source: "iana", + compressible: true + }, + "application/dicom+xml": { + source: "iana", + compressible: true + }, + "application/dii": { + source: "iana" + }, + "application/dit": { + source: "iana" + }, + "application/dns": { + source: "iana" + }, + "application/dns+json": { + source: "iana", + compressible: true + }, + "application/dns-message": { + source: "iana" + }, + "application/docbook+xml": { + source: "apache", + compressible: true, + extensions: ["dbk"] + }, + "application/dots+cbor": { + source: "iana" + }, + "application/dskpp+xml": { + source: "iana", + compressible: true + }, + "application/dssc+der": { + source: "iana", + extensions: ["dssc"] + }, + "application/dssc+xml": { + source: "iana", + compressible: true, + extensions: ["xdssc"] + }, + "application/dvcs": { + source: "iana" + }, + "application/ecmascript": { + source: "iana", + compressible: true, + extensions: ["es", "ecma"] + }, + "application/edi-consent": { + source: "iana" + }, + "application/edi-x12": { + source: "iana", + compressible: false + }, + "application/edifact": { + source: "iana", + compressible: false + }, + "application/efi": { + source: "iana" + }, + "application/elm+json": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/elm+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.cap+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/emergencycalldata.comment+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.control+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.deviceinfo+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.ecall.msd": { + source: "iana" + }, + "application/emergencycalldata.providerinfo+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.serviceinfo+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.subscriberinfo+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.veds+xml": { + source: "iana", + compressible: true + }, + "application/emma+xml": { + source: "iana", + compressible: true, + extensions: ["emma"] + }, + "application/emotionml+xml": { + source: "iana", + compressible: true, + extensions: ["emotionml"] + }, + "application/encaprtp": { + source: "iana" + }, + "application/epp+xml": { + source: "iana", + compressible: true + }, + "application/epub+zip": { + source: "iana", + compressible: false, + extensions: ["epub"] + }, + "application/eshop": { + source: "iana" + }, + "application/exi": { + source: "iana", + extensions: ["exi"] + }, + "application/expect-ct-report+json": { + source: "iana", + compressible: true + }, + "application/express": { + source: "iana", + extensions: ["exp"] + }, + "application/fastinfoset": { + source: "iana" + }, + "application/fastsoap": { + source: "iana" + }, + "application/fdt+xml": { + source: "iana", + compressible: true, + extensions: ["fdt"] + }, + "application/fhir+json": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/fhir+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/fido.trusted-apps+json": { + compressible: true + }, + "application/fits": { + source: "iana" + }, + "application/flexfec": { + source: "iana" + }, + "application/font-sfnt": { + source: "iana" + }, + "application/font-tdpfr": { + source: "iana", + extensions: ["pfr"] + }, + "application/font-woff": { + source: "iana", + compressible: false + }, + "application/framework-attributes+xml": { + source: "iana", + compressible: true + }, + "application/geo+json": { + source: "iana", + compressible: true, + extensions: ["geojson"] + }, + "application/geo+json-seq": { + source: "iana" + }, + "application/geopackage+sqlite3": { + source: "iana" + }, + "application/geoxacml+xml": { + source: "iana", + compressible: true + }, + "application/gltf-buffer": { + source: "iana" + }, + "application/gml+xml": { + source: "iana", + compressible: true, + extensions: ["gml"] + }, + "application/gpx+xml": { + source: "apache", + compressible: true, + extensions: ["gpx"] + }, + "application/gxf": { + source: "apache", + extensions: ["gxf"] + }, + "application/gzip": { + source: "iana", + compressible: false, + extensions: ["gz"] + }, + "application/h224": { + source: "iana" + }, + "application/held+xml": { + source: "iana", + compressible: true + }, + "application/hjson": { + extensions: ["hjson"] + }, + "application/http": { + source: "iana" + }, + "application/hyperstudio": { + source: "iana", + extensions: ["stk"] + }, + "application/ibe-key-request+xml": { + source: "iana", + compressible: true + }, + "application/ibe-pkg-reply+xml": { + source: "iana", + compressible: true + }, + "application/ibe-pp-data": { + source: "iana" + }, + "application/iges": { + source: "iana" + }, + "application/im-iscomposing+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/index": { + source: "iana" + }, + "application/index.cmd": { + source: "iana" + }, + "application/index.obj": { + source: "iana" + }, + "application/index.response": { + source: "iana" + }, + "application/index.vnd": { + source: "iana" + }, + "application/inkml+xml": { + source: "iana", + compressible: true, + extensions: ["ink", "inkml"] + }, + "application/iotp": { + source: "iana" + }, + "application/ipfix": { + source: "iana", + extensions: ["ipfix"] + }, + "application/ipp": { + source: "iana" + }, + "application/isup": { + source: "iana" + }, + "application/its+xml": { + source: "iana", + compressible: true, + extensions: ["its"] + }, + "application/java-archive": { + source: "apache", + compressible: false, + extensions: ["jar", "war", "ear"] + }, + "application/java-serialized-object": { + source: "apache", + compressible: false, + extensions: ["ser"] + }, + "application/java-vm": { + source: "apache", + compressible: false, + extensions: ["class"] + }, + "application/javascript": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["js", "mjs"] + }, + "application/jf2feed+json": { + source: "iana", + compressible: true + }, + "application/jose": { + source: "iana" + }, + "application/jose+json": { + source: "iana", + compressible: true + }, + "application/jrd+json": { + source: "iana", + compressible: true + }, + "application/jscalendar+json": { + source: "iana", + compressible: true + }, + "application/json": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["json", "map"] + }, + "application/json-patch+json": { + source: "iana", + compressible: true + }, + "application/json-seq": { + source: "iana" + }, + "application/json5": { + extensions: ["json5"] + }, + "application/jsonml+json": { + source: "apache", + compressible: true, + extensions: ["jsonml"] + }, + "application/jwk+json": { + source: "iana", + compressible: true + }, + "application/jwk-set+json": { + source: "iana", + compressible: true + }, + "application/jwt": { + source: "iana" + }, + "application/kpml-request+xml": { + source: "iana", + compressible: true + }, + "application/kpml-response+xml": { + source: "iana", + compressible: true + }, + "application/ld+json": { + source: "iana", + compressible: true, + extensions: ["jsonld"] + }, + "application/lgr+xml": { + source: "iana", + compressible: true, + extensions: ["lgr"] + }, + "application/link-format": { + source: "iana" + }, + "application/load-control+xml": { + source: "iana", + compressible: true + }, + "application/lost+xml": { + source: "iana", + compressible: true, + extensions: ["lostxml"] + }, + "application/lostsync+xml": { + source: "iana", + compressible: true + }, + "application/lpf+zip": { + source: "iana", + compressible: false + }, + "application/lxf": { + source: "iana" + }, + "application/mac-binhex40": { + source: "iana", + extensions: ["hqx"] + }, + "application/mac-compactpro": { + source: "apache", + extensions: ["cpt"] + }, + "application/macwriteii": { + source: "iana" + }, + "application/mads+xml": { + source: "iana", + compressible: true, + extensions: ["mads"] + }, + "application/manifest+json": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["webmanifest"] + }, + "application/marc": { + source: "iana", + extensions: ["mrc"] + }, + "application/marcxml+xml": { + source: "iana", + compressible: true, + extensions: ["mrcx"] + }, + "application/mathematica": { + source: "iana", + extensions: ["ma", "nb", "mb"] + }, + "application/mathml+xml": { + source: "iana", + compressible: true, + extensions: ["mathml"] + }, + "application/mathml-content+xml": { + source: "iana", + compressible: true + }, + "application/mathml-presentation+xml": { + source: "iana", + compressible: true + }, + "application/mbms-associated-procedure-description+xml": { + source: "iana", + compressible: true + }, + "application/mbms-deregister+xml": { + source: "iana", + compressible: true + }, + "application/mbms-envelope+xml": { + source: "iana", + compressible: true + }, + "application/mbms-msk+xml": { + source: "iana", + compressible: true + }, + "application/mbms-msk-response+xml": { + source: "iana", + compressible: true + }, + "application/mbms-protection-description+xml": { + source: "iana", + compressible: true + }, + "application/mbms-reception-report+xml": { + source: "iana", + compressible: true + }, + "application/mbms-register+xml": { + source: "iana", + compressible: true + }, + "application/mbms-register-response+xml": { + source: "iana", + compressible: true + }, + "application/mbms-schedule+xml": { + source: "iana", + compressible: true + }, + "application/mbms-user-service-description+xml": { + source: "iana", + compressible: true + }, + "application/mbox": { + source: "iana", + extensions: ["mbox"] + }, + "application/media-policy-dataset+xml": { + source: "iana", + compressible: true, + extensions: ["mpf"] + }, + "application/media_control+xml": { + source: "iana", + compressible: true + }, + "application/mediaservercontrol+xml": { + source: "iana", + compressible: true, + extensions: ["mscml"] + }, + "application/merge-patch+json": { + source: "iana", + compressible: true + }, + "application/metalink+xml": { + source: "apache", + compressible: true, + extensions: ["metalink"] + }, + "application/metalink4+xml": { + source: "iana", + compressible: true, + extensions: ["meta4"] + }, + "application/mets+xml": { + source: "iana", + compressible: true, + extensions: ["mets"] + }, + "application/mf4": { + source: "iana" + }, + "application/mikey": { + source: "iana" + }, + "application/mipc": { + source: "iana" + }, + "application/missing-blocks+cbor-seq": { + source: "iana" + }, + "application/mmt-aei+xml": { + source: "iana", + compressible: true, + extensions: ["maei"] + }, + "application/mmt-usd+xml": { + source: "iana", + compressible: true, + extensions: ["musd"] + }, + "application/mods+xml": { + source: "iana", + compressible: true, + extensions: ["mods"] + }, + "application/moss-keys": { + source: "iana" + }, + "application/moss-signature": { + source: "iana" + }, + "application/mosskey-data": { + source: "iana" + }, + "application/mosskey-request": { + source: "iana" + }, + "application/mp21": { + source: "iana", + extensions: ["m21", "mp21"] + }, + "application/mp4": { + source: "iana", + extensions: ["mp4s", "m4p"] + }, + "application/mpeg4-generic": { + source: "iana" + }, + "application/mpeg4-iod": { + source: "iana" + }, + "application/mpeg4-iod-xmt": { + source: "iana" + }, + "application/mrb-consumer+xml": { + source: "iana", + compressible: true + }, + "application/mrb-publish+xml": { + source: "iana", + compressible: true + }, + "application/msc-ivr+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/msc-mixer+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/msword": { + source: "iana", + compressible: false, + extensions: ["doc", "dot"] + }, + "application/mud+json": { + source: "iana", + compressible: true + }, + "application/multipart-core": { + source: "iana" + }, + "application/mxf": { + source: "iana", + extensions: ["mxf"] + }, + "application/n-quads": { + source: "iana", + extensions: ["nq"] + }, + "application/n-triples": { + source: "iana", + extensions: ["nt"] + }, + "application/nasdata": { + source: "iana" + }, + "application/news-checkgroups": { + source: "iana", + charset: "US-ASCII" + }, + "application/news-groupinfo": { + source: "iana", + charset: "US-ASCII" + }, + "application/news-transmission": { + source: "iana" + }, + "application/nlsml+xml": { + source: "iana", + compressible: true + }, + "application/node": { + source: "iana", + extensions: ["cjs"] + }, + "application/nss": { + source: "iana" + }, + "application/oauth-authz-req+jwt": { + source: "iana" + }, + "application/oblivious-dns-message": { + source: "iana" + }, + "application/ocsp-request": { + source: "iana" + }, + "application/ocsp-response": { + source: "iana" + }, + "application/octet-stream": { + source: "iana", + compressible: false, + extensions: ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"] + }, + "application/oda": { + source: "iana", + extensions: ["oda"] + }, + "application/odm+xml": { + source: "iana", + compressible: true + }, + "application/odx": { + source: "iana" + }, + "application/oebps-package+xml": { + source: "iana", + compressible: true, + extensions: ["opf"] + }, + "application/ogg": { + source: "iana", + compressible: false, + extensions: ["ogx"] + }, + "application/omdoc+xml": { + source: "apache", + compressible: true, + extensions: ["omdoc"] + }, + "application/onenote": { + source: "apache", + extensions: ["onetoc", "onetoc2", "onetmp", "onepkg"] + }, + "application/opc-nodeset+xml": { + source: "iana", + compressible: true + }, + "application/oscore": { + source: "iana" + }, + "application/oxps": { + source: "iana", + extensions: ["oxps"] + }, + "application/p21": { + source: "iana" + }, + "application/p21+zip": { + source: "iana", + compressible: false + }, + "application/p2p-overlay+xml": { + source: "iana", + compressible: true, + extensions: ["relo"] + }, + "application/parityfec": { + source: "iana" + }, + "application/passport": { + source: "iana" + }, + "application/patch-ops-error+xml": { + source: "iana", + compressible: true, + extensions: ["xer"] + }, + "application/pdf": { + source: "iana", + compressible: false, + extensions: ["pdf"] + }, + "application/pdx": { + source: "iana" + }, + "application/pem-certificate-chain": { + source: "iana" + }, + "application/pgp-encrypted": { + source: "iana", + compressible: false, + extensions: ["pgp"] + }, + "application/pgp-keys": { + source: "iana", + extensions: ["asc"] + }, + "application/pgp-signature": { + source: "iana", + extensions: ["asc", "sig"] + }, + "application/pics-rules": { + source: "apache", + extensions: ["prf"] + }, + "application/pidf+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/pidf-diff+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/pkcs10": { + source: "iana", + extensions: ["p10"] + }, + "application/pkcs12": { + source: "iana" + }, + "application/pkcs7-mime": { + source: "iana", + extensions: ["p7m", "p7c"] + }, + "application/pkcs7-signature": { + source: "iana", + extensions: ["p7s"] + }, + "application/pkcs8": { + source: "iana", + extensions: ["p8"] + }, + "application/pkcs8-encrypted": { + source: "iana" + }, + "application/pkix-attr-cert": { + source: "iana", + extensions: ["ac"] + }, + "application/pkix-cert": { + source: "iana", + extensions: ["cer"] + }, + "application/pkix-crl": { + source: "iana", + extensions: ["crl"] + }, + "application/pkix-pkipath": { + source: "iana", + extensions: ["pkipath"] + }, + "application/pkixcmp": { + source: "iana", + extensions: ["pki"] + }, + "application/pls+xml": { + source: "iana", + compressible: true, + extensions: ["pls"] + }, + "application/poc-settings+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/postscript": { + source: "iana", + compressible: true, + extensions: ["ai", "eps", "ps"] + }, + "application/ppsp-tracker+json": { + source: "iana", + compressible: true + }, + "application/problem+json": { + source: "iana", + compressible: true + }, + "application/problem+xml": { + source: "iana", + compressible: true + }, + "application/provenance+xml": { + source: "iana", + compressible: true, + extensions: ["provx"] + }, + "application/prs.alvestrand.titrax-sheet": { + source: "iana" + }, + "application/prs.cww": { + source: "iana", + extensions: ["cww"] + }, + "application/prs.cyn": { + source: "iana", + charset: "7-BIT" + }, + "application/prs.hpub+zip": { + source: "iana", + compressible: false + }, + "application/prs.nprend": { + source: "iana" + }, + "application/prs.plucker": { + source: "iana" + }, + "application/prs.rdf-xml-crypt": { + source: "iana" + }, + "application/prs.xsf+xml": { + source: "iana", + compressible: true + }, + "application/pskc+xml": { + source: "iana", + compressible: true, + extensions: ["pskcxml"] + }, + "application/pvd+json": { + source: "iana", + compressible: true + }, + "application/qsig": { + source: "iana" + }, + "application/raml+yaml": { + compressible: true, + extensions: ["raml"] + }, + "application/raptorfec": { + source: "iana" + }, + "application/rdap+json": { + source: "iana", + compressible: true + }, + "application/rdf+xml": { + source: "iana", + compressible: true, + extensions: ["rdf", "owl"] + }, + "application/reginfo+xml": { + source: "iana", + compressible: true, + extensions: ["rif"] + }, + "application/relax-ng-compact-syntax": { + source: "iana", + extensions: ["rnc"] + }, + "application/remote-printing": { + source: "iana" + }, + "application/reputon+json": { + source: "iana", + compressible: true + }, + "application/resource-lists+xml": { + source: "iana", + compressible: true, + extensions: ["rl"] + }, + "application/resource-lists-diff+xml": { + source: "iana", + compressible: true, + extensions: ["rld"] + }, + "application/rfc+xml": { + source: "iana", + compressible: true + }, + "application/riscos": { + source: "iana" + }, + "application/rlmi+xml": { + source: "iana", + compressible: true + }, + "application/rls-services+xml": { + source: "iana", + compressible: true, + extensions: ["rs"] + }, + "application/route-apd+xml": { + source: "iana", + compressible: true, + extensions: ["rapd"] + }, + "application/route-s-tsid+xml": { + source: "iana", + compressible: true, + extensions: ["sls"] + }, + "application/route-usd+xml": { + source: "iana", + compressible: true, + extensions: ["rusd"] + }, + "application/rpki-ghostbusters": { + source: "iana", + extensions: ["gbr"] + }, + "application/rpki-manifest": { + source: "iana", + extensions: ["mft"] + }, + "application/rpki-publication": { + source: "iana" + }, + "application/rpki-roa": { + source: "iana", + extensions: ["roa"] + }, + "application/rpki-updown": { + source: "iana" + }, + "application/rsd+xml": { + source: "apache", + compressible: true, + extensions: ["rsd"] + }, + "application/rss+xml": { + source: "apache", + compressible: true, + extensions: ["rss"] + }, + "application/rtf": { + source: "iana", + compressible: true, + extensions: ["rtf"] + }, + "application/rtploopback": { + source: "iana" + }, + "application/rtx": { + source: "iana" + }, + "application/samlassertion+xml": { + source: "iana", + compressible: true + }, + "application/samlmetadata+xml": { + source: "iana", + compressible: true + }, + "application/sarif+json": { + source: "iana", + compressible: true + }, + "application/sarif-external-properties+json": { + source: "iana", + compressible: true + }, + "application/sbe": { + source: "iana" + }, + "application/sbml+xml": { + source: "iana", + compressible: true, + extensions: ["sbml"] + }, + "application/scaip+xml": { + source: "iana", + compressible: true + }, + "application/scim+json": { + source: "iana", + compressible: true + }, + "application/scvp-cv-request": { + source: "iana", + extensions: ["scq"] + }, + "application/scvp-cv-response": { + source: "iana", + extensions: ["scs"] + }, + "application/scvp-vp-request": { + source: "iana", + extensions: ["spq"] + }, + "application/scvp-vp-response": { + source: "iana", + extensions: ["spp"] + }, + "application/sdp": { + source: "iana", + extensions: ["sdp"] + }, + "application/secevent+jwt": { + source: "iana" + }, + "application/senml+cbor": { + source: "iana" + }, + "application/senml+json": { + source: "iana", + compressible: true + }, + "application/senml+xml": { + source: "iana", + compressible: true, + extensions: ["senmlx"] + }, + "application/senml-etch+cbor": { + source: "iana" + }, + "application/senml-etch+json": { + source: "iana", + compressible: true + }, + "application/senml-exi": { + source: "iana" + }, + "application/sensml+cbor": { + source: "iana" + }, + "application/sensml+json": { + source: "iana", + compressible: true + }, + "application/sensml+xml": { + source: "iana", + compressible: true, + extensions: ["sensmlx"] + }, + "application/sensml-exi": { + source: "iana" + }, + "application/sep+xml": { + source: "iana", + compressible: true + }, + "application/sep-exi": { + source: "iana" + }, + "application/session-info": { + source: "iana" + }, + "application/set-payment": { + source: "iana" + }, + "application/set-payment-initiation": { + source: "iana", + extensions: ["setpay"] + }, + "application/set-registration": { + source: "iana" + }, + "application/set-registration-initiation": { + source: "iana", + extensions: ["setreg"] + }, + "application/sgml": { + source: "iana" + }, + "application/sgml-open-catalog": { + source: "iana" + }, + "application/shf+xml": { + source: "iana", + compressible: true, + extensions: ["shf"] + }, + "application/sieve": { + source: "iana", + extensions: ["siv", "sieve"] + }, + "application/simple-filter+xml": { + source: "iana", + compressible: true + }, + "application/simple-message-summary": { + source: "iana" + }, + "application/simplesymbolcontainer": { + source: "iana" + }, + "application/sipc": { + source: "iana" + }, + "application/slate": { + source: "iana" + }, + "application/smil": { + source: "iana" + }, + "application/smil+xml": { + source: "iana", + compressible: true, + extensions: ["smi", "smil"] + }, + "application/smpte336m": { + source: "iana" + }, + "application/soap+fastinfoset": { + source: "iana" + }, + "application/soap+xml": { + source: "iana", + compressible: true + }, + "application/sparql-query": { + source: "iana", + extensions: ["rq"] + }, + "application/sparql-results+xml": { + source: "iana", + compressible: true, + extensions: ["srx"] + }, + "application/spdx+json": { + source: "iana", + compressible: true + }, + "application/spirits-event+xml": { + source: "iana", + compressible: true + }, + "application/sql": { + source: "iana" + }, + "application/srgs": { + source: "iana", + extensions: ["gram"] + }, + "application/srgs+xml": { + source: "iana", + compressible: true, + extensions: ["grxml"] + }, + "application/sru+xml": { + source: "iana", + compressible: true, + extensions: ["sru"] + }, + "application/ssdl+xml": { + source: "apache", + compressible: true, + extensions: ["ssdl"] + }, + "application/ssml+xml": { + source: "iana", + compressible: true, + extensions: ["ssml"] + }, + "application/stix+json": { + source: "iana", + compressible: true + }, + "application/swid+xml": { + source: "iana", + compressible: true, + extensions: ["swidtag"] + }, + "application/tamp-apex-update": { + source: "iana" + }, + "application/tamp-apex-update-confirm": { + source: "iana" + }, + "application/tamp-community-update": { + source: "iana" + }, + "application/tamp-community-update-confirm": { + source: "iana" + }, + "application/tamp-error": { + source: "iana" + }, + "application/tamp-sequence-adjust": { + source: "iana" + }, + "application/tamp-sequence-adjust-confirm": { + source: "iana" + }, + "application/tamp-status-query": { + source: "iana" + }, + "application/tamp-status-response": { + source: "iana" + }, + "application/tamp-update": { + source: "iana" + }, + "application/tamp-update-confirm": { + source: "iana" + }, + "application/tar": { + compressible: true + }, + "application/taxii+json": { + source: "iana", + compressible: true + }, + "application/td+json": { + source: "iana", + compressible: true + }, + "application/tei+xml": { + source: "iana", + compressible: true, + extensions: ["tei", "teicorpus"] + }, + "application/tetra_isi": { + source: "iana" + }, + "application/thraud+xml": { + source: "iana", + compressible: true, + extensions: ["tfi"] + }, + "application/timestamp-query": { + source: "iana" + }, + "application/timestamp-reply": { + source: "iana" + }, + "application/timestamped-data": { + source: "iana", + extensions: ["tsd"] + }, + "application/tlsrpt+gzip": { + source: "iana" + }, + "application/tlsrpt+json": { + source: "iana", + compressible: true + }, + "application/tnauthlist": { + source: "iana" + }, + "application/token-introspection+jwt": { + source: "iana" + }, + "application/toml": { + compressible: true, + extensions: ["toml"] + }, + "application/trickle-ice-sdpfrag": { + source: "iana" + }, + "application/trig": { + source: "iana", + extensions: ["trig"] + }, + "application/ttml+xml": { + source: "iana", + compressible: true, + extensions: ["ttml"] + }, + "application/tve-trigger": { + source: "iana" + }, + "application/tzif": { + source: "iana" + }, + "application/tzif-leap": { + source: "iana" + }, + "application/ubjson": { + compressible: false, + extensions: ["ubj"] + }, + "application/ulpfec": { + source: "iana" + }, + "application/urc-grpsheet+xml": { + source: "iana", + compressible: true + }, + "application/urc-ressheet+xml": { + source: "iana", + compressible: true, + extensions: ["rsheet"] + }, + "application/urc-targetdesc+xml": { + source: "iana", + compressible: true, + extensions: ["td"] + }, + "application/urc-uisocketdesc+xml": { + source: "iana", + compressible: true + }, + "application/vcard+json": { + source: "iana", + compressible: true + }, + "application/vcard+xml": { + source: "iana", + compressible: true + }, + "application/vemmi": { + source: "iana" + }, + "application/vividence.scriptfile": { + source: "apache" + }, + "application/vnd.1000minds.decision-model+xml": { + source: "iana", + compressible: true, + extensions: ["1km"] + }, + "application/vnd.3gpp-prose+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp-prose-pc3ch+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp-v2x-local-service-information": { + source: "iana" + }, + "application/vnd.3gpp.5gnas": { + source: "iana" + }, + "application/vnd.3gpp.access-transfer-events+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.bsf+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.gmop+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.gtpc": { + source: "iana" + }, + "application/vnd.3gpp.interworking-data": { + source: "iana" + }, + "application/vnd.3gpp.lpp": { + source: "iana" + }, + "application/vnd.3gpp.mc-signalling-ear": { + source: "iana" + }, + "application/vnd.3gpp.mcdata-affiliation-command+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcdata-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcdata-payload": { + source: "iana" + }, + "application/vnd.3gpp.mcdata-service-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcdata-signalling": { + source: "iana" + }, + "application/vnd.3gpp.mcdata-ue-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcdata-user-profile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-affiliation-command+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-floor-request+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-location-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-service-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-signed+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-ue-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-ue-init-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-user-profile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-affiliation-command+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-affiliation-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-location-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-service-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-transmission-request+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-ue-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-user-profile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mid-call+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.ngap": { + source: "iana" + }, + "application/vnd.3gpp.pfcp": { + source: "iana" + }, + "application/vnd.3gpp.pic-bw-large": { + source: "iana", + extensions: ["plb"] + }, + "application/vnd.3gpp.pic-bw-small": { + source: "iana", + extensions: ["psb"] + }, + "application/vnd.3gpp.pic-bw-var": { + source: "iana", + extensions: ["pvb"] + }, + "application/vnd.3gpp.s1ap": { + source: "iana" + }, + "application/vnd.3gpp.sms": { + source: "iana" + }, + "application/vnd.3gpp.sms+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.srvcc-ext+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.srvcc-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.state-and-event-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.ussd+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp2.bcmcsinfo+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp2.sms": { + source: "iana" + }, + "application/vnd.3gpp2.tcap": { + source: "iana", + extensions: ["tcap"] + }, + "application/vnd.3lightssoftware.imagescal": { + source: "iana" + }, + "application/vnd.3m.post-it-notes": { + source: "iana", + extensions: ["pwn"] + }, + "application/vnd.accpac.simply.aso": { + source: "iana", + extensions: ["aso"] + }, + "application/vnd.accpac.simply.imp": { + source: "iana", + extensions: ["imp"] + }, + "application/vnd.acucobol": { + source: "iana", + extensions: ["acu"] + }, + "application/vnd.acucorp": { + source: "iana", + extensions: ["atc", "acutc"] + }, + "application/vnd.adobe.air-application-installer-package+zip": { + source: "apache", + compressible: false, + extensions: ["air"] + }, + "application/vnd.adobe.flash.movie": { + source: "iana" + }, + "application/vnd.adobe.formscentral.fcdt": { + source: "iana", + extensions: ["fcdt"] + }, + "application/vnd.adobe.fxp": { + source: "iana", + extensions: ["fxp", "fxpl"] + }, + "application/vnd.adobe.partial-upload": { + source: "iana" + }, + "application/vnd.adobe.xdp+xml": { + source: "iana", + compressible: true, + extensions: ["xdp"] + }, + "application/vnd.adobe.xfdf": { + source: "iana", + extensions: ["xfdf"] + }, + "application/vnd.aether.imp": { + source: "iana" + }, + "application/vnd.afpc.afplinedata": { + source: "iana" + }, + "application/vnd.afpc.afplinedata-pagedef": { + source: "iana" + }, + "application/vnd.afpc.cmoca-cmresource": { + source: "iana" + }, + "application/vnd.afpc.foca-charset": { + source: "iana" + }, + "application/vnd.afpc.foca-codedfont": { + source: "iana" + }, + "application/vnd.afpc.foca-codepage": { + source: "iana" + }, + "application/vnd.afpc.modca": { + source: "iana" + }, + "application/vnd.afpc.modca-cmtable": { + source: "iana" + }, + "application/vnd.afpc.modca-formdef": { + source: "iana" + }, + "application/vnd.afpc.modca-mediummap": { + source: "iana" + }, + "application/vnd.afpc.modca-objectcontainer": { + source: "iana" + }, + "application/vnd.afpc.modca-overlay": { + source: "iana" + }, + "application/vnd.afpc.modca-pagesegment": { + source: "iana" + }, + "application/vnd.age": { + source: "iana", + extensions: ["age"] + }, + "application/vnd.ah-barcode": { + source: "iana" + }, + "application/vnd.ahead.space": { + source: "iana", + extensions: ["ahead"] + }, + "application/vnd.airzip.filesecure.azf": { + source: "iana", + extensions: ["azf"] + }, + "application/vnd.airzip.filesecure.azs": { + source: "iana", + extensions: ["azs"] + }, + "application/vnd.amadeus+json": { + source: "iana", + compressible: true + }, + "application/vnd.amazon.ebook": { + source: "apache", + extensions: ["azw"] + }, + "application/vnd.amazon.mobi8-ebook": { + source: "iana" + }, + "application/vnd.americandynamics.acc": { + source: "iana", + extensions: ["acc"] + }, + "application/vnd.amiga.ami": { + source: "iana", + extensions: ["ami"] + }, + "application/vnd.amundsen.maze+xml": { + source: "iana", + compressible: true + }, + "application/vnd.android.ota": { + source: "iana" + }, + "application/vnd.android.package-archive": { + source: "apache", + compressible: false, + extensions: ["apk"] + }, + "application/vnd.anki": { + source: "iana" + }, + "application/vnd.anser-web-certificate-issue-initiation": { + source: "iana", + extensions: ["cii"] + }, + "application/vnd.anser-web-funds-transfer-initiation": { + source: "apache", + extensions: ["fti"] + }, + "application/vnd.antix.game-component": { + source: "iana", + extensions: ["atx"] + }, + "application/vnd.apache.arrow.file": { + source: "iana" + }, + "application/vnd.apache.arrow.stream": { + source: "iana" + }, + "application/vnd.apache.thrift.binary": { + source: "iana" + }, + "application/vnd.apache.thrift.compact": { + source: "iana" + }, + "application/vnd.apache.thrift.json": { + source: "iana" + }, + "application/vnd.api+json": { + source: "iana", + compressible: true + }, + "application/vnd.aplextor.warrp+json": { + source: "iana", + compressible: true + }, + "application/vnd.apothekende.reservation+json": { + source: "iana", + compressible: true + }, + "application/vnd.apple.installer+xml": { + source: "iana", + compressible: true, + extensions: ["mpkg"] + }, + "application/vnd.apple.keynote": { + source: "iana", + extensions: ["key"] + }, + "application/vnd.apple.mpegurl": { + source: "iana", + extensions: ["m3u8"] + }, + "application/vnd.apple.numbers": { + source: "iana", + extensions: ["numbers"] + }, + "application/vnd.apple.pages": { + source: "iana", + extensions: ["pages"] + }, + "application/vnd.apple.pkpass": { + compressible: false, + extensions: ["pkpass"] + }, + "application/vnd.arastra.swi": { + source: "iana" + }, + "application/vnd.aristanetworks.swi": { + source: "iana", + extensions: ["swi"] + }, + "application/vnd.artisan+json": { + source: "iana", + compressible: true + }, + "application/vnd.artsquare": { + source: "iana" + }, + "application/vnd.astraea-software.iota": { + source: "iana", + extensions: ["iota"] + }, + "application/vnd.audiograph": { + source: "iana", + extensions: ["aep"] + }, + "application/vnd.autopackage": { + source: "iana" + }, + "application/vnd.avalon+json": { + source: "iana", + compressible: true + }, + "application/vnd.avistar+xml": { + source: "iana", + compressible: true + }, + "application/vnd.balsamiq.bmml+xml": { + source: "iana", + compressible: true, + extensions: ["bmml"] + }, + "application/vnd.balsamiq.bmpr": { + source: "iana" + }, + "application/vnd.banana-accounting": { + source: "iana" + }, + "application/vnd.bbf.usp.error": { + source: "iana" + }, + "application/vnd.bbf.usp.msg": { + source: "iana" + }, + "application/vnd.bbf.usp.msg+json": { + source: "iana", + compressible: true + }, + "application/vnd.bekitzur-stech+json": { + source: "iana", + compressible: true + }, + "application/vnd.bint.med-content": { + source: "iana" + }, + "application/vnd.biopax.rdf+xml": { + source: "iana", + compressible: true + }, + "application/vnd.blink-idb-value-wrapper": { + source: "iana" + }, + "application/vnd.blueice.multipass": { + source: "iana", + extensions: ["mpm"] + }, + "application/vnd.bluetooth.ep.oob": { + source: "iana" + }, + "application/vnd.bluetooth.le.oob": { + source: "iana" + }, + "application/vnd.bmi": { + source: "iana", + extensions: ["bmi"] + }, + "application/vnd.bpf": { + source: "iana" + }, + "application/vnd.bpf3": { + source: "iana" + }, + "application/vnd.businessobjects": { + source: "iana", + extensions: ["rep"] + }, + "application/vnd.byu.uapi+json": { + source: "iana", + compressible: true + }, + "application/vnd.cab-jscript": { + source: "iana" + }, + "application/vnd.canon-cpdl": { + source: "iana" + }, + "application/vnd.canon-lips": { + source: "iana" + }, + "application/vnd.capasystems-pg+json": { + source: "iana", + compressible: true + }, + "application/vnd.cendio.thinlinc.clientconf": { + source: "iana" + }, + "application/vnd.century-systems.tcp_stream": { + source: "iana" + }, + "application/vnd.chemdraw+xml": { + source: "iana", + compressible: true, + extensions: ["cdxml"] + }, + "application/vnd.chess-pgn": { + source: "iana" + }, + "application/vnd.chipnuts.karaoke-mmd": { + source: "iana", + extensions: ["mmd"] + }, + "application/vnd.ciedi": { + source: "iana" + }, + "application/vnd.cinderella": { + source: "iana", + extensions: ["cdy"] + }, + "application/vnd.cirpack.isdn-ext": { + source: "iana" + }, + "application/vnd.citationstyles.style+xml": { + source: "iana", + compressible: true, + extensions: ["csl"] + }, + "application/vnd.claymore": { + source: "iana", + extensions: ["cla"] + }, + "application/vnd.cloanto.rp9": { + source: "iana", + extensions: ["rp9"] + }, + "application/vnd.clonk.c4group": { + source: "iana", + extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"] + }, + "application/vnd.cluetrust.cartomobile-config": { + source: "iana", + extensions: ["c11amc"] + }, + "application/vnd.cluetrust.cartomobile-config-pkg": { + source: "iana", + extensions: ["c11amz"] + }, + "application/vnd.coffeescript": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.document": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.document-template": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.presentation": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.presentation-template": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.spreadsheet": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.spreadsheet-template": { + source: "iana" + }, + "application/vnd.collection+json": { + source: "iana", + compressible: true + }, + "application/vnd.collection.doc+json": { + source: "iana", + compressible: true + }, + "application/vnd.collection.next+json": { + source: "iana", + compressible: true + }, + "application/vnd.comicbook+zip": { + source: "iana", + compressible: false + }, + "application/vnd.comicbook-rar": { + source: "iana" + }, + "application/vnd.commerce-battelle": { + source: "iana" + }, + "application/vnd.commonspace": { + source: "iana", + extensions: ["csp"] + }, + "application/vnd.contact.cmsg": { + source: "iana", + extensions: ["cdbcmsg"] + }, + "application/vnd.coreos.ignition+json": { + source: "iana", + compressible: true + }, + "application/vnd.cosmocaller": { + source: "iana", + extensions: ["cmc"] + }, + "application/vnd.crick.clicker": { + source: "iana", + extensions: ["clkx"] + }, + "application/vnd.crick.clicker.keyboard": { + source: "iana", + extensions: ["clkk"] + }, + "application/vnd.crick.clicker.palette": { + source: "iana", + extensions: ["clkp"] + }, + "application/vnd.crick.clicker.template": { + source: "iana", + extensions: ["clkt"] + }, + "application/vnd.crick.clicker.wordbank": { + source: "iana", + extensions: ["clkw"] + }, + "application/vnd.criticaltools.wbs+xml": { + source: "iana", + compressible: true, + extensions: ["wbs"] + }, + "application/vnd.cryptii.pipe+json": { + source: "iana", + compressible: true + }, + "application/vnd.crypto-shade-file": { + source: "iana" + }, + "application/vnd.cryptomator.encrypted": { + source: "iana" + }, + "application/vnd.cryptomator.vault": { + source: "iana" + }, + "application/vnd.ctc-posml": { + source: "iana", + extensions: ["pml"] + }, + "application/vnd.ctct.ws+xml": { + source: "iana", + compressible: true + }, + "application/vnd.cups-pdf": { + source: "iana" + }, + "application/vnd.cups-postscript": { + source: "iana" + }, + "application/vnd.cups-ppd": { + source: "iana", + extensions: ["ppd"] + }, + "application/vnd.cups-raster": { + source: "iana" + }, + "application/vnd.cups-raw": { + source: "iana" + }, + "application/vnd.curl": { + source: "iana" + }, + "application/vnd.curl.car": { + source: "apache", + extensions: ["car"] + }, + "application/vnd.curl.pcurl": { + source: "apache", + extensions: ["pcurl"] + }, + "application/vnd.cyan.dean.root+xml": { + source: "iana", + compressible: true + }, + "application/vnd.cybank": { + source: "iana" + }, + "application/vnd.cyclonedx+json": { + source: "iana", + compressible: true + }, + "application/vnd.cyclonedx+xml": { + source: "iana", + compressible: true + }, + "application/vnd.d2l.coursepackage1p0+zip": { + source: "iana", + compressible: false + }, + "application/vnd.d3m-dataset": { + source: "iana" + }, + "application/vnd.d3m-problem": { + source: "iana" + }, + "application/vnd.dart": { + source: "iana", + compressible: true, + extensions: ["dart"] + }, + "application/vnd.data-vision.rdz": { + source: "iana", + extensions: ["rdz"] + }, + "application/vnd.datapackage+json": { + source: "iana", + compressible: true + }, + "application/vnd.dataresource+json": { + source: "iana", + compressible: true + }, + "application/vnd.dbf": { + source: "iana", + extensions: ["dbf"] + }, + "application/vnd.debian.binary-package": { + source: "iana" + }, + "application/vnd.dece.data": { + source: "iana", + extensions: ["uvf", "uvvf", "uvd", "uvvd"] + }, + "application/vnd.dece.ttml+xml": { + source: "iana", + compressible: true, + extensions: ["uvt", "uvvt"] + }, + "application/vnd.dece.unspecified": { + source: "iana", + extensions: ["uvx", "uvvx"] + }, + "application/vnd.dece.zip": { + source: "iana", + extensions: ["uvz", "uvvz"] + }, + "application/vnd.denovo.fcselayout-link": { + source: "iana", + extensions: ["fe_launch"] + }, + "application/vnd.desmume.movie": { + source: "iana" + }, + "application/vnd.dir-bi.plate-dl-nosuffix": { + source: "iana" + }, + "application/vnd.dm.delegation+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dna": { + source: "iana", + extensions: ["dna"] + }, + "application/vnd.document+json": { + source: "iana", + compressible: true + }, + "application/vnd.dolby.mlp": { + source: "apache", + extensions: ["mlp"] + }, + "application/vnd.dolby.mobile.1": { + source: "iana" + }, + "application/vnd.dolby.mobile.2": { + source: "iana" + }, + "application/vnd.doremir.scorecloud-binary-document": { + source: "iana" + }, + "application/vnd.dpgraph": { + source: "iana", + extensions: ["dpg"] + }, + "application/vnd.dreamfactory": { + source: "iana", + extensions: ["dfac"] + }, + "application/vnd.drive+json": { + source: "iana", + compressible: true + }, + "application/vnd.ds-keypoint": { + source: "apache", + extensions: ["kpxx"] + }, + "application/vnd.dtg.local": { + source: "iana" + }, + "application/vnd.dtg.local.flash": { + source: "iana" + }, + "application/vnd.dtg.local.html": { + source: "iana" + }, + "application/vnd.dvb.ait": { + source: "iana", + extensions: ["ait"] + }, + "application/vnd.dvb.dvbisl+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.dvbj": { + source: "iana" + }, + "application/vnd.dvb.esgcontainer": { + source: "iana" + }, + "application/vnd.dvb.ipdcdftnotifaccess": { + source: "iana" + }, + "application/vnd.dvb.ipdcesgaccess": { + source: "iana" + }, + "application/vnd.dvb.ipdcesgaccess2": { + source: "iana" + }, + "application/vnd.dvb.ipdcesgpdd": { + source: "iana" + }, + "application/vnd.dvb.ipdcroaming": { + source: "iana" + }, + "application/vnd.dvb.iptv.alfec-base": { + source: "iana" + }, + "application/vnd.dvb.iptv.alfec-enhancement": { + source: "iana" + }, + "application/vnd.dvb.notif-aggregate-root+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-container+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-generic+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-ia-msglist+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-ia-registration-request+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-ia-registration-response+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-init+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.pfr": { + source: "iana" + }, + "application/vnd.dvb.service": { + source: "iana", + extensions: ["svc"] + }, + "application/vnd.dxr": { + source: "iana" + }, + "application/vnd.dynageo": { + source: "iana", + extensions: ["geo"] + }, + "application/vnd.dzr": { + source: "iana" + }, + "application/vnd.easykaraoke.cdgdownload": { + source: "iana" + }, + "application/vnd.ecdis-update": { + source: "iana" + }, + "application/vnd.ecip.rlp": { + source: "iana" + }, + "application/vnd.eclipse.ditto+json": { + source: "iana", + compressible: true + }, + "application/vnd.ecowin.chart": { + source: "iana", + extensions: ["mag"] + }, + "application/vnd.ecowin.filerequest": { + source: "iana" + }, + "application/vnd.ecowin.fileupdate": { + source: "iana" + }, + "application/vnd.ecowin.series": { + source: "iana" + }, + "application/vnd.ecowin.seriesrequest": { + source: "iana" + }, + "application/vnd.ecowin.seriesupdate": { + source: "iana" + }, + "application/vnd.efi.img": { + source: "iana" + }, + "application/vnd.efi.iso": { + source: "iana" + }, + "application/vnd.emclient.accessrequest+xml": { + source: "iana", + compressible: true + }, + "application/vnd.enliven": { + source: "iana", + extensions: ["nml"] + }, + "application/vnd.enphase.envoy": { + source: "iana" + }, + "application/vnd.eprints.data+xml": { + source: "iana", + compressible: true + }, + "application/vnd.epson.esf": { + source: "iana", + extensions: ["esf"] + }, + "application/vnd.epson.msf": { + source: "iana", + extensions: ["msf"] + }, + "application/vnd.epson.quickanime": { + source: "iana", + extensions: ["qam"] + }, + "application/vnd.epson.salt": { + source: "iana", + extensions: ["slt"] + }, + "application/vnd.epson.ssf": { + source: "iana", + extensions: ["ssf"] + }, + "application/vnd.ericsson.quickcall": { + source: "iana" + }, + "application/vnd.espass-espass+zip": { + source: "iana", + compressible: false + }, + "application/vnd.eszigno3+xml": { + source: "iana", + compressible: true, + extensions: ["es3", "et3"] + }, + "application/vnd.etsi.aoc+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.asic-e+zip": { + source: "iana", + compressible: false + }, + "application/vnd.etsi.asic-s+zip": { + source: "iana", + compressible: false + }, + "application/vnd.etsi.cug+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvcommand+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvdiscovery+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvprofile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvsad-bc+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvsad-cod+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvsad-npvr+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvservice+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvsync+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvueprofile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.mcid+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.mheg5": { + source: "iana" + }, + "application/vnd.etsi.overload-control-policy-dataset+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.pstn+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.sci+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.simservs+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.timestamp-token": { + source: "iana" + }, + "application/vnd.etsi.tsl+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.tsl.der": { + source: "iana" + }, + "application/vnd.eu.kasparian.car+json": { + source: "iana", + compressible: true + }, + "application/vnd.eudora.data": { + source: "iana" + }, + "application/vnd.evolv.ecig.profile": { + source: "iana" + }, + "application/vnd.evolv.ecig.settings": { + source: "iana" + }, + "application/vnd.evolv.ecig.theme": { + source: "iana" + }, + "application/vnd.exstream-empower+zip": { + source: "iana", + compressible: false + }, + "application/vnd.exstream-package": { + source: "iana" + }, + "application/vnd.ezpix-album": { + source: "iana", + extensions: ["ez2"] + }, + "application/vnd.ezpix-package": { + source: "iana", + extensions: ["ez3"] + }, + "application/vnd.f-secure.mobile": { + source: "iana" + }, + "application/vnd.familysearch.gedcom+zip": { + source: "iana", + compressible: false + }, + "application/vnd.fastcopy-disk-image": { + source: "iana" + }, + "application/vnd.fdf": { + source: "iana", + extensions: ["fdf"] + }, + "application/vnd.fdsn.mseed": { + source: "iana", + extensions: ["mseed"] + }, + "application/vnd.fdsn.seed": { + source: "iana", + extensions: ["seed", "dataless"] + }, + "application/vnd.ffsns": { + source: "iana" + }, + "application/vnd.ficlab.flb+zip": { + source: "iana", + compressible: false + }, + "application/vnd.filmit.zfc": { + source: "iana" + }, + "application/vnd.fints": { + source: "iana" + }, + "application/vnd.firemonkeys.cloudcell": { + source: "iana" + }, + "application/vnd.flographit": { + source: "iana", + extensions: ["gph"] + }, + "application/vnd.fluxtime.clip": { + source: "iana", + extensions: ["ftc"] + }, + "application/vnd.font-fontforge-sfd": { + source: "iana" + }, + "application/vnd.framemaker": { + source: "iana", + extensions: ["fm", "frame", "maker", "book"] + }, + "application/vnd.frogans.fnc": { + source: "iana", + extensions: ["fnc"] + }, + "application/vnd.frogans.ltf": { + source: "iana", + extensions: ["ltf"] + }, + "application/vnd.fsc.weblaunch": { + source: "iana", + extensions: ["fsc"] + }, + "application/vnd.fujifilm.fb.docuworks": { + source: "iana" + }, + "application/vnd.fujifilm.fb.docuworks.binder": { + source: "iana" + }, + "application/vnd.fujifilm.fb.docuworks.container": { + source: "iana" + }, + "application/vnd.fujifilm.fb.jfi+xml": { + source: "iana", + compressible: true + }, + "application/vnd.fujitsu.oasys": { + source: "iana", + extensions: ["oas"] + }, + "application/vnd.fujitsu.oasys2": { + source: "iana", + extensions: ["oa2"] + }, + "application/vnd.fujitsu.oasys3": { + source: "iana", + extensions: ["oa3"] + }, + "application/vnd.fujitsu.oasysgp": { + source: "iana", + extensions: ["fg5"] + }, + "application/vnd.fujitsu.oasysprs": { + source: "iana", + extensions: ["bh2"] + }, + "application/vnd.fujixerox.art-ex": { + source: "iana" + }, + "application/vnd.fujixerox.art4": { + source: "iana" + }, + "application/vnd.fujixerox.ddd": { + source: "iana", + extensions: ["ddd"] + }, + "application/vnd.fujixerox.docuworks": { + source: "iana", + extensions: ["xdw"] + }, + "application/vnd.fujixerox.docuworks.binder": { + source: "iana", + extensions: ["xbd"] + }, + "application/vnd.fujixerox.docuworks.container": { + source: "iana" + }, + "application/vnd.fujixerox.hbpl": { + source: "iana" + }, + "application/vnd.fut-misnet": { + source: "iana" + }, + "application/vnd.futoin+cbor": { + source: "iana" + }, + "application/vnd.futoin+json": { + source: "iana", + compressible: true + }, + "application/vnd.fuzzysheet": { + source: "iana", + extensions: ["fzs"] + }, + "application/vnd.genomatix.tuxedo": { + source: "iana", + extensions: ["txd"] + }, + "application/vnd.gentics.grd+json": { + source: "iana", + compressible: true + }, + "application/vnd.geo+json": { + source: "iana", + compressible: true + }, + "application/vnd.geocube+xml": { + source: "iana", + compressible: true + }, + "application/vnd.geogebra.file": { + source: "iana", + extensions: ["ggb"] + }, + "application/vnd.geogebra.slides": { + source: "iana" + }, + "application/vnd.geogebra.tool": { + source: "iana", + extensions: ["ggt"] + }, + "application/vnd.geometry-explorer": { + source: "iana", + extensions: ["gex", "gre"] + }, + "application/vnd.geonext": { + source: "iana", + extensions: ["gxt"] + }, + "application/vnd.geoplan": { + source: "iana", + extensions: ["g2w"] + }, + "application/vnd.geospace": { + source: "iana", + extensions: ["g3w"] + }, + "application/vnd.gerber": { + source: "iana" + }, + "application/vnd.globalplatform.card-content-mgt": { + source: "iana" + }, + "application/vnd.globalplatform.card-content-mgt-response": { + source: "iana" + }, + "application/vnd.gmx": { + source: "iana", + extensions: ["gmx"] + }, + "application/vnd.google-apps.document": { + compressible: false, + extensions: ["gdoc"] + }, + "application/vnd.google-apps.presentation": { + compressible: false, + extensions: ["gslides"] + }, + "application/vnd.google-apps.spreadsheet": { + compressible: false, + extensions: ["gsheet"] + }, + "application/vnd.google-earth.kml+xml": { + source: "iana", + compressible: true, + extensions: ["kml"] + }, + "application/vnd.google-earth.kmz": { + source: "iana", + compressible: false, + extensions: ["kmz"] + }, + "application/vnd.gov.sk.e-form+xml": { + source: "iana", + compressible: true + }, + "application/vnd.gov.sk.e-form+zip": { + source: "iana", + compressible: false + }, + "application/vnd.gov.sk.xmldatacontainer+xml": { + source: "iana", + compressible: true + }, + "application/vnd.grafeq": { + source: "iana", + extensions: ["gqf", "gqs"] + }, + "application/vnd.gridmp": { + source: "iana" + }, + "application/vnd.groove-account": { + source: "iana", + extensions: ["gac"] + }, + "application/vnd.groove-help": { + source: "iana", + extensions: ["ghf"] + }, + "application/vnd.groove-identity-message": { + source: "iana", + extensions: ["gim"] + }, + "application/vnd.groove-injector": { + source: "iana", + extensions: ["grv"] + }, + "application/vnd.groove-tool-message": { + source: "iana", + extensions: ["gtm"] + }, + "application/vnd.groove-tool-template": { + source: "iana", + extensions: ["tpl"] + }, + "application/vnd.groove-vcard": { + source: "iana", + extensions: ["vcg"] + }, + "application/vnd.hal+json": { + source: "iana", + compressible: true + }, + "application/vnd.hal+xml": { + source: "iana", + compressible: true, + extensions: ["hal"] + }, + "application/vnd.handheld-entertainment+xml": { + source: "iana", + compressible: true, + extensions: ["zmm"] + }, + "application/vnd.hbci": { + source: "iana", + extensions: ["hbci"] + }, + "application/vnd.hc+json": { + source: "iana", + compressible: true + }, + "application/vnd.hcl-bireports": { + source: "iana" + }, + "application/vnd.hdt": { + source: "iana" + }, + "application/vnd.heroku+json": { + source: "iana", + compressible: true + }, + "application/vnd.hhe.lesson-player": { + source: "iana", + extensions: ["les"] + }, + "application/vnd.hl7cda+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.hl7v2+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.hp-hpgl": { + source: "iana", + extensions: ["hpgl"] + }, + "application/vnd.hp-hpid": { + source: "iana", + extensions: ["hpid"] + }, + "application/vnd.hp-hps": { + source: "iana", + extensions: ["hps"] + }, + "application/vnd.hp-jlyt": { + source: "iana", + extensions: ["jlt"] + }, + "application/vnd.hp-pcl": { + source: "iana", + extensions: ["pcl"] + }, + "application/vnd.hp-pclxl": { + source: "iana", + extensions: ["pclxl"] + }, + "application/vnd.httphone": { + source: "iana" + }, + "application/vnd.hydrostatix.sof-data": { + source: "iana", + extensions: ["sfd-hdstx"] + }, + "application/vnd.hyper+json": { + source: "iana", + compressible: true + }, + "application/vnd.hyper-item+json": { + source: "iana", + compressible: true + }, + "application/vnd.hyperdrive+json": { + source: "iana", + compressible: true + }, + "application/vnd.hzn-3d-crossword": { + source: "iana" + }, + "application/vnd.ibm.afplinedata": { + source: "iana" + }, + "application/vnd.ibm.electronic-media": { + source: "iana" + }, + "application/vnd.ibm.minipay": { + source: "iana", + extensions: ["mpy"] + }, + "application/vnd.ibm.modcap": { + source: "iana", + extensions: ["afp", "listafp", "list3820"] + }, + "application/vnd.ibm.rights-management": { + source: "iana", + extensions: ["irm"] + }, + "application/vnd.ibm.secure-container": { + source: "iana", + extensions: ["sc"] + }, + "application/vnd.iccprofile": { + source: "iana", + extensions: ["icc", "icm"] + }, + "application/vnd.ieee.1905": { + source: "iana" + }, + "application/vnd.igloader": { + source: "iana", + extensions: ["igl"] + }, + "application/vnd.imagemeter.folder+zip": { + source: "iana", + compressible: false + }, + "application/vnd.imagemeter.image+zip": { + source: "iana", + compressible: false + }, + "application/vnd.immervision-ivp": { + source: "iana", + extensions: ["ivp"] + }, + "application/vnd.immervision-ivu": { + source: "iana", + extensions: ["ivu"] + }, + "application/vnd.ims.imsccv1p1": { + source: "iana" + }, + "application/vnd.ims.imsccv1p2": { + source: "iana" + }, + "application/vnd.ims.imsccv1p3": { + source: "iana" + }, + "application/vnd.ims.lis.v2.result+json": { + source: "iana", + compressible: true + }, + "application/vnd.ims.lti.v2.toolconsumerprofile+json": { + source: "iana", + compressible: true + }, + "application/vnd.ims.lti.v2.toolproxy+json": { + source: "iana", + compressible: true + }, + "application/vnd.ims.lti.v2.toolproxy.id+json": { + source: "iana", + compressible: true + }, + "application/vnd.ims.lti.v2.toolsettings+json": { + source: "iana", + compressible: true + }, + "application/vnd.ims.lti.v2.toolsettings.simple+json": { + source: "iana", + compressible: true + }, + "application/vnd.informedcontrol.rms+xml": { + source: "iana", + compressible: true + }, + "application/vnd.informix-visionary": { + source: "iana" + }, + "application/vnd.infotech.project": { + source: "iana" + }, + "application/vnd.infotech.project+xml": { + source: "iana", + compressible: true + }, + "application/vnd.innopath.wamp.notification": { + source: "iana" + }, + "application/vnd.insors.igm": { + source: "iana", + extensions: ["igm"] + }, + "application/vnd.intercon.formnet": { + source: "iana", + extensions: ["xpw", "xpx"] + }, + "application/vnd.intergeo": { + source: "iana", + extensions: ["i2g"] + }, + "application/vnd.intertrust.digibox": { + source: "iana" + }, + "application/vnd.intertrust.nncp": { + source: "iana" + }, + "application/vnd.intu.qbo": { + source: "iana", + extensions: ["qbo"] + }, + "application/vnd.intu.qfx": { + source: "iana", + extensions: ["qfx"] + }, + "application/vnd.iptc.g2.catalogitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.conceptitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.knowledgeitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.newsitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.newsmessage+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.packageitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.planningitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.ipunplugged.rcprofile": { + source: "iana", + extensions: ["rcprofile"] + }, + "application/vnd.irepository.package+xml": { + source: "iana", + compressible: true, + extensions: ["irp"] + }, + "application/vnd.is-xpr": { + source: "iana", + extensions: ["xpr"] + }, + "application/vnd.isac.fcs": { + source: "iana", + extensions: ["fcs"] + }, + "application/vnd.iso11783-10+zip": { + source: "iana", + compressible: false + }, + "application/vnd.jam": { + source: "iana", + extensions: ["jam"] + }, + "application/vnd.japannet-directory-service": { + source: "iana" + }, + "application/vnd.japannet-jpnstore-wakeup": { + source: "iana" + }, + "application/vnd.japannet-payment-wakeup": { + source: "iana" + }, + "application/vnd.japannet-registration": { + source: "iana" + }, + "application/vnd.japannet-registration-wakeup": { + source: "iana" + }, + "application/vnd.japannet-setstore-wakeup": { + source: "iana" + }, + "application/vnd.japannet-verification": { + source: "iana" + }, + "application/vnd.japannet-verification-wakeup": { + source: "iana" + }, + "application/vnd.jcp.javame.midlet-rms": { + source: "iana", + extensions: ["rms"] + }, + "application/vnd.jisp": { + source: "iana", + extensions: ["jisp"] + }, + "application/vnd.joost.joda-archive": { + source: "iana", + extensions: ["joda"] + }, + "application/vnd.jsk.isdn-ngn": { + source: "iana" + }, + "application/vnd.kahootz": { + source: "iana", + extensions: ["ktz", "ktr"] + }, + "application/vnd.kde.karbon": { + source: "iana", + extensions: ["karbon"] + }, + "application/vnd.kde.kchart": { + source: "iana", + extensions: ["chrt"] + }, + "application/vnd.kde.kformula": { + source: "iana", + extensions: ["kfo"] + }, + "application/vnd.kde.kivio": { + source: "iana", + extensions: ["flw"] + }, + "application/vnd.kde.kontour": { + source: "iana", + extensions: ["kon"] + }, + "application/vnd.kde.kpresenter": { + source: "iana", + extensions: ["kpr", "kpt"] + }, + "application/vnd.kde.kspread": { + source: "iana", + extensions: ["ksp"] + }, + "application/vnd.kde.kword": { + source: "iana", + extensions: ["kwd", "kwt"] + }, + "application/vnd.kenameaapp": { + source: "iana", + extensions: ["htke"] + }, + "application/vnd.kidspiration": { + source: "iana", + extensions: ["kia"] + }, + "application/vnd.kinar": { + source: "iana", + extensions: ["kne", "knp"] + }, + "application/vnd.koan": { + source: "iana", + extensions: ["skp", "skd", "skt", "skm"] + }, + "application/vnd.kodak-descriptor": { + source: "iana", + extensions: ["sse"] + }, + "application/vnd.las": { + source: "iana" + }, + "application/vnd.las.las+json": { + source: "iana", + compressible: true + }, + "application/vnd.las.las+xml": { + source: "iana", + compressible: true, + extensions: ["lasxml"] + }, + "application/vnd.laszip": { + source: "iana" + }, + "application/vnd.leap+json": { + source: "iana", + compressible: true + }, + "application/vnd.liberty-request+xml": { + source: "iana", + compressible: true + }, + "application/vnd.llamagraphics.life-balance.desktop": { + source: "iana", + extensions: ["lbd"] + }, + "application/vnd.llamagraphics.life-balance.exchange+xml": { + source: "iana", + compressible: true, + extensions: ["lbe"] + }, + "application/vnd.logipipe.circuit+zip": { + source: "iana", + compressible: false + }, + "application/vnd.loom": { + source: "iana" + }, + "application/vnd.lotus-1-2-3": { + source: "iana", + extensions: ["123"] + }, + "application/vnd.lotus-approach": { + source: "iana", + extensions: ["apr"] + }, + "application/vnd.lotus-freelance": { + source: "iana", + extensions: ["pre"] + }, + "application/vnd.lotus-notes": { + source: "iana", + extensions: ["nsf"] + }, + "application/vnd.lotus-organizer": { + source: "iana", + extensions: ["org"] + }, + "application/vnd.lotus-screencam": { + source: "iana", + extensions: ["scm"] + }, + "application/vnd.lotus-wordpro": { + source: "iana", + extensions: ["lwp"] + }, + "application/vnd.macports.portpkg": { + source: "iana", + extensions: ["portpkg"] + }, + "application/vnd.mapbox-vector-tile": { + source: "iana", + extensions: ["mvt"] + }, + "application/vnd.marlin.drm.actiontoken+xml": { + source: "iana", + compressible: true + }, + "application/vnd.marlin.drm.conftoken+xml": { + source: "iana", + compressible: true + }, + "application/vnd.marlin.drm.license+xml": { + source: "iana", + compressible: true + }, + "application/vnd.marlin.drm.mdcf": { + source: "iana" + }, + "application/vnd.mason+json": { + source: "iana", + compressible: true + }, + "application/vnd.maxar.archive.3tz+zip": { + source: "iana", + compressible: false + }, + "application/vnd.maxmind.maxmind-db": { + source: "iana" + }, + "application/vnd.mcd": { + source: "iana", + extensions: ["mcd"] + }, + "application/vnd.medcalcdata": { + source: "iana", + extensions: ["mc1"] + }, + "application/vnd.mediastation.cdkey": { + source: "iana", + extensions: ["cdkey"] + }, + "application/vnd.meridian-slingshot": { + source: "iana" + }, + "application/vnd.mfer": { + source: "iana", + extensions: ["mwf"] + }, + "application/vnd.mfmp": { + source: "iana", + extensions: ["mfm"] + }, + "application/vnd.micro+json": { + source: "iana", + compressible: true + }, + "application/vnd.micrografx.flo": { + source: "iana", + extensions: ["flo"] + }, + "application/vnd.micrografx.igx": { + source: "iana", + extensions: ["igx"] + }, + "application/vnd.microsoft.portable-executable": { + source: "iana" + }, + "application/vnd.microsoft.windows.thumbnail-cache": { + source: "iana" + }, + "application/vnd.miele+json": { + source: "iana", + compressible: true + }, + "application/vnd.mif": { + source: "iana", + extensions: ["mif"] + }, + "application/vnd.minisoft-hp3000-save": { + source: "iana" + }, + "application/vnd.mitsubishi.misty-guard.trustweb": { + source: "iana" + }, + "application/vnd.mobius.daf": { + source: "iana", + extensions: ["daf"] + }, + "application/vnd.mobius.dis": { + source: "iana", + extensions: ["dis"] + }, + "application/vnd.mobius.mbk": { + source: "iana", + extensions: ["mbk"] + }, + "application/vnd.mobius.mqy": { + source: "iana", + extensions: ["mqy"] + }, + "application/vnd.mobius.msl": { + source: "iana", + extensions: ["msl"] + }, + "application/vnd.mobius.plc": { + source: "iana", + extensions: ["plc"] + }, + "application/vnd.mobius.txf": { + source: "iana", + extensions: ["txf"] + }, + "application/vnd.mophun.application": { + source: "iana", + extensions: ["mpn"] + }, + "application/vnd.mophun.certificate": { + source: "iana", + extensions: ["mpc"] + }, + "application/vnd.motorola.flexsuite": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.adsi": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.fis": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.gotap": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.kmr": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.ttc": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.wem": { + source: "iana" + }, + "application/vnd.motorola.iprm": { + source: "iana" + }, + "application/vnd.mozilla.xul+xml": { + source: "iana", + compressible: true, + extensions: ["xul"] + }, + "application/vnd.ms-3mfdocument": { + source: "iana" + }, + "application/vnd.ms-artgalry": { + source: "iana", + extensions: ["cil"] + }, + "application/vnd.ms-asf": { + source: "iana" + }, + "application/vnd.ms-cab-compressed": { + source: "iana", + extensions: ["cab"] + }, + "application/vnd.ms-color.iccprofile": { + source: "apache" + }, + "application/vnd.ms-excel": { + source: "iana", + compressible: false, + extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"] + }, + "application/vnd.ms-excel.addin.macroenabled.12": { + source: "iana", + extensions: ["xlam"] + }, + "application/vnd.ms-excel.sheet.binary.macroenabled.12": { + source: "iana", + extensions: ["xlsb"] + }, + "application/vnd.ms-excel.sheet.macroenabled.12": { + source: "iana", + extensions: ["xlsm"] + }, + "application/vnd.ms-excel.template.macroenabled.12": { + source: "iana", + extensions: ["xltm"] + }, + "application/vnd.ms-fontobject": { + source: "iana", + compressible: true, + extensions: ["eot"] + }, + "application/vnd.ms-htmlhelp": { + source: "iana", + extensions: ["chm"] + }, + "application/vnd.ms-ims": { + source: "iana", + extensions: ["ims"] + }, + "application/vnd.ms-lrm": { + source: "iana", + extensions: ["lrm"] + }, + "application/vnd.ms-office.activex+xml": { + source: "iana", + compressible: true + }, + "application/vnd.ms-officetheme": { + source: "iana", + extensions: ["thmx"] + }, + "application/vnd.ms-opentype": { + source: "apache", + compressible: true + }, + "application/vnd.ms-outlook": { + compressible: false, + extensions: ["msg"] + }, + "application/vnd.ms-package.obfuscated-opentype": { + source: "apache" + }, + "application/vnd.ms-pki.seccat": { + source: "apache", + extensions: ["cat"] + }, + "application/vnd.ms-pki.stl": { + source: "apache", + extensions: ["stl"] + }, + "application/vnd.ms-playready.initiator+xml": { + source: "iana", + compressible: true + }, + "application/vnd.ms-powerpoint": { + source: "iana", + compressible: false, + extensions: ["ppt", "pps", "pot"] + }, + "application/vnd.ms-powerpoint.addin.macroenabled.12": { + source: "iana", + extensions: ["ppam"] + }, + "application/vnd.ms-powerpoint.presentation.macroenabled.12": { + source: "iana", + extensions: ["pptm"] + }, + "application/vnd.ms-powerpoint.slide.macroenabled.12": { + source: "iana", + extensions: ["sldm"] + }, + "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { + source: "iana", + extensions: ["ppsm"] + }, + "application/vnd.ms-powerpoint.template.macroenabled.12": { + source: "iana", + extensions: ["potm"] + }, + "application/vnd.ms-printdevicecapabilities+xml": { + source: "iana", + compressible: true + }, + "application/vnd.ms-printing.printticket+xml": { + source: "apache", + compressible: true + }, + "application/vnd.ms-printschematicket+xml": { + source: "iana", + compressible: true + }, + "application/vnd.ms-project": { + source: "iana", + extensions: ["mpp", "mpt"] + }, + "application/vnd.ms-tnef": { + source: "iana" + }, + "application/vnd.ms-windows.devicepairing": { + source: "iana" + }, + "application/vnd.ms-windows.nwprinting.oob": { + source: "iana" + }, + "application/vnd.ms-windows.printerpairing": { + source: "iana" + }, + "application/vnd.ms-windows.wsd.oob": { + source: "iana" + }, + "application/vnd.ms-wmdrm.lic-chlg-req": { + source: "iana" + }, + "application/vnd.ms-wmdrm.lic-resp": { + source: "iana" + }, + "application/vnd.ms-wmdrm.meter-chlg-req": { + source: "iana" + }, + "application/vnd.ms-wmdrm.meter-resp": { + source: "iana" + }, + "application/vnd.ms-word.document.macroenabled.12": { + source: "iana", + extensions: ["docm"] + }, + "application/vnd.ms-word.template.macroenabled.12": { + source: "iana", + extensions: ["dotm"] + }, + "application/vnd.ms-works": { + source: "iana", + extensions: ["wps", "wks", "wcm", "wdb"] + }, + "application/vnd.ms-wpl": { + source: "iana", + extensions: ["wpl"] + }, + "application/vnd.ms-xpsdocument": { + source: "iana", + compressible: false, + extensions: ["xps"] + }, + "application/vnd.msa-disk-image": { + source: "iana" + }, + "application/vnd.mseq": { + source: "iana", + extensions: ["mseq"] + }, + "application/vnd.msign": { + source: "iana" + }, + "application/vnd.multiad.creator": { + source: "iana" + }, + "application/vnd.multiad.creator.cif": { + source: "iana" + }, + "application/vnd.music-niff": { + source: "iana" + }, + "application/vnd.musician": { + source: "iana", + extensions: ["mus"] + }, + "application/vnd.muvee.style": { + source: "iana", + extensions: ["msty"] + }, + "application/vnd.mynfc": { + source: "iana", + extensions: ["taglet"] + }, + "application/vnd.nacamar.ybrid+json": { + source: "iana", + compressible: true + }, + "application/vnd.ncd.control": { + source: "iana" + }, + "application/vnd.ncd.reference": { + source: "iana" + }, + "application/vnd.nearst.inv+json": { + source: "iana", + compressible: true + }, + "application/vnd.nebumind.line": { + source: "iana" + }, + "application/vnd.nervana": { + source: "iana" + }, + "application/vnd.netfpx": { + source: "iana" + }, + "application/vnd.neurolanguage.nlu": { + source: "iana", + extensions: ["nlu"] + }, + "application/vnd.nimn": { + source: "iana" + }, + "application/vnd.nintendo.nitro.rom": { + source: "iana" + }, + "application/vnd.nintendo.snes.rom": { + source: "iana" + }, + "application/vnd.nitf": { + source: "iana", + extensions: ["ntf", "nitf"] + }, + "application/vnd.noblenet-directory": { + source: "iana", + extensions: ["nnd"] + }, + "application/vnd.noblenet-sealer": { + source: "iana", + extensions: ["nns"] + }, + "application/vnd.noblenet-web": { + source: "iana", + extensions: ["nnw"] + }, + "application/vnd.nokia.catalogs": { + source: "iana" + }, + "application/vnd.nokia.conml+wbxml": { + source: "iana" + }, + "application/vnd.nokia.conml+xml": { + source: "iana", + compressible: true + }, + "application/vnd.nokia.iptv.config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.nokia.isds-radio-presets": { + source: "iana" + }, + "application/vnd.nokia.landmark+wbxml": { + source: "iana" + }, + "application/vnd.nokia.landmark+xml": { + source: "iana", + compressible: true + }, + "application/vnd.nokia.landmarkcollection+xml": { + source: "iana", + compressible: true + }, + "application/vnd.nokia.n-gage.ac+xml": { + source: "iana", + compressible: true, + extensions: ["ac"] + }, + "application/vnd.nokia.n-gage.data": { + source: "iana", + extensions: ["ngdat"] + }, + "application/vnd.nokia.n-gage.symbian.install": { + source: "iana", + extensions: ["n-gage"] + }, + "application/vnd.nokia.ncd": { + source: "iana" + }, + "application/vnd.nokia.pcd+wbxml": { + source: "iana" + }, + "application/vnd.nokia.pcd+xml": { + source: "iana", + compressible: true + }, + "application/vnd.nokia.radio-preset": { + source: "iana", + extensions: ["rpst"] + }, + "application/vnd.nokia.radio-presets": { + source: "iana", + extensions: ["rpss"] + }, + "application/vnd.novadigm.edm": { + source: "iana", + extensions: ["edm"] + }, + "application/vnd.novadigm.edx": { + source: "iana", + extensions: ["edx"] + }, + "application/vnd.novadigm.ext": { + source: "iana", + extensions: ["ext"] + }, + "application/vnd.ntt-local.content-share": { + source: "iana" + }, + "application/vnd.ntt-local.file-transfer": { + source: "iana" + }, + "application/vnd.ntt-local.ogw_remote-access": { + source: "iana" + }, + "application/vnd.ntt-local.sip-ta_remote": { + source: "iana" + }, + "application/vnd.ntt-local.sip-ta_tcp_stream": { + source: "iana" + }, + "application/vnd.oasis.opendocument.chart": { + source: "iana", + extensions: ["odc"] + }, + "application/vnd.oasis.opendocument.chart-template": { + source: "iana", + extensions: ["otc"] + }, + "application/vnd.oasis.opendocument.database": { + source: "iana", + extensions: ["odb"] + }, + "application/vnd.oasis.opendocument.formula": { + source: "iana", + extensions: ["odf"] + }, + "application/vnd.oasis.opendocument.formula-template": { + source: "iana", + extensions: ["odft"] + }, + "application/vnd.oasis.opendocument.graphics": { + source: "iana", + compressible: false, + extensions: ["odg"] + }, + "application/vnd.oasis.opendocument.graphics-template": { + source: "iana", + extensions: ["otg"] + }, + "application/vnd.oasis.opendocument.image": { + source: "iana", + extensions: ["odi"] + }, + "application/vnd.oasis.opendocument.image-template": { + source: "iana", + extensions: ["oti"] + }, + "application/vnd.oasis.opendocument.presentation": { + source: "iana", + compressible: false, + extensions: ["odp"] + }, + "application/vnd.oasis.opendocument.presentation-template": { + source: "iana", + extensions: ["otp"] + }, + "application/vnd.oasis.opendocument.spreadsheet": { + source: "iana", + compressible: false, + extensions: ["ods"] + }, + "application/vnd.oasis.opendocument.spreadsheet-template": { + source: "iana", + extensions: ["ots"] + }, + "application/vnd.oasis.opendocument.text": { + source: "iana", + compressible: false, + extensions: ["odt"] + }, + "application/vnd.oasis.opendocument.text-master": { + source: "iana", + extensions: ["odm"] + }, + "application/vnd.oasis.opendocument.text-template": { + source: "iana", + extensions: ["ott"] + }, + "application/vnd.oasis.opendocument.text-web": { + source: "iana", + extensions: ["oth"] + }, + "application/vnd.obn": { + source: "iana" + }, + "application/vnd.ocf+cbor": { + source: "iana" + }, + "application/vnd.oci.image.manifest.v1+json": { + source: "iana", + compressible: true + }, + "application/vnd.oftn.l10n+json": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.contentaccessdownload+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.contentaccessstreaming+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.cspg-hexbinary": { + source: "iana" + }, + "application/vnd.oipf.dae.svg+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.dae.xhtml+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.mippvcontrolmessage+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.pae.gem": { + source: "iana" + }, + "application/vnd.oipf.spdiscovery+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.spdlist+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.ueprofile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.userprofile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.olpc-sugar": { + source: "iana", + extensions: ["xo"] + }, + "application/vnd.oma-scws-config": { + source: "iana" + }, + "application/vnd.oma-scws-http-request": { + source: "iana" + }, + "application/vnd.oma-scws-http-response": { + source: "iana" + }, + "application/vnd.oma.bcast.associated-procedure-parameter+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.drm-trigger+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.imd+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.ltkm": { + source: "iana" + }, + "application/vnd.oma.bcast.notification+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.provisioningtrigger": { + source: "iana" + }, + "application/vnd.oma.bcast.sgboot": { + source: "iana" + }, + "application/vnd.oma.bcast.sgdd+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.sgdu": { + source: "iana" + }, + "application/vnd.oma.bcast.simple-symbol-container": { + source: "iana" + }, + "application/vnd.oma.bcast.smartcard-trigger+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.sprov+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.stkm": { + source: "iana" + }, + "application/vnd.oma.cab-address-book+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.cab-feature-handler+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.cab-pcc+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.cab-subs-invite+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.cab-user-prefs+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.dcd": { + source: "iana" + }, + "application/vnd.oma.dcdc": { + source: "iana" + }, + "application/vnd.oma.dd2+xml": { + source: "iana", + compressible: true, + extensions: ["dd2"] + }, + "application/vnd.oma.drm.risd+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.group-usage-list+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.lwm2m+cbor": { + source: "iana" + }, + "application/vnd.oma.lwm2m+json": { + source: "iana", + compressible: true + }, + "application/vnd.oma.lwm2m+tlv": { + source: "iana" + }, + "application/vnd.oma.pal+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.poc.detailed-progress-report+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.poc.final-report+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.poc.groups+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.poc.invocation-descriptor+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.poc.optimized-progress-report+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.push": { + source: "iana" + }, + "application/vnd.oma.scidm.messages+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.xcap-directory+xml": { + source: "iana", + compressible: true + }, + "application/vnd.omads-email+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.omads-file+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.omads-folder+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.omaloc-supl-init": { + source: "iana" + }, + "application/vnd.onepager": { + source: "iana" + }, + "application/vnd.onepagertamp": { + source: "iana" + }, + "application/vnd.onepagertamx": { + source: "iana" + }, + "application/vnd.onepagertat": { + source: "iana" + }, + "application/vnd.onepagertatp": { + source: "iana" + }, + "application/vnd.onepagertatx": { + source: "iana" + }, + "application/vnd.openblox.game+xml": { + source: "iana", + compressible: true, + extensions: ["obgx"] + }, + "application/vnd.openblox.game-binary": { + source: "iana" + }, + "application/vnd.openeye.oeb": { + source: "iana" + }, + "application/vnd.openofficeorg.extension": { + source: "apache", + extensions: ["oxt"] + }, + "application/vnd.openstreetmap.data+xml": { + source: "iana", + compressible: true, + extensions: ["osm"] + }, + "application/vnd.opentimestamps.ots": { + source: "iana" + }, + "application/vnd.openxmlformats-officedocument.custom-properties+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawing+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.extended-properties+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation": { + source: "iana", + compressible: false, + extensions: ["pptx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide": { + source: "iana", + extensions: ["sldx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { + source: "iana", + extensions: ["ppsx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.template": { + source: "iana", + extensions: ["potx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { + source: "iana", + compressible: false, + extensions: ["xlsx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { + source: "iana", + extensions: ["xltx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.theme+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.themeoverride+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.vmldrawing": { + source: "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { + source: "iana", + compressible: false, + extensions: ["docx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { + source: "iana", + extensions: ["dotx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-package.core-properties+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-package.relationships+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oracle.resource+json": { + source: "iana", + compressible: true + }, + "application/vnd.orange.indata": { + source: "iana" + }, + "application/vnd.osa.netdeploy": { + source: "iana" + }, + "application/vnd.osgeo.mapguide.package": { + source: "iana", + extensions: ["mgp"] + }, + "application/vnd.osgi.bundle": { + source: "iana" + }, + "application/vnd.osgi.dp": { + source: "iana", + extensions: ["dp"] + }, + "application/vnd.osgi.subsystem": { + source: "iana", + extensions: ["esa"] + }, + "application/vnd.otps.ct-kip+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oxli.countgraph": { + source: "iana" + }, + "application/vnd.pagerduty+json": { + source: "iana", + compressible: true + }, + "application/vnd.palm": { + source: "iana", + extensions: ["pdb", "pqa", "oprc"] + }, + "application/vnd.panoply": { + source: "iana" + }, + "application/vnd.paos.xml": { + source: "iana" + }, + "application/vnd.patentdive": { + source: "iana" + }, + "application/vnd.patientecommsdoc": { + source: "iana" + }, + "application/vnd.pawaafile": { + source: "iana", + extensions: ["paw"] + }, + "application/vnd.pcos": { + source: "iana" + }, + "application/vnd.pg.format": { + source: "iana", + extensions: ["str"] + }, + "application/vnd.pg.osasli": { + source: "iana", + extensions: ["ei6"] + }, + "application/vnd.piaccess.application-licence": { + source: "iana" + }, + "application/vnd.picsel": { + source: "iana", + extensions: ["efif"] + }, + "application/vnd.pmi.widget": { + source: "iana", + extensions: ["wg"] + }, + "application/vnd.poc.group-advertisement+xml": { + source: "iana", + compressible: true + }, + "application/vnd.pocketlearn": { + source: "iana", + extensions: ["plf"] + }, + "application/vnd.powerbuilder6": { + source: "iana", + extensions: ["pbd"] + }, + "application/vnd.powerbuilder6-s": { + source: "iana" + }, + "application/vnd.powerbuilder7": { + source: "iana" + }, + "application/vnd.powerbuilder7-s": { + source: "iana" + }, + "application/vnd.powerbuilder75": { + source: "iana" + }, + "application/vnd.powerbuilder75-s": { + source: "iana" + }, + "application/vnd.preminet": { + source: "iana" + }, + "application/vnd.previewsystems.box": { + source: "iana", + extensions: ["box"] + }, + "application/vnd.proteus.magazine": { + source: "iana", + extensions: ["mgz"] + }, + "application/vnd.psfs": { + source: "iana" + }, + "application/vnd.publishare-delta-tree": { + source: "iana", + extensions: ["qps"] + }, + "application/vnd.pvi.ptid1": { + source: "iana", + extensions: ["ptid"] + }, + "application/vnd.pwg-multiplexed": { + source: "iana" + }, + "application/vnd.pwg-xhtml-print+xml": { + source: "iana", + compressible: true + }, + "application/vnd.qualcomm.brew-app-res": { + source: "iana" + }, + "application/vnd.quarantainenet": { + source: "iana" + }, + "application/vnd.quark.quarkxpress": { + source: "iana", + extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"] + }, + "application/vnd.quobject-quoxdocument": { + source: "iana" + }, + "application/vnd.radisys.moml+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-audit+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-audit-conf+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-audit-conn+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-audit-dialog+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-audit-stream+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-conf+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-base+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-fax-detect+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-group+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-speech+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-transform+xml": { + source: "iana", + compressible: true + }, + "application/vnd.rainstor.data": { + source: "iana" + }, + "application/vnd.rapid": { + source: "iana" + }, + "application/vnd.rar": { + source: "iana", + extensions: ["rar"] + }, + "application/vnd.realvnc.bed": { + source: "iana", + extensions: ["bed"] + }, + "application/vnd.recordare.musicxml": { + source: "iana", + extensions: ["mxl"] + }, + "application/vnd.recordare.musicxml+xml": { + source: "iana", + compressible: true, + extensions: ["musicxml"] + }, + "application/vnd.renlearn.rlprint": { + source: "iana" + }, + "application/vnd.resilient.logic": { + source: "iana" + }, + "application/vnd.restful+json": { + source: "iana", + compressible: true + }, + "application/vnd.rig.cryptonote": { + source: "iana", + extensions: ["cryptonote"] + }, + "application/vnd.rim.cod": { + source: "apache", + extensions: ["cod"] + }, + "application/vnd.rn-realmedia": { + source: "apache", + extensions: ["rm"] + }, + "application/vnd.rn-realmedia-vbr": { + source: "apache", + extensions: ["rmvb"] + }, + "application/vnd.route66.link66+xml": { + source: "iana", + compressible: true, + extensions: ["link66"] + }, + "application/vnd.rs-274x": { + source: "iana" + }, + "application/vnd.ruckus.download": { + source: "iana" + }, + "application/vnd.s3sms": { + source: "iana" + }, + "application/vnd.sailingtracker.track": { + source: "iana", + extensions: ["st"] + }, + "application/vnd.sar": { + source: "iana" + }, + "application/vnd.sbm.cid": { + source: "iana" + }, + "application/vnd.sbm.mid2": { + source: "iana" + }, + "application/vnd.scribus": { + source: "iana" + }, + "application/vnd.sealed.3df": { + source: "iana" + }, + "application/vnd.sealed.csf": { + source: "iana" + }, + "application/vnd.sealed.doc": { + source: "iana" + }, + "application/vnd.sealed.eml": { + source: "iana" + }, + "application/vnd.sealed.mht": { + source: "iana" + }, + "application/vnd.sealed.net": { + source: "iana" + }, + "application/vnd.sealed.ppt": { + source: "iana" + }, + "application/vnd.sealed.tiff": { + source: "iana" + }, + "application/vnd.sealed.xls": { + source: "iana" + }, + "application/vnd.sealedmedia.softseal.html": { + source: "iana" + }, + "application/vnd.sealedmedia.softseal.pdf": { + source: "iana" + }, + "application/vnd.seemail": { + source: "iana", + extensions: ["see"] + }, + "application/vnd.seis+json": { + source: "iana", + compressible: true + }, + "application/vnd.sema": { + source: "iana", + extensions: ["sema"] + }, + "application/vnd.semd": { + source: "iana", + extensions: ["semd"] + }, + "application/vnd.semf": { + source: "iana", + extensions: ["semf"] + }, + "application/vnd.shade-save-file": { + source: "iana" + }, + "application/vnd.shana.informed.formdata": { + source: "iana", + extensions: ["ifm"] + }, + "application/vnd.shana.informed.formtemplate": { + source: "iana", + extensions: ["itp"] + }, + "application/vnd.shana.informed.interchange": { + source: "iana", + extensions: ["iif"] + }, + "application/vnd.shana.informed.package": { + source: "iana", + extensions: ["ipk"] + }, + "application/vnd.shootproof+json": { + source: "iana", + compressible: true + }, + "application/vnd.shopkick+json": { + source: "iana", + compressible: true + }, + "application/vnd.shp": { + source: "iana" + }, + "application/vnd.shx": { + source: "iana" + }, + "application/vnd.sigrok.session": { + source: "iana" + }, + "application/vnd.simtech-mindmapper": { + source: "iana", + extensions: ["twd", "twds"] + }, + "application/vnd.siren+json": { + source: "iana", + compressible: true + }, + "application/vnd.smaf": { + source: "iana", + extensions: ["mmf"] + }, + "application/vnd.smart.notebook": { + source: "iana" + }, + "application/vnd.smart.teacher": { + source: "iana", + extensions: ["teacher"] + }, + "application/vnd.snesdev-page-table": { + source: "iana" + }, + "application/vnd.software602.filler.form+xml": { + source: "iana", + compressible: true, + extensions: ["fo"] + }, + "application/vnd.software602.filler.form-xml-zip": { + source: "iana" + }, + "application/vnd.solent.sdkm+xml": { + source: "iana", + compressible: true, + extensions: ["sdkm", "sdkd"] + }, + "application/vnd.spotfire.dxp": { + source: "iana", + extensions: ["dxp"] + }, + "application/vnd.spotfire.sfs": { + source: "iana", + extensions: ["sfs"] + }, + "application/vnd.sqlite3": { + source: "iana" + }, + "application/vnd.sss-cod": { + source: "iana" + }, + "application/vnd.sss-dtf": { + source: "iana" + }, + "application/vnd.sss-ntf": { + source: "iana" + }, + "application/vnd.stardivision.calc": { + source: "apache", + extensions: ["sdc"] + }, + "application/vnd.stardivision.draw": { + source: "apache", + extensions: ["sda"] + }, + "application/vnd.stardivision.impress": { + source: "apache", + extensions: ["sdd"] + }, + "application/vnd.stardivision.math": { + source: "apache", + extensions: ["smf"] + }, + "application/vnd.stardivision.writer": { + source: "apache", + extensions: ["sdw", "vor"] + }, + "application/vnd.stardivision.writer-global": { + source: "apache", + extensions: ["sgl"] + }, + "application/vnd.stepmania.package": { + source: "iana", + extensions: ["smzip"] + }, + "application/vnd.stepmania.stepchart": { + source: "iana", + extensions: ["sm"] + }, + "application/vnd.street-stream": { + source: "iana" + }, + "application/vnd.sun.wadl+xml": { + source: "iana", + compressible: true, + extensions: ["wadl"] + }, + "application/vnd.sun.xml.calc": { + source: "apache", + extensions: ["sxc"] + }, + "application/vnd.sun.xml.calc.template": { + source: "apache", + extensions: ["stc"] + }, + "application/vnd.sun.xml.draw": { + source: "apache", + extensions: ["sxd"] + }, + "application/vnd.sun.xml.draw.template": { + source: "apache", + extensions: ["std"] + }, + "application/vnd.sun.xml.impress": { + source: "apache", + extensions: ["sxi"] + }, + "application/vnd.sun.xml.impress.template": { + source: "apache", + extensions: ["sti"] + }, + "application/vnd.sun.xml.math": { + source: "apache", + extensions: ["sxm"] + }, + "application/vnd.sun.xml.writer": { + source: "apache", + extensions: ["sxw"] + }, + "application/vnd.sun.xml.writer.global": { + source: "apache", + extensions: ["sxg"] + }, + "application/vnd.sun.xml.writer.template": { + source: "apache", + extensions: ["stw"] + }, + "application/vnd.sus-calendar": { + source: "iana", + extensions: ["sus", "susp"] + }, + "application/vnd.svd": { + source: "iana", + extensions: ["svd"] + }, + "application/vnd.swiftview-ics": { + source: "iana" + }, + "application/vnd.sycle+xml": { + source: "iana", + compressible: true + }, + "application/vnd.syft+json": { + source: "iana", + compressible: true + }, + "application/vnd.symbian.install": { + source: "apache", + extensions: ["sis", "sisx"] + }, + "application/vnd.syncml+xml": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["xsm"] + }, + "application/vnd.syncml.dm+wbxml": { + source: "iana", + charset: "UTF-8", + extensions: ["bdm"] + }, + "application/vnd.syncml.dm+xml": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["xdm"] + }, + "application/vnd.syncml.dm.notification": { + source: "iana" + }, + "application/vnd.syncml.dmddf+wbxml": { + source: "iana" + }, + "application/vnd.syncml.dmddf+xml": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["ddf"] + }, + "application/vnd.syncml.dmtnds+wbxml": { + source: "iana" + }, + "application/vnd.syncml.dmtnds+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.syncml.ds.notification": { + source: "iana" + }, + "application/vnd.tableschema+json": { + source: "iana", + compressible: true + }, + "application/vnd.tao.intent-module-archive": { + source: "iana", + extensions: ["tao"] + }, + "application/vnd.tcpdump.pcap": { + source: "iana", + extensions: ["pcap", "cap", "dmp"] + }, + "application/vnd.think-cell.ppttc+json": { + source: "iana", + compressible: true + }, + "application/vnd.tmd.mediaflex.api+xml": { + source: "iana", + compressible: true + }, + "application/vnd.tml": { + source: "iana" + }, + "application/vnd.tmobile-livetv": { + source: "iana", + extensions: ["tmo"] + }, + "application/vnd.tri.onesource": { + source: "iana" + }, + "application/vnd.trid.tpt": { + source: "iana", + extensions: ["tpt"] + }, + "application/vnd.triscape.mxs": { + source: "iana", + extensions: ["mxs"] + }, + "application/vnd.trueapp": { + source: "iana", + extensions: ["tra"] + }, + "application/vnd.truedoc": { + source: "iana" + }, + "application/vnd.ubisoft.webplayer": { + source: "iana" + }, + "application/vnd.ufdl": { + source: "iana", + extensions: ["ufd", "ufdl"] + }, + "application/vnd.uiq.theme": { + source: "iana", + extensions: ["utz"] + }, + "application/vnd.umajin": { + source: "iana", + extensions: ["umj"] + }, + "application/vnd.unity": { + source: "iana", + extensions: ["unityweb"] + }, + "application/vnd.uoml+xml": { + source: "iana", + compressible: true, + extensions: ["uoml"] + }, + "application/vnd.uplanet.alert": { + source: "iana" + }, + "application/vnd.uplanet.alert-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.bearer-choice": { + source: "iana" + }, + "application/vnd.uplanet.bearer-choice-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.cacheop": { + source: "iana" + }, + "application/vnd.uplanet.cacheop-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.channel": { + source: "iana" + }, + "application/vnd.uplanet.channel-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.list": { + source: "iana" + }, + "application/vnd.uplanet.list-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.listcmd": { + source: "iana" + }, + "application/vnd.uplanet.listcmd-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.signal": { + source: "iana" + }, + "application/vnd.uri-map": { + source: "iana" + }, + "application/vnd.valve.source.material": { + source: "iana" + }, + "application/vnd.vcx": { + source: "iana", + extensions: ["vcx"] + }, + "application/vnd.vd-study": { + source: "iana" + }, + "application/vnd.vectorworks": { + source: "iana" + }, + "application/vnd.vel+json": { + source: "iana", + compressible: true + }, + "application/vnd.verimatrix.vcas": { + source: "iana" + }, + "application/vnd.veritone.aion+json": { + source: "iana", + compressible: true + }, + "application/vnd.veryant.thin": { + source: "iana" + }, + "application/vnd.ves.encrypted": { + source: "iana" + }, + "application/vnd.vidsoft.vidconference": { + source: "iana" + }, + "application/vnd.visio": { + source: "iana", + extensions: ["vsd", "vst", "vss", "vsw"] + }, + "application/vnd.visionary": { + source: "iana", + extensions: ["vis"] + }, + "application/vnd.vividence.scriptfile": { + source: "iana" + }, + "application/vnd.vsf": { + source: "iana", + extensions: ["vsf"] + }, + "application/vnd.wap.sic": { + source: "iana" + }, + "application/vnd.wap.slc": { + source: "iana" + }, + "application/vnd.wap.wbxml": { + source: "iana", + charset: "UTF-8", + extensions: ["wbxml"] + }, + "application/vnd.wap.wmlc": { + source: "iana", + extensions: ["wmlc"] + }, + "application/vnd.wap.wmlscriptc": { + source: "iana", + extensions: ["wmlsc"] + }, + "application/vnd.webturbo": { + source: "iana", + extensions: ["wtb"] + }, + "application/vnd.wfa.dpp": { + source: "iana" + }, + "application/vnd.wfa.p2p": { + source: "iana" + }, + "application/vnd.wfa.wsc": { + source: "iana" + }, + "application/vnd.windows.devicepairing": { + source: "iana" + }, + "application/vnd.wmc": { + source: "iana" + }, + "application/vnd.wmf.bootstrap": { + source: "iana" + }, + "application/vnd.wolfram.mathematica": { + source: "iana" + }, + "application/vnd.wolfram.mathematica.package": { + source: "iana" + }, + "application/vnd.wolfram.player": { + source: "iana", + extensions: ["nbp"] + }, + "application/vnd.wordperfect": { + source: "iana", + extensions: ["wpd"] + }, + "application/vnd.wqd": { + source: "iana", + extensions: ["wqd"] + }, + "application/vnd.wrq-hp3000-labelled": { + source: "iana" + }, + "application/vnd.wt.stf": { + source: "iana", + extensions: ["stf"] + }, + "application/vnd.wv.csp+wbxml": { + source: "iana" + }, + "application/vnd.wv.csp+xml": { + source: "iana", + compressible: true + }, + "application/vnd.wv.ssp+xml": { + source: "iana", + compressible: true + }, + "application/vnd.xacml+json": { + source: "iana", + compressible: true + }, + "application/vnd.xara": { + source: "iana", + extensions: ["xar"] + }, + "application/vnd.xfdl": { + source: "iana", + extensions: ["xfdl"] + }, + "application/vnd.xfdl.webform": { + source: "iana" + }, + "application/vnd.xmi+xml": { + source: "iana", + compressible: true + }, + "application/vnd.xmpie.cpkg": { + source: "iana" + }, + "application/vnd.xmpie.dpkg": { + source: "iana" + }, + "application/vnd.xmpie.plan": { + source: "iana" + }, + "application/vnd.xmpie.ppkg": { + source: "iana" + }, + "application/vnd.xmpie.xlim": { + source: "iana" + }, + "application/vnd.yamaha.hv-dic": { + source: "iana", + extensions: ["hvd"] + }, + "application/vnd.yamaha.hv-script": { + source: "iana", + extensions: ["hvs"] + }, + "application/vnd.yamaha.hv-voice": { + source: "iana", + extensions: ["hvp"] + }, + "application/vnd.yamaha.openscoreformat": { + source: "iana", + extensions: ["osf"] + }, + "application/vnd.yamaha.openscoreformat.osfpvg+xml": { + source: "iana", + compressible: true, + extensions: ["osfpvg"] + }, + "application/vnd.yamaha.remote-setup": { + source: "iana" + }, + "application/vnd.yamaha.smaf-audio": { + source: "iana", + extensions: ["saf"] + }, + "application/vnd.yamaha.smaf-phrase": { + source: "iana", + extensions: ["spf"] + }, + "application/vnd.yamaha.through-ngn": { + source: "iana" + }, + "application/vnd.yamaha.tunnel-udpencap": { + source: "iana" + }, + "application/vnd.yaoweme": { + source: "iana" + }, + "application/vnd.yellowriver-custom-menu": { + source: "iana", + extensions: ["cmp"] + }, + "application/vnd.youtube.yt": { + source: "iana" + }, + "application/vnd.zul": { + source: "iana", + extensions: ["zir", "zirz"] + }, + "application/vnd.zzazz.deck+xml": { + source: "iana", + compressible: true, + extensions: ["zaz"] + }, + "application/voicexml+xml": { + source: "iana", + compressible: true, + extensions: ["vxml"] + }, + "application/voucher-cms+json": { + source: "iana", + compressible: true + }, + "application/vq-rtcpxr": { + source: "iana" + }, + "application/wasm": { + source: "iana", + compressible: true, + extensions: ["wasm"] + }, + "application/watcherinfo+xml": { + source: "iana", + compressible: true, + extensions: ["wif"] + }, + "application/webpush-options+json": { + source: "iana", + compressible: true + }, + "application/whoispp-query": { + source: "iana" + }, + "application/whoispp-response": { + source: "iana" + }, + "application/widget": { + source: "iana", + extensions: ["wgt"] + }, + "application/winhlp": { + source: "apache", + extensions: ["hlp"] + }, + "application/wita": { + source: "iana" + }, + "application/wordperfect5.1": { + source: "iana" + }, + "application/wsdl+xml": { + source: "iana", + compressible: true, + extensions: ["wsdl"] + }, + "application/wspolicy+xml": { + source: "iana", + compressible: true, + extensions: ["wspolicy"] + }, + "application/x-7z-compressed": { + source: "apache", + compressible: false, + extensions: ["7z"] + }, + "application/x-abiword": { + source: "apache", + extensions: ["abw"] + }, + "application/x-ace-compressed": { + source: "apache", + extensions: ["ace"] + }, + "application/x-amf": { + source: "apache" + }, + "application/x-apple-diskimage": { + source: "apache", + extensions: ["dmg"] + }, + "application/x-arj": { + compressible: false, + extensions: ["arj"] + }, + "application/x-authorware-bin": { + source: "apache", + extensions: ["aab", "x32", "u32", "vox"] + }, + "application/x-authorware-map": { + source: "apache", + extensions: ["aam"] + }, + "application/x-authorware-seg": { + source: "apache", + extensions: ["aas"] + }, + "application/x-bcpio": { + source: "apache", + extensions: ["bcpio"] + }, + "application/x-bdoc": { + compressible: false, + extensions: ["bdoc"] + }, + "application/x-bittorrent": { + source: "apache", + extensions: ["torrent"] + }, + "application/x-blorb": { + source: "apache", + extensions: ["blb", "blorb"] + }, + "application/x-bzip": { + source: "apache", + compressible: false, + extensions: ["bz"] + }, + "application/x-bzip2": { + source: "apache", + compressible: false, + extensions: ["bz2", "boz"] + }, + "application/x-cbr": { + source: "apache", + extensions: ["cbr", "cba", "cbt", "cbz", "cb7"] + }, + "application/x-cdlink": { + source: "apache", + extensions: ["vcd"] + }, + "application/x-cfs-compressed": { + source: "apache", + extensions: ["cfs"] + }, + "application/x-chat": { + source: "apache", + extensions: ["chat"] + }, + "application/x-chess-pgn": { + source: "apache", + extensions: ["pgn"] + }, + "application/x-chrome-extension": { + extensions: ["crx"] + }, + "application/x-cocoa": { + source: "nginx", + extensions: ["cco"] + }, + "application/x-compress": { + source: "apache" + }, + "application/x-conference": { + source: "apache", + extensions: ["nsc"] + }, + "application/x-cpio": { + source: "apache", + extensions: ["cpio"] + }, + "application/x-csh": { + source: "apache", + extensions: ["csh"] + }, + "application/x-deb": { + compressible: false + }, + "application/x-debian-package": { + source: "apache", + extensions: ["deb", "udeb"] + }, + "application/x-dgc-compressed": { + source: "apache", + extensions: ["dgc"] + }, + "application/x-director": { + source: "apache", + extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"] + }, + "application/x-doom": { + source: "apache", + extensions: ["wad"] + }, + "application/x-dtbncx+xml": { + source: "apache", + compressible: true, + extensions: ["ncx"] + }, + "application/x-dtbook+xml": { + source: "apache", + compressible: true, + extensions: ["dtb"] + }, + "application/x-dtbresource+xml": { + source: "apache", + compressible: true, + extensions: ["res"] + }, + "application/x-dvi": { + source: "apache", + compressible: false, + extensions: ["dvi"] + }, + "application/x-envoy": { + source: "apache", + extensions: ["evy"] + }, + "application/x-eva": { + source: "apache", + extensions: ["eva"] + }, + "application/x-font-bdf": { + source: "apache", + extensions: ["bdf"] + }, + "application/x-font-dos": { + source: "apache" + }, + "application/x-font-framemaker": { + source: "apache" + }, + "application/x-font-ghostscript": { + source: "apache", + extensions: ["gsf"] + }, + "application/x-font-libgrx": { + source: "apache" + }, + "application/x-font-linux-psf": { + source: "apache", + extensions: ["psf"] + }, + "application/x-font-pcf": { + source: "apache", + extensions: ["pcf"] + }, + "application/x-font-snf": { + source: "apache", + extensions: ["snf"] + }, + "application/x-font-speedo": { + source: "apache" + }, + "application/x-font-sunos-news": { + source: "apache" + }, + "application/x-font-type1": { + source: "apache", + extensions: ["pfa", "pfb", "pfm", "afm"] + }, + "application/x-font-vfont": { + source: "apache" + }, + "application/x-freearc": { + source: "apache", + extensions: ["arc"] + }, + "application/x-futuresplash": { + source: "apache", + extensions: ["spl"] + }, + "application/x-gca-compressed": { + source: "apache", + extensions: ["gca"] + }, + "application/x-glulx": { + source: "apache", + extensions: ["ulx"] + }, + "application/x-gnumeric": { + source: "apache", + extensions: ["gnumeric"] + }, + "application/x-gramps-xml": { + source: "apache", + extensions: ["gramps"] + }, + "application/x-gtar": { + source: "apache", + extensions: ["gtar"] + }, + "application/x-gzip": { + source: "apache" + }, + "application/x-hdf": { + source: "apache", + extensions: ["hdf"] + }, + "application/x-httpd-php": { + compressible: true, + extensions: ["php"] + }, + "application/x-install-instructions": { + source: "apache", + extensions: ["install"] + }, + "application/x-iso9660-image": { + source: "apache", + extensions: ["iso"] + }, + "application/x-iwork-keynote-sffkey": { + extensions: ["key"] + }, + "application/x-iwork-numbers-sffnumbers": { + extensions: ["numbers"] + }, + "application/x-iwork-pages-sffpages": { + extensions: ["pages"] + }, + "application/x-java-archive-diff": { + source: "nginx", + extensions: ["jardiff"] + }, + "application/x-java-jnlp-file": { + source: "apache", + compressible: false, + extensions: ["jnlp"] + }, + "application/x-javascript": { + compressible: true + }, + "application/x-keepass2": { + extensions: ["kdbx"] + }, + "application/x-latex": { + source: "apache", + compressible: false, + extensions: ["latex"] + }, + "application/x-lua-bytecode": { + extensions: ["luac"] + }, + "application/x-lzh-compressed": { + source: "apache", + extensions: ["lzh", "lha"] + }, + "application/x-makeself": { + source: "nginx", + extensions: ["run"] + }, + "application/x-mie": { + source: "apache", + extensions: ["mie"] + }, + "application/x-mobipocket-ebook": { + source: "apache", + extensions: ["prc", "mobi"] + }, + "application/x-mpegurl": { + compressible: false + }, + "application/x-ms-application": { + source: "apache", + extensions: ["application"] + }, + "application/x-ms-shortcut": { + source: "apache", + extensions: ["lnk"] + }, + "application/x-ms-wmd": { + source: "apache", + extensions: ["wmd"] + }, + "application/x-ms-wmz": { + source: "apache", + extensions: ["wmz"] + }, + "application/x-ms-xbap": { + source: "apache", + extensions: ["xbap"] + }, + "application/x-msaccess": { + source: "apache", + extensions: ["mdb"] + }, + "application/x-msbinder": { + source: "apache", + extensions: ["obd"] + }, + "application/x-mscardfile": { + source: "apache", + extensions: ["crd"] + }, + "application/x-msclip": { + source: "apache", + extensions: ["clp"] + }, + "application/x-msdos-program": { + extensions: ["exe"] + }, + "application/x-msdownload": { + source: "apache", + extensions: ["exe", "dll", "com", "bat", "msi"] + }, + "application/x-msmediaview": { + source: "apache", + extensions: ["mvb", "m13", "m14"] + }, + "application/x-msmetafile": { + source: "apache", + extensions: ["wmf", "wmz", "emf", "emz"] + }, + "application/x-msmoney": { + source: "apache", + extensions: ["mny"] + }, + "application/x-mspublisher": { + source: "apache", + extensions: ["pub"] + }, + "application/x-msschedule": { + source: "apache", + extensions: ["scd"] + }, + "application/x-msterminal": { + source: "apache", + extensions: ["trm"] + }, + "application/x-mswrite": { + source: "apache", + extensions: ["wri"] + }, + "application/x-netcdf": { + source: "apache", + extensions: ["nc", "cdf"] + }, + "application/x-ns-proxy-autoconfig": { + compressible: true, + extensions: ["pac"] + }, + "application/x-nzb": { + source: "apache", + extensions: ["nzb"] + }, + "application/x-perl": { + source: "nginx", + extensions: ["pl", "pm"] + }, + "application/x-pilot": { + source: "nginx", + extensions: ["prc", "pdb"] + }, + "application/x-pkcs12": { + source: "apache", + compressible: false, + extensions: ["p12", "pfx"] + }, + "application/x-pkcs7-certificates": { + source: "apache", + extensions: ["p7b", "spc"] + }, + "application/x-pkcs7-certreqresp": { + source: "apache", + extensions: ["p7r"] + }, + "application/x-pki-message": { + source: "iana" + }, + "application/x-rar-compressed": { + source: "apache", + compressible: false, + extensions: ["rar"] + }, + "application/x-redhat-package-manager": { + source: "nginx", + extensions: ["rpm"] + }, + "application/x-research-info-systems": { + source: "apache", + extensions: ["ris"] + }, + "application/x-sea": { + source: "nginx", + extensions: ["sea"] + }, + "application/x-sh": { + source: "apache", + compressible: true, + extensions: ["sh"] + }, + "application/x-shar": { + source: "apache", + extensions: ["shar"] + }, + "application/x-shockwave-flash": { + source: "apache", + compressible: false, + extensions: ["swf"] + }, + "application/x-silverlight-app": { + source: "apache", + extensions: ["xap"] + }, + "application/x-sql": { + source: "apache", + extensions: ["sql"] + }, + "application/x-stuffit": { + source: "apache", + compressible: false, + extensions: ["sit"] + }, + "application/x-stuffitx": { + source: "apache", + extensions: ["sitx"] + }, + "application/x-subrip": { + source: "apache", + extensions: ["srt"] + }, + "application/x-sv4cpio": { + source: "apache", + extensions: ["sv4cpio"] + }, + "application/x-sv4crc": { + source: "apache", + extensions: ["sv4crc"] + }, + "application/x-t3vm-image": { + source: "apache", + extensions: ["t3"] + }, + "application/x-tads": { + source: "apache", + extensions: ["gam"] + }, + "application/x-tar": { + source: "apache", + compressible: true, + extensions: ["tar"] + }, + "application/x-tcl": { + source: "apache", + extensions: ["tcl", "tk"] + }, + "application/x-tex": { + source: "apache", + extensions: ["tex"] + }, + "application/x-tex-tfm": { + source: "apache", + extensions: ["tfm"] + }, + "application/x-texinfo": { + source: "apache", + extensions: ["texinfo", "texi"] + }, + "application/x-tgif": { + source: "apache", + extensions: ["obj"] + }, + "application/x-ustar": { + source: "apache", + extensions: ["ustar"] + }, + "application/x-virtualbox-hdd": { + compressible: true, + extensions: ["hdd"] + }, + "application/x-virtualbox-ova": { + compressible: true, + extensions: ["ova"] + }, + "application/x-virtualbox-ovf": { + compressible: true, + extensions: ["ovf"] + }, + "application/x-virtualbox-vbox": { + compressible: true, + extensions: ["vbox"] + }, + "application/x-virtualbox-vbox-extpack": { + compressible: false, + extensions: ["vbox-extpack"] + }, + "application/x-virtualbox-vdi": { + compressible: true, + extensions: ["vdi"] + }, + "application/x-virtualbox-vhd": { + compressible: true, + extensions: ["vhd"] + }, + "application/x-virtualbox-vmdk": { + compressible: true, + extensions: ["vmdk"] + }, + "application/x-wais-source": { + source: "apache", + extensions: ["src"] + }, + "application/x-web-app-manifest+json": { + compressible: true, + extensions: ["webapp"] + }, + "application/x-www-form-urlencoded": { + source: "iana", + compressible: true + }, + "application/x-x509-ca-cert": { + source: "iana", + extensions: ["der", "crt", "pem"] + }, + "application/x-x509-ca-ra-cert": { + source: "iana" + }, + "application/x-x509-next-ca-cert": { + source: "iana" + }, + "application/x-xfig": { + source: "apache", + extensions: ["fig"] + }, + "application/x-xliff+xml": { + source: "apache", + compressible: true, + extensions: ["xlf"] + }, + "application/x-xpinstall": { + source: "apache", + compressible: false, + extensions: ["xpi"] + }, + "application/x-xz": { + source: "apache", + extensions: ["xz"] + }, + "application/x-zmachine": { + source: "apache", + extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"] + }, + "application/x400-bp": { + source: "iana" + }, + "application/xacml+xml": { + source: "iana", + compressible: true + }, + "application/xaml+xml": { + source: "apache", + compressible: true, + extensions: ["xaml"] + }, + "application/xcap-att+xml": { + source: "iana", + compressible: true, + extensions: ["xav"] + }, + "application/xcap-caps+xml": { + source: "iana", + compressible: true, + extensions: ["xca"] + }, + "application/xcap-diff+xml": { + source: "iana", + compressible: true, + extensions: ["xdf"] + }, + "application/xcap-el+xml": { + source: "iana", + compressible: true, + extensions: ["xel"] + }, + "application/xcap-error+xml": { + source: "iana", + compressible: true + }, + "application/xcap-ns+xml": { + source: "iana", + compressible: true, + extensions: ["xns"] + }, + "application/xcon-conference-info+xml": { + source: "iana", + compressible: true + }, + "application/xcon-conference-info-diff+xml": { + source: "iana", + compressible: true + }, + "application/xenc+xml": { + source: "iana", + compressible: true, + extensions: ["xenc"] + }, + "application/xhtml+xml": { + source: "iana", + compressible: true, + extensions: ["xhtml", "xht"] + }, + "application/xhtml-voice+xml": { + source: "apache", + compressible: true + }, + "application/xliff+xml": { + source: "iana", + compressible: true, + extensions: ["xlf"] + }, + "application/xml": { + source: "iana", + compressible: true, + extensions: ["xml", "xsl", "xsd", "rng"] + }, + "application/xml-dtd": { + source: "iana", + compressible: true, + extensions: ["dtd"] + }, + "application/xml-external-parsed-entity": { + source: "iana" + }, + "application/xml-patch+xml": { + source: "iana", + compressible: true + }, + "application/xmpp+xml": { + source: "iana", + compressible: true + }, + "application/xop+xml": { + source: "iana", + compressible: true, + extensions: ["xop"] + }, + "application/xproc+xml": { + source: "apache", + compressible: true, + extensions: ["xpl"] + }, + "application/xslt+xml": { + source: "iana", + compressible: true, + extensions: ["xsl", "xslt"] + }, + "application/xspf+xml": { + source: "apache", + compressible: true, + extensions: ["xspf"] + }, + "application/xv+xml": { + source: "iana", + compressible: true, + extensions: ["mxml", "xhvml", "xvml", "xvm"] + }, + "application/yang": { + source: "iana", + extensions: ["yang"] + }, + "application/yang-data+json": { + source: "iana", + compressible: true + }, + "application/yang-data+xml": { + source: "iana", + compressible: true + }, + "application/yang-patch+json": { + source: "iana", + compressible: true + }, + "application/yang-patch+xml": { + source: "iana", + compressible: true + }, + "application/yin+xml": { + source: "iana", + compressible: true, + extensions: ["yin"] + }, + "application/zip": { + source: "iana", + compressible: false, + extensions: ["zip"] + }, + "application/zlib": { + source: "iana" + }, + "application/zstd": { + source: "iana" + }, + "audio/1d-interleaved-parityfec": { + source: "iana" + }, + "audio/32kadpcm": { + source: "iana" + }, + "audio/3gpp": { + source: "iana", + compressible: false, + extensions: ["3gpp"] + }, + "audio/3gpp2": { + source: "iana" + }, + "audio/aac": { + source: "iana" + }, + "audio/ac3": { + source: "iana" + }, + "audio/adpcm": { + source: "apache", + extensions: ["adp"] + }, + "audio/amr": { + source: "iana", + extensions: ["amr"] + }, + "audio/amr-wb": { + source: "iana" + }, + "audio/amr-wb+": { + source: "iana" + }, + "audio/aptx": { + source: "iana" + }, + "audio/asc": { + source: "iana" + }, + "audio/atrac-advanced-lossless": { + source: "iana" + }, + "audio/atrac-x": { + source: "iana" + }, + "audio/atrac3": { + source: "iana" + }, + "audio/basic": { + source: "iana", + compressible: false, + extensions: ["au", "snd"] + }, + "audio/bv16": { + source: "iana" + }, + "audio/bv32": { + source: "iana" + }, + "audio/clearmode": { + source: "iana" + }, + "audio/cn": { + source: "iana" + }, + "audio/dat12": { + source: "iana" + }, + "audio/dls": { + source: "iana" + }, + "audio/dsr-es201108": { + source: "iana" + }, + "audio/dsr-es202050": { + source: "iana" + }, + "audio/dsr-es202211": { + source: "iana" + }, + "audio/dsr-es202212": { + source: "iana" + }, + "audio/dv": { + source: "iana" + }, + "audio/dvi4": { + source: "iana" + }, + "audio/eac3": { + source: "iana" + }, + "audio/encaprtp": { + source: "iana" + }, + "audio/evrc": { + source: "iana" + }, + "audio/evrc-qcp": { + source: "iana" + }, + "audio/evrc0": { + source: "iana" + }, + "audio/evrc1": { + source: "iana" + }, + "audio/evrcb": { + source: "iana" + }, + "audio/evrcb0": { + source: "iana" + }, + "audio/evrcb1": { + source: "iana" + }, + "audio/evrcnw": { + source: "iana" + }, + "audio/evrcnw0": { + source: "iana" + }, + "audio/evrcnw1": { + source: "iana" + }, + "audio/evrcwb": { + source: "iana" + }, + "audio/evrcwb0": { + source: "iana" + }, + "audio/evrcwb1": { + source: "iana" + }, + "audio/evs": { + source: "iana" + }, + "audio/flexfec": { + source: "iana" + }, + "audio/fwdred": { + source: "iana" + }, + "audio/g711-0": { + source: "iana" + }, + "audio/g719": { + source: "iana" + }, + "audio/g722": { + source: "iana" + }, + "audio/g7221": { + source: "iana" + }, + "audio/g723": { + source: "iana" + }, + "audio/g726-16": { + source: "iana" + }, + "audio/g726-24": { + source: "iana" + }, + "audio/g726-32": { + source: "iana" + }, + "audio/g726-40": { + source: "iana" + }, + "audio/g728": { + source: "iana" + }, + "audio/g729": { + source: "iana" + }, + "audio/g7291": { + source: "iana" + }, + "audio/g729d": { + source: "iana" + }, + "audio/g729e": { + source: "iana" + }, + "audio/gsm": { + source: "iana" + }, + "audio/gsm-efr": { + source: "iana" + }, + "audio/gsm-hr-08": { + source: "iana" + }, + "audio/ilbc": { + source: "iana" + }, + "audio/ip-mr_v2.5": { + source: "iana" + }, + "audio/isac": { + source: "apache" + }, + "audio/l16": { + source: "iana" + }, + "audio/l20": { + source: "iana" + }, + "audio/l24": { + source: "iana", + compressible: false + }, + "audio/l8": { + source: "iana" + }, + "audio/lpc": { + source: "iana" + }, + "audio/melp": { + source: "iana" + }, + "audio/melp1200": { + source: "iana" + }, + "audio/melp2400": { + source: "iana" + }, + "audio/melp600": { + source: "iana" + }, + "audio/mhas": { + source: "iana" + }, + "audio/midi": { + source: "apache", + extensions: ["mid", "midi", "kar", "rmi"] + }, + "audio/mobile-xmf": { + source: "iana", + extensions: ["mxmf"] + }, + "audio/mp3": { + compressible: false, + extensions: ["mp3"] + }, + "audio/mp4": { + source: "iana", + compressible: false, + extensions: ["m4a", "mp4a"] + }, + "audio/mp4a-latm": { + source: "iana" + }, + "audio/mpa": { + source: "iana" + }, + "audio/mpa-robust": { + source: "iana" + }, + "audio/mpeg": { + source: "iana", + compressible: false, + extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"] + }, + "audio/mpeg4-generic": { + source: "iana" + }, + "audio/musepack": { + source: "apache" + }, + "audio/ogg": { + source: "iana", + compressible: false, + extensions: ["oga", "ogg", "spx", "opus"] + }, + "audio/opus": { + source: "iana" + }, + "audio/parityfec": { + source: "iana" + }, + "audio/pcma": { + source: "iana" + }, + "audio/pcma-wb": { + source: "iana" + }, + "audio/pcmu": { + source: "iana" + }, + "audio/pcmu-wb": { + source: "iana" + }, + "audio/prs.sid": { + source: "iana" + }, + "audio/qcelp": { + source: "iana" + }, + "audio/raptorfec": { + source: "iana" + }, + "audio/red": { + source: "iana" + }, + "audio/rtp-enc-aescm128": { + source: "iana" + }, + "audio/rtp-midi": { + source: "iana" + }, + "audio/rtploopback": { + source: "iana" + }, + "audio/rtx": { + source: "iana" + }, + "audio/s3m": { + source: "apache", + extensions: ["s3m"] + }, + "audio/scip": { + source: "iana" + }, + "audio/silk": { + source: "apache", + extensions: ["sil"] + }, + "audio/smv": { + source: "iana" + }, + "audio/smv-qcp": { + source: "iana" + }, + "audio/smv0": { + source: "iana" + }, + "audio/sofa": { + source: "iana" + }, + "audio/sp-midi": { + source: "iana" + }, + "audio/speex": { + source: "iana" + }, + "audio/t140c": { + source: "iana" + }, + "audio/t38": { + source: "iana" + }, + "audio/telephone-event": { + source: "iana" + }, + "audio/tetra_acelp": { + source: "iana" + }, + "audio/tetra_acelp_bb": { + source: "iana" + }, + "audio/tone": { + source: "iana" + }, + "audio/tsvcis": { + source: "iana" + }, + "audio/uemclip": { + source: "iana" + }, + "audio/ulpfec": { + source: "iana" + }, + "audio/usac": { + source: "iana" + }, + "audio/vdvi": { + source: "iana" + }, + "audio/vmr-wb": { + source: "iana" + }, + "audio/vnd.3gpp.iufp": { + source: "iana" + }, + "audio/vnd.4sb": { + source: "iana" + }, + "audio/vnd.audiokoz": { + source: "iana" + }, + "audio/vnd.celp": { + source: "iana" + }, + "audio/vnd.cisco.nse": { + source: "iana" + }, + "audio/vnd.cmles.radio-events": { + source: "iana" + }, + "audio/vnd.cns.anp1": { + source: "iana" + }, + "audio/vnd.cns.inf1": { + source: "iana" + }, + "audio/vnd.dece.audio": { + source: "iana", + extensions: ["uva", "uvva"] + }, + "audio/vnd.digital-winds": { + source: "iana", + extensions: ["eol"] + }, + "audio/vnd.dlna.adts": { + source: "iana" + }, + "audio/vnd.dolby.heaac.1": { + source: "iana" + }, + "audio/vnd.dolby.heaac.2": { + source: "iana" + }, + "audio/vnd.dolby.mlp": { + source: "iana" + }, + "audio/vnd.dolby.mps": { + source: "iana" + }, + "audio/vnd.dolby.pl2": { + source: "iana" + }, + "audio/vnd.dolby.pl2x": { + source: "iana" + }, + "audio/vnd.dolby.pl2z": { + source: "iana" + }, + "audio/vnd.dolby.pulse.1": { + source: "iana" + }, + "audio/vnd.dra": { + source: "iana", + extensions: ["dra"] + }, + "audio/vnd.dts": { + source: "iana", + extensions: ["dts"] + }, + "audio/vnd.dts.hd": { + source: "iana", + extensions: ["dtshd"] + }, + "audio/vnd.dts.uhd": { + source: "iana" + }, + "audio/vnd.dvb.file": { + source: "iana" + }, + "audio/vnd.everad.plj": { + source: "iana" + }, + "audio/vnd.hns.audio": { + source: "iana" + }, + "audio/vnd.lucent.voice": { + source: "iana", + extensions: ["lvp"] + }, + "audio/vnd.ms-playready.media.pya": { + source: "iana", + extensions: ["pya"] + }, + "audio/vnd.nokia.mobile-xmf": { + source: "iana" + }, + "audio/vnd.nortel.vbk": { + source: "iana" + }, + "audio/vnd.nuera.ecelp4800": { + source: "iana", + extensions: ["ecelp4800"] + }, + "audio/vnd.nuera.ecelp7470": { + source: "iana", + extensions: ["ecelp7470"] + }, + "audio/vnd.nuera.ecelp9600": { + source: "iana", + extensions: ["ecelp9600"] + }, + "audio/vnd.octel.sbc": { + source: "iana" + }, + "audio/vnd.presonus.multitrack": { + source: "iana" + }, + "audio/vnd.qcelp": { + source: "iana" + }, + "audio/vnd.rhetorex.32kadpcm": { + source: "iana" + }, + "audio/vnd.rip": { + source: "iana", + extensions: ["rip"] + }, + "audio/vnd.rn-realaudio": { + compressible: false + }, + "audio/vnd.sealedmedia.softseal.mpeg": { + source: "iana" + }, + "audio/vnd.vmx.cvsd": { + source: "iana" + }, + "audio/vnd.wave": { + compressible: false + }, + "audio/vorbis": { + source: "iana", + compressible: false + }, + "audio/vorbis-config": { + source: "iana" + }, + "audio/wav": { + compressible: false, + extensions: ["wav"] + }, + "audio/wave": { + compressible: false, + extensions: ["wav"] + }, + "audio/webm": { + source: "apache", + compressible: false, + extensions: ["weba"] + }, + "audio/x-aac": { + source: "apache", + compressible: false, + extensions: ["aac"] + }, + "audio/x-aiff": { + source: "apache", + extensions: ["aif", "aiff", "aifc"] + }, + "audio/x-caf": { + source: "apache", + compressible: false, + extensions: ["caf"] + }, + "audio/x-flac": { + source: "apache", + extensions: ["flac"] + }, + "audio/x-m4a": { + source: "nginx", + extensions: ["m4a"] + }, + "audio/x-matroska": { + source: "apache", + extensions: ["mka"] + }, + "audio/x-mpegurl": { + source: "apache", + extensions: ["m3u"] + }, + "audio/x-ms-wax": { + source: "apache", + extensions: ["wax"] + }, + "audio/x-ms-wma": { + source: "apache", + extensions: ["wma"] + }, + "audio/x-pn-realaudio": { + source: "apache", + extensions: ["ram", "ra"] + }, + "audio/x-pn-realaudio-plugin": { + source: "apache", + extensions: ["rmp"] + }, + "audio/x-realaudio": { + source: "nginx", + extensions: ["ra"] + }, + "audio/x-tta": { + source: "apache" + }, + "audio/x-wav": { + source: "apache", + extensions: ["wav"] + }, + "audio/xm": { + source: "apache", + extensions: ["xm"] + }, + "chemical/x-cdx": { + source: "apache", + extensions: ["cdx"] + }, + "chemical/x-cif": { + source: "apache", + extensions: ["cif"] + }, + "chemical/x-cmdf": { + source: "apache", + extensions: ["cmdf"] + }, + "chemical/x-cml": { + source: "apache", + extensions: ["cml"] + }, + "chemical/x-csml": { + source: "apache", + extensions: ["csml"] + }, + "chemical/x-pdb": { + source: "apache" + }, + "chemical/x-xyz": { + source: "apache", + extensions: ["xyz"] + }, + "font/collection": { + source: "iana", + extensions: ["ttc"] + }, + "font/otf": { + source: "iana", + compressible: true, + extensions: ["otf"] + }, + "font/sfnt": { + source: "iana" + }, + "font/ttf": { + source: "iana", + compressible: true, + extensions: ["ttf"] + }, + "font/woff": { + source: "iana", + extensions: ["woff"] + }, + "font/woff2": { + source: "iana", + extensions: ["woff2"] + }, + "image/aces": { + source: "iana", + extensions: ["exr"] + }, + "image/apng": { + compressible: false, + extensions: ["apng"] + }, + "image/avci": { + source: "iana", + extensions: ["avci"] + }, + "image/avcs": { + source: "iana", + extensions: ["avcs"] + }, + "image/avif": { + source: "iana", + compressible: false, + extensions: ["avif"] + }, + "image/bmp": { + source: "iana", + compressible: true, + extensions: ["bmp"] + }, + "image/cgm": { + source: "iana", + extensions: ["cgm"] + }, + "image/dicom-rle": { + source: "iana", + extensions: ["drle"] + }, + "image/emf": { + source: "iana", + extensions: ["emf"] + }, + "image/fits": { + source: "iana", + extensions: ["fits"] + }, + "image/g3fax": { + source: "iana", + extensions: ["g3"] + }, + "image/gif": { + source: "iana", + compressible: false, + extensions: ["gif"] + }, + "image/heic": { + source: "iana", + extensions: ["heic"] + }, + "image/heic-sequence": { + source: "iana", + extensions: ["heics"] + }, + "image/heif": { + source: "iana", + extensions: ["heif"] + }, + "image/heif-sequence": { + source: "iana", + extensions: ["heifs"] + }, + "image/hej2k": { + source: "iana", + extensions: ["hej2"] + }, + "image/hsj2": { + source: "iana", + extensions: ["hsj2"] + }, + "image/ief": { + source: "iana", + extensions: ["ief"] + }, + "image/jls": { + source: "iana", + extensions: ["jls"] + }, + "image/jp2": { + source: "iana", + compressible: false, + extensions: ["jp2", "jpg2"] + }, + "image/jpeg": { + source: "iana", + compressible: false, + extensions: ["jpeg", "jpg", "jpe"] + }, + "image/jph": { + source: "iana", + extensions: ["jph"] + }, + "image/jphc": { + source: "iana", + extensions: ["jhc"] + }, + "image/jpm": { + source: "iana", + compressible: false, + extensions: ["jpm"] + }, + "image/jpx": { + source: "iana", + compressible: false, + extensions: ["jpx", "jpf"] + }, + "image/jxr": { + source: "iana", + extensions: ["jxr"] + }, + "image/jxra": { + source: "iana", + extensions: ["jxra"] + }, + "image/jxrs": { + source: "iana", + extensions: ["jxrs"] + }, + "image/jxs": { + source: "iana", + extensions: ["jxs"] + }, + "image/jxsc": { + source: "iana", + extensions: ["jxsc"] + }, + "image/jxsi": { + source: "iana", + extensions: ["jxsi"] + }, + "image/jxss": { + source: "iana", + extensions: ["jxss"] + }, + "image/ktx": { + source: "iana", + extensions: ["ktx"] + }, + "image/ktx2": { + source: "iana", + extensions: ["ktx2"] + }, + "image/naplps": { + source: "iana" + }, + "image/pjpeg": { + compressible: false + }, + "image/png": { + source: "iana", + compressible: false, + extensions: ["png"] + }, + "image/prs.btif": { + source: "iana", + extensions: ["btif"] + }, + "image/prs.pti": { + source: "iana", + extensions: ["pti"] + }, + "image/pwg-raster": { + source: "iana" + }, + "image/sgi": { + source: "apache", + extensions: ["sgi"] + }, + "image/svg+xml": { + source: "iana", + compressible: true, + extensions: ["svg", "svgz"] + }, + "image/t38": { + source: "iana", + extensions: ["t38"] + }, + "image/tiff": { + source: "iana", + compressible: false, + extensions: ["tif", "tiff"] + }, + "image/tiff-fx": { + source: "iana", + extensions: ["tfx"] + }, + "image/vnd.adobe.photoshop": { + source: "iana", + compressible: true, + extensions: ["psd"] + }, + "image/vnd.airzip.accelerator.azv": { + source: "iana", + extensions: ["azv"] + }, + "image/vnd.cns.inf2": { + source: "iana" + }, + "image/vnd.dece.graphic": { + source: "iana", + extensions: ["uvi", "uvvi", "uvg", "uvvg"] + }, + "image/vnd.djvu": { + source: "iana", + extensions: ["djvu", "djv"] + }, + "image/vnd.dvb.subtitle": { + source: "iana", + extensions: ["sub"] + }, + "image/vnd.dwg": { + source: "iana", + extensions: ["dwg"] + }, + "image/vnd.dxf": { + source: "iana", + extensions: ["dxf"] + }, + "image/vnd.fastbidsheet": { + source: "iana", + extensions: ["fbs"] + }, + "image/vnd.fpx": { + source: "iana", + extensions: ["fpx"] + }, + "image/vnd.fst": { + source: "iana", + extensions: ["fst"] + }, + "image/vnd.fujixerox.edmics-mmr": { + source: "iana", + extensions: ["mmr"] + }, + "image/vnd.fujixerox.edmics-rlc": { + source: "iana", + extensions: ["rlc"] + }, + "image/vnd.globalgraphics.pgb": { + source: "iana" + }, + "image/vnd.microsoft.icon": { + source: "iana", + compressible: true, + extensions: ["ico"] + }, + "image/vnd.mix": { + source: "iana" + }, + "image/vnd.mozilla.apng": { + source: "iana" + }, + "image/vnd.ms-dds": { + compressible: true, + extensions: ["dds"] + }, + "image/vnd.ms-modi": { + source: "iana", + extensions: ["mdi"] + }, + "image/vnd.ms-photo": { + source: "apache", + extensions: ["wdp"] + }, + "image/vnd.net-fpx": { + source: "iana", + extensions: ["npx"] + }, + "image/vnd.pco.b16": { + source: "iana", + extensions: ["b16"] + }, + "image/vnd.radiance": { + source: "iana" + }, + "image/vnd.sealed.png": { + source: "iana" + }, + "image/vnd.sealedmedia.softseal.gif": { + source: "iana" + }, + "image/vnd.sealedmedia.softseal.jpg": { + source: "iana" + }, + "image/vnd.svf": { + source: "iana" + }, + "image/vnd.tencent.tap": { + source: "iana", + extensions: ["tap"] + }, + "image/vnd.valve.source.texture": { + source: "iana", + extensions: ["vtf"] + }, + "image/vnd.wap.wbmp": { + source: "iana", + extensions: ["wbmp"] + }, + "image/vnd.xiff": { + source: "iana", + extensions: ["xif"] + }, + "image/vnd.zbrush.pcx": { + source: "iana", + extensions: ["pcx"] + }, + "image/webp": { + source: "apache", + extensions: ["webp"] + }, + "image/wmf": { + source: "iana", + extensions: ["wmf"] + }, + "image/x-3ds": { + source: "apache", + extensions: ["3ds"] + }, + "image/x-cmu-raster": { + source: "apache", + extensions: ["ras"] + }, + "image/x-cmx": { + source: "apache", + extensions: ["cmx"] + }, + "image/x-freehand": { + source: "apache", + extensions: ["fh", "fhc", "fh4", "fh5", "fh7"] + }, + "image/x-icon": { + source: "apache", + compressible: true, + extensions: ["ico"] + }, + "image/x-jng": { + source: "nginx", + extensions: ["jng"] + }, + "image/x-mrsid-image": { + source: "apache", + extensions: ["sid"] + }, + "image/x-ms-bmp": { + source: "nginx", + compressible: true, + extensions: ["bmp"] + }, + "image/x-pcx": { + source: "apache", + extensions: ["pcx"] + }, + "image/x-pict": { + source: "apache", + extensions: ["pic", "pct"] + }, + "image/x-portable-anymap": { + source: "apache", + extensions: ["pnm"] + }, + "image/x-portable-bitmap": { + source: "apache", + extensions: ["pbm"] + }, + "image/x-portable-graymap": { + source: "apache", + extensions: ["pgm"] + }, + "image/x-portable-pixmap": { + source: "apache", + extensions: ["ppm"] + }, + "image/x-rgb": { + source: "apache", + extensions: ["rgb"] + }, + "image/x-tga": { + source: "apache", + extensions: ["tga"] + }, + "image/x-xbitmap": { + source: "apache", + extensions: ["xbm"] + }, + "image/x-xcf": { + compressible: false + }, + "image/x-xpixmap": { + source: "apache", + extensions: ["xpm"] + }, + "image/x-xwindowdump": { + source: "apache", + extensions: ["xwd"] + }, + "message/cpim": { + source: "iana" + }, + "message/delivery-status": { + source: "iana" + }, + "message/disposition-notification": { + source: "iana", + extensions: [ + "disposition-notification" + ] + }, + "message/external-body": { + source: "iana" + }, + "message/feedback-report": { + source: "iana" + }, + "message/global": { + source: "iana", + extensions: ["u8msg"] + }, + "message/global-delivery-status": { + source: "iana", + extensions: ["u8dsn"] + }, + "message/global-disposition-notification": { + source: "iana", + extensions: ["u8mdn"] + }, + "message/global-headers": { + source: "iana", + extensions: ["u8hdr"] + }, + "message/http": { + source: "iana", + compressible: false + }, + "message/imdn+xml": { + source: "iana", + compressible: true + }, + "message/news": { + source: "iana" + }, + "message/partial": { + source: "iana", + compressible: false + }, + "message/rfc822": { + source: "iana", + compressible: true, + extensions: ["eml", "mime"] + }, + "message/s-http": { + source: "iana" + }, + "message/sip": { + source: "iana" + }, + "message/sipfrag": { + source: "iana" + }, + "message/tracking-status": { + source: "iana" + }, + "message/vnd.si.simp": { + source: "iana" + }, + "message/vnd.wfa.wsc": { + source: "iana", + extensions: ["wsc"] + }, + "model/3mf": { + source: "iana", + extensions: ["3mf"] + }, + "model/e57": { + source: "iana" + }, + "model/gltf+json": { + source: "iana", + compressible: true, + extensions: ["gltf"] + }, + "model/gltf-binary": { + source: "iana", + compressible: true, + extensions: ["glb"] + }, + "model/iges": { + source: "iana", + compressible: false, + extensions: ["igs", "iges"] + }, + "model/mesh": { + source: "iana", + compressible: false, + extensions: ["msh", "mesh", "silo"] + }, + "model/mtl": { + source: "iana", + extensions: ["mtl"] + }, + "model/obj": { + source: "iana", + extensions: ["obj"] + }, + "model/step": { + source: "iana" + }, + "model/step+xml": { + source: "iana", + compressible: true, + extensions: ["stpx"] + }, + "model/step+zip": { + source: "iana", + compressible: false, + extensions: ["stpz"] + }, + "model/step-xml+zip": { + source: "iana", + compressible: false, + extensions: ["stpxz"] + }, + "model/stl": { + source: "iana", + extensions: ["stl"] + }, + "model/vnd.collada+xml": { + source: "iana", + compressible: true, + extensions: ["dae"] + }, + "model/vnd.dwf": { + source: "iana", + extensions: ["dwf"] + }, + "model/vnd.flatland.3dml": { + source: "iana" + }, + "model/vnd.gdl": { + source: "iana", + extensions: ["gdl"] + }, + "model/vnd.gs-gdl": { + source: "apache" + }, + "model/vnd.gs.gdl": { + source: "iana" + }, + "model/vnd.gtw": { + source: "iana", + extensions: ["gtw"] + }, + "model/vnd.moml+xml": { + source: "iana", + compressible: true + }, + "model/vnd.mts": { + source: "iana", + extensions: ["mts"] + }, + "model/vnd.opengex": { + source: "iana", + extensions: ["ogex"] + }, + "model/vnd.parasolid.transmit.binary": { + source: "iana", + extensions: ["x_b"] + }, + "model/vnd.parasolid.transmit.text": { + source: "iana", + extensions: ["x_t"] + }, + "model/vnd.pytha.pyox": { + source: "iana" + }, + "model/vnd.rosette.annotated-data-model": { + source: "iana" + }, + "model/vnd.sap.vds": { + source: "iana", + extensions: ["vds"] + }, + "model/vnd.usdz+zip": { + source: "iana", + compressible: false, + extensions: ["usdz"] + }, + "model/vnd.valve.source.compiled-map": { + source: "iana", + extensions: ["bsp"] + }, + "model/vnd.vtu": { + source: "iana", + extensions: ["vtu"] + }, + "model/vrml": { + source: "iana", + compressible: false, + extensions: ["wrl", "vrml"] + }, + "model/x3d+binary": { + source: "apache", + compressible: false, + extensions: ["x3db", "x3dbz"] + }, + "model/x3d+fastinfoset": { + source: "iana", + extensions: ["x3db"] + }, + "model/x3d+vrml": { + source: "apache", + compressible: false, + extensions: ["x3dv", "x3dvz"] + }, + "model/x3d+xml": { + source: "iana", + compressible: true, + extensions: ["x3d", "x3dz"] + }, + "model/x3d-vrml": { + source: "iana", + extensions: ["x3dv"] + }, + "multipart/alternative": { + source: "iana", + compressible: false + }, + "multipart/appledouble": { + source: "iana" + }, + "multipart/byteranges": { + source: "iana" + }, + "multipart/digest": { + source: "iana" + }, + "multipart/encrypted": { + source: "iana", + compressible: false + }, + "multipart/form-data": { + source: "iana", + compressible: false + }, + "multipart/header-set": { + source: "iana" + }, + "multipart/mixed": { + source: "iana" + }, + "multipart/multilingual": { + source: "iana" + }, + "multipart/parallel": { + source: "iana" + }, + "multipart/related": { + source: "iana", + compressible: false + }, + "multipart/report": { + source: "iana" + }, + "multipart/signed": { + source: "iana", + compressible: false + }, + "multipart/vnd.bint.med-plus": { + source: "iana" + }, + "multipart/voice-message": { + source: "iana" + }, + "multipart/x-mixed-replace": { + source: "iana" + }, + "text/1d-interleaved-parityfec": { + source: "iana" + }, + "text/cache-manifest": { + source: "iana", + compressible: true, + extensions: ["appcache", "manifest"] + }, + "text/calendar": { + source: "iana", + extensions: ["ics", "ifb"] + }, + "text/calender": { + compressible: true + }, + "text/cmd": { + compressible: true + }, + "text/coffeescript": { + extensions: ["coffee", "litcoffee"] + }, + "text/cql": { + source: "iana" + }, + "text/cql-expression": { + source: "iana" + }, + "text/cql-identifier": { + source: "iana" + }, + "text/css": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["css"] + }, + "text/csv": { + source: "iana", + compressible: true, + extensions: ["csv"] + }, + "text/csv-schema": { + source: "iana" + }, + "text/directory": { + source: "iana" + }, + "text/dns": { + source: "iana" + }, + "text/ecmascript": { + source: "iana" + }, + "text/encaprtp": { + source: "iana" + }, + "text/enriched": { + source: "iana" + }, + "text/fhirpath": { + source: "iana" + }, + "text/flexfec": { + source: "iana" + }, + "text/fwdred": { + source: "iana" + }, + "text/gff3": { + source: "iana" + }, + "text/grammar-ref-list": { + source: "iana" + }, + "text/html": { + source: "iana", + compressible: true, + extensions: ["html", "htm", "shtml"] + }, + "text/jade": { + extensions: ["jade"] + }, + "text/javascript": { + source: "iana", + compressible: true + }, + "text/jcr-cnd": { + source: "iana" + }, + "text/jsx": { + compressible: true, + extensions: ["jsx"] + }, + "text/less": { + compressible: true, + extensions: ["less"] + }, + "text/markdown": { + source: "iana", + compressible: true, + extensions: ["markdown", "md"] + }, + "text/mathml": { + source: "nginx", + extensions: ["mml"] + }, + "text/mdx": { + compressible: true, + extensions: ["mdx"] + }, + "text/mizar": { + source: "iana" + }, + "text/n3": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["n3"] + }, + "text/parameters": { + source: "iana", + charset: "UTF-8" + }, + "text/parityfec": { + source: "iana" + }, + "text/plain": { + source: "iana", + compressible: true, + extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"] + }, + "text/provenance-notation": { + source: "iana", + charset: "UTF-8" + }, + "text/prs.fallenstein.rst": { + source: "iana" + }, + "text/prs.lines.tag": { + source: "iana", + extensions: ["dsc"] + }, + "text/prs.prop.logic": { + source: "iana" + }, + "text/raptorfec": { + source: "iana" + }, + "text/red": { + source: "iana" + }, + "text/rfc822-headers": { + source: "iana" + }, + "text/richtext": { + source: "iana", + compressible: true, + extensions: ["rtx"] + }, + "text/rtf": { + source: "iana", + compressible: true, + extensions: ["rtf"] + }, + "text/rtp-enc-aescm128": { + source: "iana" + }, + "text/rtploopback": { + source: "iana" + }, + "text/rtx": { + source: "iana" + }, + "text/sgml": { + source: "iana", + extensions: ["sgml", "sgm"] + }, + "text/shaclc": { + source: "iana" + }, + "text/shex": { + source: "iana", + extensions: ["shex"] + }, + "text/slim": { + extensions: ["slim", "slm"] + }, + "text/spdx": { + source: "iana", + extensions: ["spdx"] + }, + "text/strings": { + source: "iana" + }, + "text/stylus": { + extensions: ["stylus", "styl"] + }, + "text/t140": { + source: "iana" + }, + "text/tab-separated-values": { + source: "iana", + compressible: true, + extensions: ["tsv"] + }, + "text/troff": { + source: "iana", + extensions: ["t", "tr", "roff", "man", "me", "ms"] + }, + "text/turtle": { + source: "iana", + charset: "UTF-8", + extensions: ["ttl"] + }, + "text/ulpfec": { + source: "iana" + }, + "text/uri-list": { + source: "iana", + compressible: true, + extensions: ["uri", "uris", "urls"] + }, + "text/vcard": { + source: "iana", + compressible: true, + extensions: ["vcard"] + }, + "text/vnd.a": { + source: "iana" + }, + "text/vnd.abc": { + source: "iana" + }, + "text/vnd.ascii-art": { + source: "iana" + }, + "text/vnd.curl": { + source: "iana", + extensions: ["curl"] + }, + "text/vnd.curl.dcurl": { + source: "apache", + extensions: ["dcurl"] + }, + "text/vnd.curl.mcurl": { + source: "apache", + extensions: ["mcurl"] + }, + "text/vnd.curl.scurl": { + source: "apache", + extensions: ["scurl"] + }, + "text/vnd.debian.copyright": { + source: "iana", + charset: "UTF-8" + }, + "text/vnd.dmclientscript": { + source: "iana" + }, + "text/vnd.dvb.subtitle": { + source: "iana", + extensions: ["sub"] + }, + "text/vnd.esmertec.theme-descriptor": { + source: "iana", + charset: "UTF-8" + }, + "text/vnd.familysearch.gedcom": { + source: "iana", + extensions: ["ged"] + }, + "text/vnd.ficlab.flt": { + source: "iana" + }, + "text/vnd.fly": { + source: "iana", + extensions: ["fly"] + }, + "text/vnd.fmi.flexstor": { + source: "iana", + extensions: ["flx"] + }, + "text/vnd.gml": { + source: "iana" + }, + "text/vnd.graphviz": { + source: "iana", + extensions: ["gv"] + }, + "text/vnd.hans": { + source: "iana" + }, + "text/vnd.hgl": { + source: "iana" + }, + "text/vnd.in3d.3dml": { + source: "iana", + extensions: ["3dml"] + }, + "text/vnd.in3d.spot": { + source: "iana", + extensions: ["spot"] + }, + "text/vnd.iptc.newsml": { + source: "iana" + }, + "text/vnd.iptc.nitf": { + source: "iana" + }, + "text/vnd.latex-z": { + source: "iana" + }, + "text/vnd.motorola.reflex": { + source: "iana" + }, + "text/vnd.ms-mediapackage": { + source: "iana" + }, + "text/vnd.net2phone.commcenter.command": { + source: "iana" + }, + "text/vnd.radisys.msml-basic-layout": { + source: "iana" + }, + "text/vnd.senx.warpscript": { + source: "iana" + }, + "text/vnd.si.uricatalogue": { + source: "iana" + }, + "text/vnd.sosi": { + source: "iana" + }, + "text/vnd.sun.j2me.app-descriptor": { + source: "iana", + charset: "UTF-8", + extensions: ["jad"] + }, + "text/vnd.trolltech.linguist": { + source: "iana", + charset: "UTF-8" + }, + "text/vnd.wap.si": { + source: "iana" + }, + "text/vnd.wap.sl": { + source: "iana" + }, + "text/vnd.wap.wml": { + source: "iana", + extensions: ["wml"] + }, + "text/vnd.wap.wmlscript": { + source: "iana", + extensions: ["wmls"] + }, + "text/vtt": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["vtt"] + }, + "text/x-asm": { + source: "apache", + extensions: ["s", "asm"] + }, + "text/x-c": { + source: "apache", + extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"] + }, + "text/x-component": { + source: "nginx", + extensions: ["htc"] + }, + "text/x-fortran": { + source: "apache", + extensions: ["f", "for", "f77", "f90"] + }, + "text/x-gwt-rpc": { + compressible: true + }, + "text/x-handlebars-template": { + extensions: ["hbs"] + }, + "text/x-java-source": { + source: "apache", + extensions: ["java"] + }, + "text/x-jquery-tmpl": { + compressible: true + }, + "text/x-lua": { + extensions: ["lua"] + }, + "text/x-markdown": { + compressible: true, + extensions: ["mkd"] + }, + "text/x-nfo": { + source: "apache", + extensions: ["nfo"] + }, + "text/x-opml": { + source: "apache", + extensions: ["opml"] + }, + "text/x-org": { + compressible: true, + extensions: ["org"] + }, + "text/x-pascal": { + source: "apache", + extensions: ["p", "pas"] + }, + "text/x-processing": { + compressible: true, + extensions: ["pde"] + }, + "text/x-sass": { + extensions: ["sass"] + }, + "text/x-scss": { + extensions: ["scss"] + }, + "text/x-setext": { + source: "apache", + extensions: ["etx"] + }, + "text/x-sfv": { + source: "apache", + extensions: ["sfv"] + }, + "text/x-suse-ymp": { + compressible: true, + extensions: ["ymp"] + }, + "text/x-uuencode": { + source: "apache", + extensions: ["uu"] + }, + "text/x-vcalendar": { + source: "apache", + extensions: ["vcs"] + }, + "text/x-vcard": { + source: "apache", + extensions: ["vcf"] + }, + "text/xml": { + source: "iana", + compressible: true, + extensions: ["xml"] + }, + "text/xml-external-parsed-entity": { + source: "iana" + }, + "text/yaml": { + compressible: true, + extensions: ["yaml", "yml"] + }, + "video/1d-interleaved-parityfec": { + source: "iana" + }, + "video/3gpp": { + source: "iana", + extensions: ["3gp", "3gpp"] + }, + "video/3gpp-tt": { + source: "iana" + }, + "video/3gpp2": { + source: "iana", + extensions: ["3g2"] + }, + "video/av1": { + source: "iana" + }, + "video/bmpeg": { + source: "iana" + }, + "video/bt656": { + source: "iana" + }, + "video/celb": { + source: "iana" + }, + "video/dv": { + source: "iana" + }, + "video/encaprtp": { + source: "iana" + }, + "video/ffv1": { + source: "iana" + }, + "video/flexfec": { + source: "iana" + }, + "video/h261": { + source: "iana", + extensions: ["h261"] + }, + "video/h263": { + source: "iana", + extensions: ["h263"] + }, + "video/h263-1998": { + source: "iana" + }, + "video/h263-2000": { + source: "iana" + }, + "video/h264": { + source: "iana", + extensions: ["h264"] + }, + "video/h264-rcdo": { + source: "iana" + }, + "video/h264-svc": { + source: "iana" + }, + "video/h265": { + source: "iana" + }, + "video/iso.segment": { + source: "iana", + extensions: ["m4s"] + }, + "video/jpeg": { + source: "iana", + extensions: ["jpgv"] + }, + "video/jpeg2000": { + source: "iana" + }, + "video/jpm": { + source: "apache", + extensions: ["jpm", "jpgm"] + }, + "video/jxsv": { + source: "iana" + }, + "video/mj2": { + source: "iana", + extensions: ["mj2", "mjp2"] + }, + "video/mp1s": { + source: "iana" + }, + "video/mp2p": { + source: "iana" + }, + "video/mp2t": { + source: "iana", + extensions: ["ts"] + }, + "video/mp4": { + source: "iana", + compressible: false, + extensions: ["mp4", "mp4v", "mpg4"] + }, + "video/mp4v-es": { + source: "iana" + }, + "video/mpeg": { + source: "iana", + compressible: false, + extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"] + }, + "video/mpeg4-generic": { + source: "iana" + }, + "video/mpv": { + source: "iana" + }, + "video/nv": { + source: "iana" + }, + "video/ogg": { + source: "iana", + compressible: false, + extensions: ["ogv"] + }, + "video/parityfec": { + source: "iana" + }, + "video/pointer": { + source: "iana" + }, + "video/quicktime": { + source: "iana", + compressible: false, + extensions: ["qt", "mov"] + }, + "video/raptorfec": { + source: "iana" + }, + "video/raw": { + source: "iana" + }, + "video/rtp-enc-aescm128": { + source: "iana" + }, + "video/rtploopback": { + source: "iana" + }, + "video/rtx": { + source: "iana" + }, + "video/scip": { + source: "iana" + }, + "video/smpte291": { + source: "iana" + }, + "video/smpte292m": { + source: "iana" + }, + "video/ulpfec": { + source: "iana" + }, + "video/vc1": { + source: "iana" + }, + "video/vc2": { + source: "iana" + }, + "video/vnd.cctv": { + source: "iana" + }, + "video/vnd.dece.hd": { + source: "iana", + extensions: ["uvh", "uvvh"] + }, + "video/vnd.dece.mobile": { + source: "iana", + extensions: ["uvm", "uvvm"] + }, + "video/vnd.dece.mp4": { + source: "iana" + }, + "video/vnd.dece.pd": { + source: "iana", + extensions: ["uvp", "uvvp"] + }, + "video/vnd.dece.sd": { + source: "iana", + extensions: ["uvs", "uvvs"] + }, + "video/vnd.dece.video": { + source: "iana", + extensions: ["uvv", "uvvv"] + }, + "video/vnd.directv.mpeg": { + source: "iana" + }, + "video/vnd.directv.mpeg-tts": { + source: "iana" + }, + "video/vnd.dlna.mpeg-tts": { + source: "iana" + }, + "video/vnd.dvb.file": { + source: "iana", + extensions: ["dvb"] + }, + "video/vnd.fvt": { + source: "iana", + extensions: ["fvt"] + }, + "video/vnd.hns.video": { + source: "iana" + }, + "video/vnd.iptvforum.1dparityfec-1010": { + source: "iana" + }, + "video/vnd.iptvforum.1dparityfec-2005": { + source: "iana" + }, + "video/vnd.iptvforum.2dparityfec-1010": { + source: "iana" + }, + "video/vnd.iptvforum.2dparityfec-2005": { + source: "iana" + }, + "video/vnd.iptvforum.ttsavc": { + source: "iana" + }, + "video/vnd.iptvforum.ttsmpeg2": { + source: "iana" + }, + "video/vnd.motorola.video": { + source: "iana" + }, + "video/vnd.motorola.videop": { + source: "iana" + }, + "video/vnd.mpegurl": { + source: "iana", + extensions: ["mxu", "m4u"] + }, + "video/vnd.ms-playready.media.pyv": { + source: "iana", + extensions: ["pyv"] + }, + "video/vnd.nokia.interleaved-multimedia": { + source: "iana" + }, + "video/vnd.nokia.mp4vr": { + source: "iana" + }, + "video/vnd.nokia.videovoip": { + source: "iana" + }, + "video/vnd.objectvideo": { + source: "iana" + }, + "video/vnd.radgamettools.bink": { + source: "iana" + }, + "video/vnd.radgamettools.smacker": { + source: "iana" + }, + "video/vnd.sealed.mpeg1": { + source: "iana" + }, + "video/vnd.sealed.mpeg4": { + source: "iana" + }, + "video/vnd.sealed.swf": { + source: "iana" + }, + "video/vnd.sealedmedia.softseal.mov": { + source: "iana" + }, + "video/vnd.uvvu.mp4": { + source: "iana", + extensions: ["uvu", "uvvu"] + }, + "video/vnd.vivo": { + source: "iana", + extensions: ["viv"] + }, + "video/vnd.youtube.yt": { + source: "iana" + }, + "video/vp8": { + source: "iana" + }, + "video/vp9": { + source: "iana" + }, + "video/webm": { + source: "apache", + compressible: false, + extensions: ["webm"] + }, + "video/x-f4v": { + source: "apache", + extensions: ["f4v"] + }, + "video/x-fli": { + source: "apache", + extensions: ["fli"] + }, + "video/x-flv": { + source: "apache", + compressible: false, + extensions: ["flv"] + }, + "video/x-m4v": { + source: "apache", + extensions: ["m4v"] + }, + "video/x-matroska": { + source: "apache", + compressible: false, + extensions: ["mkv", "mk3d", "mks"] + }, + "video/x-mng": { + source: "apache", + extensions: ["mng"] + }, + "video/x-ms-asf": { + source: "apache", + extensions: ["asf", "asx"] + }, + "video/x-ms-vob": { + source: "apache", + extensions: ["vob"] + }, + "video/x-ms-wm": { + source: "apache", + extensions: ["wm"] + }, + "video/x-ms-wmv": { + source: "apache", + compressible: false, + extensions: ["wmv"] + }, + "video/x-ms-wmx": { + source: "apache", + extensions: ["wmx"] + }, + "video/x-ms-wvx": { + source: "apache", + extensions: ["wvx"] + }, + "video/x-msvideo": { + source: "apache", + extensions: ["avi"] + }, + "video/x-sgi-movie": { + source: "apache", + extensions: ["movie"] + }, + "video/x-smv": { + source: "apache", + extensions: ["smv"] + }, + "x-conference/x-cooltalk": { + source: "apache", + extensions: ["ice"] + }, + "x-shader/x-fragment": { + compressible: true + }, + "x-shader/x-vertex": { + compressible: true } - } else if (!invalidHeaderCharRegex.test(obj[name2])) { - headers[MAP][name2] = [obj[name2]]; - } - } - return headers; -} -function parseURL(urlStr) { - if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { - urlStr = new URL3(urlStr).toString(); - } - return parse_url(urlStr); -} -function isRequest(input) { - return typeof input === "object" && typeof input[INTERNALS$2] === "object"; -} -function isAbortSignal(signal) { - const proto = signal && typeof signal === "object" && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === "AbortSignal"); -} -function getNodeRequestOptions(request) { - const parsedURL = request[INTERNALS$2].parsedURL; - const headers = new Headers(request[INTERNALS$2].headers); - if (!headers.has("Accept")) { - headers.set("Accept", "*/*"); - } - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError("Only absolute URLs are supported"); - } - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError("Only HTTP(S) protocols are supported"); - } - if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { - throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8"); - } - let contentLengthValue = null; - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = "0"; - } - if (request.body != null) { - const totalBytes = getTotalBytes(request); - if (typeof totalBytes === "number") { - contentLengthValue = String(totalBytes); - } - } - if (contentLengthValue) { - headers.set("Content-Length", contentLengthValue); - } - if (!headers.has("User-Agent")) { - headers.set("User-Agent", "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"); - } - if (request.compress && !headers.has("Accept-Encoding")) { - headers.set("Accept-Encoding", "gzip,deflate"); - } - let agent = request.agent; - if (typeof agent === "function") { - agent = agent(parsedURL); - } - if (!headers.has("Connection") && !agent) { - headers.set("Connection", "close"); + }; } - return Object.assign({}, parsedURL, { - method: request.method, - headers: exportNodeCompatibleHeaders(headers), - agent - }); -} -function AbortError2(message) { - Error.call(this, message); - this.type = "aborted"; - this.message = message; - Error.captureStackTrace(this, this.constructor); -} -function fetch(url2, opts) { - if (!fetch.Promise) { - throw new Error("native promise missing, set fetch.Promise to your favorite alternative"); +}); + +// node_modules/mime-db/index.js +var require_mime_db = __commonJS({ + "node_modules/mime-db/index.js"(exports, module) { + /*! + * mime-db + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015-2022 Douglas Christopher Wilson + * MIT Licensed + */ + module.exports = require_db(); } - Body.Promise = fetch.Promise; - return new fetch.Promise(function(resolve2, reject) { - const request = new Request(url2, opts); - const options = getNodeRequestOptions(request); - const send = (options.protocol === "https:" ? https : http).request; - const signal = request.signal; - let response = null; - const abort = function abort2() { - let error = new AbortError2("The user aborted a request."); - reject(error); - if (request.body && request.body instanceof Stream.Readable) { - destroyStream(request.body, error); - } - if (!response || !response.body) - return; - response.body.emit("error", error); - }; - if (signal && signal.aborted) { - abort(); - return; - } - const abortAndFinalize = function abortAndFinalize2() { - abort(); - finalize(); - }; - const req = send(options); - let reqTimeout; - if (signal) { - signal.addEventListener("abort", abortAndFinalize); - } - function finalize() { - req.abort(); - if (signal) - signal.removeEventListener("abort", abortAndFinalize); - clearTimeout(reqTimeout); - } - if (request.timeout) { - req.once("socket", function(socket) { - reqTimeout = setTimeout(function() { - reject(new FetchError(`network timeout at: ${request.url}`, "request-timeout")); - finalize(); - }, request.timeout); - }); - } - req.on("error", function(err) { - reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, "system", err)); - if (response && response.body) { - destroyStream(response.body, err); - } - finalize(); - }); - fixResponseChunkedTransferBadEnding(req, function(err) { - if (signal && signal.aborted) { - return; - } - if (response && response.body) { - destroyStream(response.body, err); - } - }); - if (parseInt(process.version.substring(1)) < 14) { - req.on("socket", function(s2) { - s2.addListener("close", function(hadError) { - const hasDataListener = s2.listenerCount("data") > 0; - if (response && hasDataListener && !hadError && !(signal && signal.aborted)) { - const err = new Error("Premature close"); - err.code = "ERR_STREAM_PREMATURE_CLOSE"; - response.body.emit("error", err); - } - }); - }); - } - req.on("response", function(res) { - clearTimeout(reqTimeout); - const headers = createHeadersLenient(res.headers); - if (fetch.isRedirect(res.statusCode)) { - const location = headers.get("Location"); - let locationURL = null; - try { - locationURL = location === null ? null : new URL$1(location, request.url).toString(); - } catch (err) { - if (request.redirect !== "manual") { - reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, "invalid-redirect")); - finalize(); - return; - } - } - switch (request.redirect) { - case "error": - reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, "no-redirect")); - finalize(); - return; - case "manual": - if (locationURL !== null) { - try { - headers.set("Location", locationURL); - } catch (err) { - reject(err); - } - } - break; - case "follow": - if (locationURL === null) { - break; - } - if (request.counter >= request.follow) { - reject(new FetchError(`maximum redirect reached at: ${request.url}`, "max-redirect")); - finalize(); - return; - } - const requestOpts = { - headers: new Headers(request.headers), - follow: request.follow, - counter: request.counter + 1, - agent: request.agent, - compress: request.compress, - method: request.method, - body: request.body, - signal: request.signal, - timeout: request.timeout, - size: request.size - }; - if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) { - for (const name2 of ["authorization", "www-authenticate", "cookie", "cookie2"]) { - requestOpts.headers.delete(name2); - } - } - if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { - reject(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect")); - finalize(); - return; - } - if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === "POST") { - requestOpts.method = "GET"; - requestOpts.body = void 0; - requestOpts.headers.delete("content-length"); - } - resolve2(fetch(new Request(locationURL, requestOpts))); - finalize(); - return; - } - } - res.once("end", function() { - if (signal) - signal.removeEventListener("abort", abortAndFinalize); - }); - let body2 = res.pipe(new PassThrough$1()); - const response_options = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers, - size: request.size, - timeout: request.timeout, - counter: request.counter - }; - const codings = headers.get("Content-Encoding"); - if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response(body2, response_options); - resolve2(response); - return; - } - const zlibOptions = { - flush: zlib.Z_SYNC_FLUSH, - finishFlush: zlib.Z_SYNC_FLUSH - }; - if (codings == "gzip" || codings == "x-gzip") { - body2 = body2.pipe(zlib.createGunzip(zlibOptions)); - response = new Response(body2, response_options); - resolve2(response); - return; +}); + +// node_modules/mime-types/index.js +var require_mime_types = __commonJS({ + "node_modules/mime-types/index.js"(exports) { + "use strict"; + /*! + * mime-types + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + var db = require_mime_db(); + var extname = __require("path").extname; + var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/; + var TEXT_TYPE_REGEXP = /^text\//i; + exports.charset = charset; + exports.charsets = { lookup: charset }; + exports.contentType = contentType2; + exports.extension = extension; + exports.extensions = /* @__PURE__ */ Object.create(null); + exports.lookup = lookup; + exports.types = /* @__PURE__ */ Object.create(null); + populateMaps(exports.extensions, exports.types); + function charset(type3) { + if (!type3 || typeof type3 !== "string") { + return false; } - if (codings == "deflate" || codings == "x-deflate") { - const raw = res.pipe(new PassThrough$1()); - raw.once("data", function(chunk) { - if ((chunk[0] & 15) === 8) { - body2 = body2.pipe(zlib.createInflate()); - } else { - body2 = body2.pipe(zlib.createInflateRaw()); - } - response = new Response(body2, response_options); - resolve2(response); - }); - raw.on("end", function() { - if (!response) { - response = new Response(body2, response_options); - resolve2(response); - } - }); - return; + var match = EXTRACT_TYPE_REGEXP.exec(type3); + var mime = match && db[match[1].toLowerCase()]; + if (mime && mime.charset) { + return mime.charset; } - if (codings == "br" && typeof zlib.createBrotliDecompress === "function") { - body2 = body2.pipe(zlib.createBrotliDecompress()); - response = new Response(body2, response_options); - resolve2(response); - return; + if (match && TEXT_TYPE_REGEXP.test(match[1])) { + return "UTF-8"; } - response = new Response(body2, response_options); - resolve2(response); - }); - writeToStream(req, request); - }); -} -function fixResponseChunkedTransferBadEnding(request, errorCallback) { - let socket; - request.on("socket", function(s2) { - socket = s2; - }); - request.on("response", function(response) { - const headers = response.headers; - if (headers["transfer-encoding"] === "chunked" && !headers["content-length"]) { - response.once("close", function(hadError) { - const hasDataListener = socket && socket.listenerCount("data") > 0; - if (hasDataListener && !hadError) { - const err = new Error("Premature close"); - err.code = "ERR_STREAM_PREMATURE_CLOSE"; - errorCallback(err); - } - }); + return false; } - }); -} -function destroyStream(stream, err) { - if (stream.destroy) { - stream.destroy(err); - } else { - stream.emit("error", err); - stream.end(); - } -} -var Readable, BUFFER, TYPE, Blob2, convert, INTERNALS, PassThrough, invalidTokenRegex, invalidHeaderCharRegex, MAP, Headers, INTERNAL, HeadersIteratorPrototype, INTERNALS$1, STATUS_CODES, Response, INTERNALS$2, URL3, parse_url, format_url, streamDestructionSupported, Request, URL$1, PassThrough$1, isDomainOrSubdomain, isSameProtocol, lib_default; -var init_lib = __esm({ - "node_modules/node-fetch/lib/index.mjs"() { - Readable = Stream.Readable; - BUFFER = Symbol("buffer"); - TYPE = Symbol("type"); - Blob2 = class _Blob { - constructor() { - this[TYPE] = ""; - const blobParts = arguments[0]; - const options = arguments[1]; - const buffers = []; - let size = 0; - if (blobParts) { - const a2 = blobParts; - const length = Number(a2.length); - for (let i2 = 0; i2 < length; i2++) { - const element = a2[i2]; - let buffer; - if (element instanceof Buffer) { - buffer = element; - } else if (ArrayBuffer.isView(element)) { - buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); - } else if (element instanceof ArrayBuffer) { - buffer = Buffer.from(element); - } else if (element instanceof _Blob) { - buffer = element[BUFFER]; - } else { - buffer = Buffer.from(typeof element === "string" ? element : String(element)); - } - size += buffer.length; - buffers.push(buffer); - } - } - this[BUFFER] = Buffer.concat(buffers); - let type3 = options && options.type !== void 0 && String(options.type).toLowerCase(); - if (type3 && !/[^\u0020-\u007E]/.test(type3)) { - this[TYPE] = type3; - } + function contentType2(str) { + if (!str || typeof str !== "string") { + return false; } - get size() { - return this[BUFFER].length; + var mime = str.indexOf("/") === -1 ? exports.lookup(str) : str; + if (!mime) { + return false; } - get type() { - return this[TYPE]; + if (mime.indexOf("charset") === -1) { + var charset2 = exports.charset(mime); + if (charset2) + mime += "; charset=" + charset2.toLowerCase(); } - text() { - return Promise.resolve(this[BUFFER].toString()); + return mime; + } + function extension(type3) { + if (!type3 || typeof type3 !== "string") { + return false; } - arrayBuffer() { - const buf = this[BUFFER]; - const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - return Promise.resolve(ab); + var match = EXTRACT_TYPE_REGEXP.exec(type3); + var exts = match && exports.extensions[match[1].toLowerCase()]; + if (!exts || !exts.length) { + return false; } - stream() { - const readable = new Readable(); - readable._read = function() { - }; - readable.push(this[BUFFER]); - readable.push(null); - return readable; + return exts[0]; + } + function lookup(path14) { + if (!path14 || typeof path14 !== "string") { + return false; } - toString() { - return "[object Blob]"; + var extension2 = extname("x." + path14).toLowerCase().substr(1); + if (!extension2) { + return false; } - slice() { - const size = this.size; - const start = arguments[0]; - const end = arguments[1]; - let relativeStart, relativeEnd; - if (start === void 0) { - relativeStart = 0; - } else if (start < 0) { - relativeStart = Math.max(size + start, 0); + return exports.types[extension2] || false; + } + function populateMaps(extensions, types) { + var preference = ["nginx", "apache", void 0, "iana"]; + Object.keys(db).forEach(function forEachMimeType(type3) { + var mime = db[type3]; + var exts = mime.extensions; + if (!exts || !exts.length) { + return; + } + extensions[type3] = exts; + for (var i2 = 0; i2 < exts.length; i2++) { + var extension2 = exts[i2]; + if (types[extension2]) { + var from = preference.indexOf(db[types[extension2]].source); + var to2 = preference.indexOf(mime.source); + if (types[extension2] !== "application/octet-stream" && (from > to2 || from === to2 && types[extension2].substr(0, 12) === "application/")) { + continue; + } + } + types[extension2] = type3; + } + }); + } + } +}); + +// node_modules/asynckit/lib/defer.js +var require_defer = __commonJS({ + "node_modules/asynckit/lib/defer.js"(exports, module) { + module.exports = defer; + function defer(fn2) { + var nextTick = typeof setImmediate == "function" ? setImmediate : typeof process == "object" && typeof process.nextTick == "function" ? process.nextTick : null; + if (nextTick) { + nextTick(fn2); + } else { + setTimeout(fn2, 0); + } + } + } +}); + +// node_modules/asynckit/lib/async.js +var require_async = __commonJS({ + "node_modules/asynckit/lib/async.js"(exports, module) { + var defer = require_defer(); + module.exports = async; + function async(callback) { + var isAsync = false; + defer(function() { + isAsync = true; + }); + return function async_callback(err, result) { + if (isAsync) { + callback(err, result); } else { - relativeStart = Math.min(start, size); + defer(function nextTick_callback() { + callback(err, result); + }); } - if (end === void 0) { - relativeEnd = size; - } else if (end < 0) { - relativeEnd = Math.max(size + end, 0); + }; + } + } +}); + +// node_modules/asynckit/lib/abort.js +var require_abort = __commonJS({ + "node_modules/asynckit/lib/abort.js"(exports, module) { + module.exports = abort; + function abort(state) { + Object.keys(state.jobs).forEach(clean.bind(state)); + state.jobs = {}; + } + function clean(key) { + if (typeof this.jobs[key] == "function") { + this.jobs[key](); + } + } + } +}); + +// node_modules/asynckit/lib/iterate.js +var require_iterate = __commonJS({ + "node_modules/asynckit/lib/iterate.js"(exports, module) { + var async = require_async(); + var abort = require_abort(); + module.exports = iterate; + function iterate(list3, iterator, state, callback) { + var key = state["keyedList"] ? state["keyedList"][state.index] : state.index; + state.jobs[key] = runJob(iterator, key, list3[key], function(error, output) { + if (!(key in state.jobs)) { + return; + } + delete state.jobs[key]; + if (error) { + abort(state); } else { - relativeEnd = Math.min(end, size); + state.results[key] = output; } - const span = Math.max(relativeEnd - relativeStart, 0); - const buffer = this[BUFFER]; - const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob = new _Blob([], { type: arguments[2] }); - blob[BUFFER] = slicedBuffer; - return blob; + callback(error, state.results); + }); + } + function runJob(iterator, key, item, callback) { + var aborter; + if (iterator.length == 2) { + aborter = iterator(item, async(callback)); + } else { + aborter = iterator(item, key, async(callback)); } - }; - Object.defineProperties(Blob2.prototype, { - size: { enumerable: true }, - type: { enumerable: true }, - slice: { enumerable: true } - }); - Object.defineProperty(Blob2.prototype, Symbol.toStringTag, { - value: "Blob", - writable: false, - enumerable: false, - configurable: true - }); - FetchError.prototype = Object.create(Error.prototype); - FetchError.prototype.constructor = FetchError; - FetchError.prototype.name = "FetchError"; - try { - convert = __require("encoding").convert; - } catch (e2) { + return aborter; } - INTERNALS = Symbol("Body internals"); - PassThrough = Stream.PassThrough; - Body.prototype = { - get body() { - return this[INTERNALS].body; - }, - get bodyUsed() { - return this[INTERNALS].disturbed; - }, - /** - * Decode response as ArrayBuffer - * - * @return Promise - */ - arrayBuffer() { - return consumeBody.call(this).then(function(buf) { - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - }); - }, - /** - * Return raw response as Blob - * - * @return Promise - */ - blob() { - let ct2 = this.headers && this.headers.get("content-type") || ""; - return consumeBody.call(this).then(function(buf) { - return Object.assign( - // Prevent copying - new Blob2([], { - type: ct2.toLowerCase() - }), - { - [BUFFER]: buf - } - ); + } +}); + +// node_modules/asynckit/lib/state.js +var require_state = __commonJS({ + "node_modules/asynckit/lib/state.js"(exports, module) { + module.exports = state; + function state(list3, sortMethod) { + var isNamedList = !Array.isArray(list3), initState = { + index: 0, + keyedList: isNamedList || sortMethod ? Object.keys(list3) : null, + jobs: {}, + results: isNamedList ? {} : [], + size: isNamedList ? Object.keys(list3).length : list3.length + }; + if (sortMethod) { + initState.keyedList.sort(isNamedList ? sortMethod : function(a2, b2) { + return sortMethod(list3[a2], list3[b2]); }); - }, - /** - * Decode response as json - * - * @return Promise - */ - json() { - var _this2 = this; - return consumeBody.call(this).then(function(buffer) { - try { - return JSON.parse(buffer.toString()); - } catch (err) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, "invalid-json")); + } + return initState; + } + } +}); + +// node_modules/asynckit/lib/terminator.js +var require_terminator = __commonJS({ + "node_modules/asynckit/lib/terminator.js"(exports, module) { + var abort = require_abort(); + var async = require_async(); + module.exports = terminator; + function terminator(callback) { + if (!Object.keys(this.jobs).length) { + return; + } + this.index = this.size; + abort(this); + async(callback)(null, this.results); + } + } +}); + +// node_modules/asynckit/parallel.js +var require_parallel = __commonJS({ + "node_modules/asynckit/parallel.js"(exports, module) { + var iterate = require_iterate(); + var initState = require_state(); + var terminator = require_terminator(); + module.exports = parallel; + function parallel(list3, iterator, callback) { + var state = initState(list3); + while (state.index < (state["keyedList"] || list3).length) { + iterate(list3, iterator, state, function(error, result) { + if (error) { + callback(error, result); + return; + } + if (Object.keys(state.jobs).length === 0) { + callback(null, state.results); + return; } }); - }, - /** - * Decode response as text - * - * @return Promise - */ - text() { - return consumeBody.call(this).then(function(buffer) { - return buffer.toString(); - }); - }, - /** - * Decode response as buffer (non-spec api) - * - * @return Promise - */ - buffer() { - return consumeBody.call(this); - }, - /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return Promise - */ - textConverted() { - var _this3 = this; - return consumeBody.call(this).then(function(buffer) { - return convertBody(buffer, _this3.headers); - }); + state.index++; + } + return terminator.bind(state, callback); + } + } +}); + +// node_modules/asynckit/serialOrdered.js +var require_serialOrdered = __commonJS({ + "node_modules/asynckit/serialOrdered.js"(exports, module) { + var iterate = require_iterate(); + var initState = require_state(); + var terminator = require_terminator(); + module.exports = serialOrdered; + module.exports.ascending = ascending; + module.exports.descending = descending; + function serialOrdered(list3, iterator, sortMethod, callback) { + var state = initState(list3, sortMethod); + iterate(list3, iterator, state, function iteratorHandler(error, result) { + if (error) { + callback(error, result); + return; + } + state.index++; + if (state.index < (state["keyedList"] || list3).length) { + iterate(list3, iterator, state, iteratorHandler); + return; + } + callback(null, state.results); + }); + return terminator.bind(state, callback); + } + function ascending(a2, b2) { + return a2 < b2 ? -1 : a2 > b2 ? 1 : 0; + } + function descending(a2, b2) { + return -1 * ascending(a2, b2); + } + } +}); + +// node_modules/asynckit/serial.js +var require_serial = __commonJS({ + "node_modules/asynckit/serial.js"(exports, module) { + var serialOrdered = require_serialOrdered(); + module.exports = serial; + function serial(list3, iterator, callback) { + return serialOrdered(list3, iterator, null, callback); + } + } +}); + +// node_modules/asynckit/index.js +var require_asynckit = __commonJS({ + "node_modules/asynckit/index.js"(exports, module) { + module.exports = { + parallel: require_parallel(), + serial: require_serial(), + serialOrdered: require_serialOrdered() + }; + } +}); + +// node_modules/@azure/core-http/node_modules/form-data/lib/populate.js +var require_populate = __commonJS({ + "node_modules/@azure/core-http/node_modules/form-data/lib/populate.js"(exports, module) { + module.exports = function(dst, src) { + Object.keys(src).forEach(function(prop) { + dst[prop] = dst[prop] || src[prop]; + }); + return dst; + }; + } +}); + +// node_modules/@azure/core-http/node_modules/form-data/lib/form_data.js +var require_form_data = __commonJS({ + "node_modules/@azure/core-http/node_modules/form-data/lib/form_data.js"(exports, module) { + var CombinedStream = require_combined_stream(); + var util3 = __require("util"); + var path14 = __require("path"); + var http4 = __require("http"); + var https3 = __require("https"); + var parseUrl = __require("url").parse; + var fs3 = __require("fs"); + var Stream2 = __require("stream").Stream; + var mime = require_mime_types(); + var asynckit = require_asynckit(); + var populate = require_populate(); + module.exports = FormData2; + util3.inherits(FormData2, CombinedStream); + function FormData2(options) { + if (!(this instanceof FormData2)) { + return new FormData2(options); + } + this._overheadLength = 0; + this._valueLength = 0; + this._valuesToMeasure = []; + CombinedStream.call(this); + options = options || {}; + for (var option in options) { + this[option] = options[option]; + } + } + FormData2.LINE_BREAK = "\r\n"; + FormData2.DEFAULT_CONTENT_TYPE = "application/octet-stream"; + FormData2.prototype.append = function(field, value, options) { + options = options || {}; + if (typeof options == "string") { + options = { filename: options }; + } + var append = CombinedStream.prototype.append.bind(this); + if (typeof value == "number") { + value = "" + value; + } + if (util3.isArray(value)) { + this._error(new Error("Arrays are not supported.")); + return; } + var header = this._multiPartHeader(field, value, options); + var footer = this._multiPartFooter(); + append(header); + append(value); + append(footer); + this._trackLength(header, value, options); }; - Object.defineProperties(Body.prototype, { - body: { enumerable: true }, - bodyUsed: { enumerable: true }, - arrayBuffer: { enumerable: true }, - blob: { enumerable: true }, - json: { enumerable: true }, - text: { enumerable: true } - }); - Body.mixIn = function(proto) { - for (const name2 of Object.getOwnPropertyNames(Body.prototype)) { - if (!(name2 in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name2); - Object.defineProperty(proto, name2, desc); - } + FormData2.prototype._trackLength = function(header, value, options) { + var valueLength = 0; + if (options.knownLength != null) { + valueLength += +options.knownLength; + } else if (Buffer.isBuffer(value)) { + valueLength = value.length; + } else if (typeof value === "string") { + valueLength = Buffer.byteLength(value); + } + this._valueLength += valueLength; + this._overheadLength += Buffer.byteLength(header) + FormData2.LINE_BREAK.length; + if (!value || !value.path && !(value.readable && value.hasOwnProperty("httpVersion")) && !(value instanceof Stream2)) { + return; + } + if (!options.knownLength) { + this._valuesToMeasure.push(value); } }; - Body.Promise = global.Promise; - invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/; - invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/; - MAP = Symbol("map"); - Headers = class _Headers { - /** - * Headers class - * - * @param Object headers Response headers - * @return Void - */ - constructor() { - let init2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0; - this[MAP] = /* @__PURE__ */ Object.create(null); - if (init2 instanceof _Headers) { - const rawHeaders = init2.raw(); - const headerNames = Object.keys(rawHeaders); - for (const headerName of headerNames) { - for (const value of rawHeaders[headerName]) { - this.append(headerName, value); - } - } - return; - } - if (init2 == null) - ; - else if (typeof init2 === "object") { - const method = init2[Symbol.iterator]; - if (method != null) { - if (typeof method !== "function") { - throw new TypeError("Header pairs must be iterable"); - } - const pairs = []; - for (const pair of init2) { - if (typeof pair !== "object" || typeof pair[Symbol.iterator] !== "function") { - throw new TypeError("Each header pair must be iterable"); - } - pairs.push(Array.from(pair)); - } - for (const pair of pairs) { - if (pair.length !== 2) { - throw new TypeError("Each header pair must be a name/value tuple"); - } - this.append(pair[0], pair[1]); - } - } else { - for (const key of Object.keys(init2)) { - const value = init2[key]; - this.append(key, value); - } - } + FormData2.prototype._lengthRetriever = function(value, callback) { + if (value.hasOwnProperty("fd")) { + if (value.end != void 0 && value.end != Infinity && value.start != void 0) { + callback(null, value.end + 1 - (value.start ? value.start : 0)); } else { - throw new TypeError("Provided initializer must be an object"); - } - } - /** - * Return combined header value given name - * - * @param String name Header name - * @return Mixed - */ - get(name2) { - name2 = `${name2}`; - validateName(name2); - const key = find(this[MAP], name2); - if (key === void 0) { - return null; + fs3.stat(value.path, function(err, stat2) { + var fileSize; + if (err) { + callback(err); + return; + } + fileSize = stat2.size - (value.start ? value.start : 0); + callback(null, fileSize); + }); } - return this[MAP][key].join(", "); + } else if (value.hasOwnProperty("httpVersion")) { + callback(null, +value.headers["content-length"]); + } else if (value.hasOwnProperty("httpModule")) { + value.on("response", function(response) { + value.pause(); + callback(null, +response.headers["content-length"]); + }); + value.resume(); + } else { + callback("Unknown stream"); } - /** - * Iterate over all headers - * - * @param Function callback Executed for each item with parameters (value, name, thisArg) - * @param Boolean thisArg `this` context for callback function - * @return Void - */ - forEach(callback) { - let thisArg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0; - let pairs = getHeaders(this); - let i2 = 0; - while (i2 < pairs.length) { - var _pairs$i = pairs[i2]; - const name2 = _pairs$i[0], value = _pairs$i[1]; - callback.call(thisArg, value, name2, this); - pairs = getHeaders(this); - i2++; - } + }; + FormData2.prototype._multiPartHeader = function(field, value, options) { + if (typeof options.header == "string") { + return options.header; } - /** - * Overwrite header values given name - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - set(name2, value) { - name2 = `${name2}`; - value = `${value}`; - validateName(name2); - validateValue(value); - const key = find(this[MAP], name2); - this[MAP][key !== void 0 ? key : name2] = [value]; + var contentDisposition = this._getContentDisposition(value, options); + var contentType2 = this._getContentType(value, options); + var contents = ""; + var headers = { + // add custom disposition as third element or keep it two elements if not + "Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []), + // if no content type. allow it to be empty array + "Content-Type": [].concat(contentType2 || []) + }; + if (typeof options.header == "object") { + populate(headers, options.header); } - /** - * Append a value onto existing header - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - append(name2, value) { - name2 = `${name2}`; - value = `${value}`; - validateName(name2); - validateValue(value); - const key = find(this[MAP], name2); - if (key !== void 0) { - this[MAP][key].push(value); - } else { - this[MAP][name2] = [value]; + var header; + for (var prop in headers) { + if (!headers.hasOwnProperty(prop)) + continue; + header = headers[prop]; + if (header == null) { + continue; + } + if (!Array.isArray(header)) { + header = [header]; + } + if (header.length) { + contents += prop + ": " + header.join("; ") + FormData2.LINE_BREAK; } } - /** - * Check for header name existence - * - * @param String name Header name - * @return Boolean - */ - has(name2) { - name2 = `${name2}`; - validateName(name2); - return find(this[MAP], name2) !== void 0; + return "--" + this.getBoundary() + FormData2.LINE_BREAK + contents + FormData2.LINE_BREAK; + }; + FormData2.prototype._getContentDisposition = function(value, options) { + var filename, contentDisposition; + if (typeof options.filepath === "string") { + filename = path14.normalize(options.filepath).replace(/\\/g, "/"); + } else if (options.filename || value.name || value.path) { + filename = path14.basename(options.filename || value.name || value.path); + } else if (value.readable && value.hasOwnProperty("httpVersion")) { + filename = path14.basename(value.client._httpMessage.path || ""); } - /** - * Delete all header values given name - * - * @param String name Header name - * @return Void - */ - delete(name2) { - name2 = `${name2}`; - validateName(name2); - const key = find(this[MAP], name2); - if (key !== void 0) { - delete this[MAP][key]; - } + if (filename) { + contentDisposition = 'filename="' + filename + '"'; } - /** - * Return raw headers (non-spec api) - * - * @return Object - */ - raw() { - return this[MAP]; + return contentDisposition; + }; + FormData2.prototype._getContentType = function(value, options) { + var contentType2 = options.contentType; + if (!contentType2 && value.name) { + contentType2 = mime.lookup(value.name); } - /** - * Get an iterator on keys. - * - * @return Iterator - */ - keys() { - return createHeadersIterator(this, "key"); + if (!contentType2 && value.path) { + contentType2 = mime.lookup(value.path); } - /** - * Get an iterator on values. - * - * @return Iterator - */ - values() { - return createHeadersIterator(this, "value"); + if (!contentType2 && value.readable && value.hasOwnProperty("httpVersion")) { + contentType2 = value.headers["content-type"]; } - /** - * Get an iterator on entries. - * - * This is the default iterator of the Headers object. - * - * @return Iterator - */ - [Symbol.iterator]() { - return createHeadersIterator(this, "key+value"); + if (!contentType2 && (options.filepath || options.filename)) { + contentType2 = mime.lookup(options.filepath || options.filename); } + if (!contentType2 && typeof value == "object") { + contentType2 = FormData2.DEFAULT_CONTENT_TYPE; + } + return contentType2; }; - Headers.prototype.entries = Headers.prototype[Symbol.iterator]; - Object.defineProperty(Headers.prototype, Symbol.toStringTag, { - value: "Headers", - writable: false, - enumerable: false, - configurable: true - }); - Object.defineProperties(Headers.prototype, { - get: { enumerable: true }, - forEach: { enumerable: true }, - set: { enumerable: true }, - append: { enumerable: true }, - has: { enumerable: true }, - delete: { enumerable: true }, - keys: { enumerable: true }, - values: { enumerable: true }, - entries: { enumerable: true } - }); - INTERNAL = Symbol("internal"); - HeadersIteratorPrototype = Object.setPrototypeOf({ - next() { - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError("Value of `this` is not a HeadersIterator"); + FormData2.prototype._multiPartFooter = function() { + return function(next) { + var footer = FormData2.LINE_BREAK; + var lastPart = this._streams.length === 0; + if (lastPart) { + footer += this._lastBoundary(); } - var _INTERNAL = this[INTERNAL]; - const target = _INTERNAL.target, kind = _INTERNAL.kind, index = _INTERNAL.index; - const values = getHeaders(target, kind); - const len = values.length; - if (index >= len) { - return { - value: void 0, - done: true - }; + next(footer); + }.bind(this); + }; + FormData2.prototype._lastBoundary = function() { + return "--" + this.getBoundary() + "--" + FormData2.LINE_BREAK; + }; + FormData2.prototype.getHeaders = function(userHeaders) { + var header; + var formHeaders = { + "content-type": "multipart/form-data; boundary=" + this.getBoundary() + }; + for (header in userHeaders) { + if (userHeaders.hasOwnProperty(header)) { + formHeaders[header.toLowerCase()] = userHeaders[header]; } - this[INTERNAL].index = index + 1; - return { - value: values[index], - done: false - }; } - }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); - Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: "HeadersIterator", - writable: false, - enumerable: false, - configurable: true - }); - INTERNALS$1 = Symbol("Response internals"); - STATUS_CODES = http.STATUS_CODES; - Response = class _Response { - constructor() { - let body2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null; - let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - Body.call(this, body2, opts); - const status = opts.status || 200; - const headers = new Headers(opts.headers); - if (body2 != null && !headers.has("Content-Type")) { - const contentType2 = extractContentType(body2); - if (contentType2) { - headers.append("Content-Type", contentType2); + return formHeaders; + }; + FormData2.prototype.setBoundary = function(boundary) { + this._boundary = boundary; + }; + FormData2.prototype.getBoundary = function() { + if (!this._boundary) { + this._generateBoundary(); + } + return this._boundary; + }; + FormData2.prototype.getBuffer = function() { + var dataBuffer = new Buffer.alloc(0); + var boundary = this.getBoundary(); + for (var i2 = 0, len = this._streams.length; i2 < len; i2++) { + if (typeof this._streams[i2] !== "function") { + if (Buffer.isBuffer(this._streams[i2])) { + dataBuffer = Buffer.concat([dataBuffer, this._streams[i2]]); + } else { + dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i2])]); + } + if (typeof this._streams[i2] !== "string" || this._streams[i2].substring(2, boundary.length + 2) !== boundary) { + dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData2.LINE_BREAK)]); } } - this[INTERNALS$1] = { - url: opts.url, - status, - statusText: opts.statusText || STATUS_CODES[status], - headers, - counter: opts.counter - }; } - get url() { - return this[INTERNALS$1].url || ""; + return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]); + }; + FormData2.prototype._generateBoundary = function() { + var boundary = "--------------------------"; + for (var i2 = 0; i2 < 24; i2++) { + boundary += Math.floor(Math.random() * 10).toString(16); } - get status() { - return this[INTERNALS$1].status; + this._boundary = boundary; + }; + FormData2.prototype.getLengthSync = function() { + var knownLength = this._overheadLength + this._valueLength; + if (this._streams.length) { + knownLength += this._lastBoundary().length; } - /** - * Convenience property representing if the request ended normally - */ - get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; + if (!this.hasKnownLength()) { + this._error(new Error("Cannot calculate proper length in synchronous way.")); + } + return knownLength; + }; + FormData2.prototype.hasKnownLength = function() { + var hasKnownLength = true; + if (this._valuesToMeasure.length) { + hasKnownLength = false; + } + return hasKnownLength; + }; + FormData2.prototype.getLength = function(cb) { + var knownLength = this._overheadLength + this._valueLength; + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + if (!this._valuesToMeasure.length) { + process.nextTick(cb.bind(this, null, knownLength)); + return; + } + asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { + if (err) { + cb(err); + return; + } + values.forEach(function(length) { + knownLength += length; + }); + cb(null, knownLength); + }); + }; + FormData2.prototype.submit = function(params, cb) { + var request, options, defaults = { method: "post" }; + if (typeof params == "string") { + params = parseUrl(params); + options = populate({ + port: params.port, + path: params.pathname, + host: params.hostname, + protocol: params.protocol + }, defaults); + } else { + options = populate(params, defaults); + if (!options.port) { + options.port = options.protocol == "https:" ? 443 : 80; + } + } + options.headers = this.getHeaders(params.headers); + if (options.protocol == "https:") { + request = https3.request(options); + } else { + request = http4.request(options); + } + this.getLength(function(err, length) { + if (err && err !== "Unknown stream") { + this._error(err); + return; + } + if (length) { + request.setHeader("Content-Length", length); + } + this.pipe(request); + if (cb) { + var onResponse; + var callback = function(error, responce) { + request.removeListener("error", callback); + request.removeListener("response", onResponse); + return cb.call(this, error, responce); + }; + onResponse = callback.bind(this, null); + request.on("error", callback); + request.on("response", onResponse); + } + }.bind(this)); + return request; + }; + FormData2.prototype._error = function(err) { + if (!this.error) { + this.error = err; + this.pause(); + this.emit("error", err); } - get redirected() { - return this[INTERNALS$1].counter > 0; + }; + FormData2.prototype.toString = function() { + return "[object FormData]"; + }; + } +}); + +// node_modules/@azure/core-http/dist-esm/src/util/sanitizer.js +var RedactedString, defaultAllowedHeaderNames, defaultAllowedQueryParameters, Sanitizer; +var init_sanitizer = __esm({ + "node_modules/@azure/core-http/dist-esm/src/util/sanitizer.js"() { + init_url(); + init_utils(); + RedactedString = "REDACTED"; + defaultAllowedHeaderNames = [ + "x-ms-client-request-id", + "x-ms-return-client-request-id", + "x-ms-useragent", + "x-ms-correlation-request-id", + "x-ms-request-id", + "client-request-id", + "ms-cv", + "return-client-request-id", + "traceparent", + "Access-Control-Allow-Credentials", + "Access-Control-Allow-Headers", + "Access-Control-Allow-Methods", + "Access-Control-Allow-Origin", + "Access-Control-Expose-Headers", + "Access-Control-Max-Age", + "Access-Control-Request-Headers", + "Access-Control-Request-Method", + "Origin", + "Accept", + "Accept-Encoding", + "Cache-Control", + "Connection", + "Content-Length", + "Content-Type", + "Date", + "ETag", + "Expires", + "If-Match", + "If-Modified-Since", + "If-None-Match", + "If-Unmodified-Since", + "Last-Modified", + "Pragma", + "Request-Id", + "Retry-After", + "Server", + "Transfer-Encoding", + "User-Agent", + "WWW-Authenticate" + ]; + defaultAllowedQueryParameters = ["api-version"]; + Sanitizer = class { + constructor({ allowedHeaderNames = [], allowedQueryParameters = [] } = {}) { + allowedHeaderNames = Array.isArray(allowedHeaderNames) ? defaultAllowedHeaderNames.concat(allowedHeaderNames) : defaultAllowedHeaderNames; + allowedQueryParameters = Array.isArray(allowedQueryParameters) ? defaultAllowedQueryParameters.concat(allowedQueryParameters) : defaultAllowedQueryParameters; + this.allowedHeaderNames = new Set(allowedHeaderNames.map((n2) => n2.toLowerCase())); + this.allowedQueryParameters = new Set(allowedQueryParameters.map((p2) => p2.toLowerCase())); } - get statusText() { - return this[INTERNALS$1].statusText; + sanitize(obj) { + const seen = /* @__PURE__ */ new Set(); + return JSON.stringify(obj, (key, value) => { + if (value instanceof Error) { + return Object.assign(Object.assign({}, value), { name: value.name, message: value.message }); + } + if (key === "_headersMap") { + return this.sanitizeHeaders(value); + } else if (key === "url") { + return this.sanitizeUrl(value); + } else if (key === "query") { + return this.sanitizeQuery(value); + } else if (key === "body") { + return void 0; + } else if (key === "response") { + return void 0; + } else if (key === "operationSpec") { + return void 0; + } else if (Array.isArray(value) || isObject(value)) { + if (seen.has(value)) { + return "[Circular]"; + } + seen.add(value); + } + return value; + }, 2); } - get headers() { - return this[INTERNALS$1].headers; + sanitizeHeaders(value) { + return this.sanitizeObject(value, this.allowedHeaderNames, (v2, k2) => v2[k2].value); } - /** - * Clone this response - * - * @return Response - */ - clone() { - return new _Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok, - redirected: this.redirected - }); + sanitizeQuery(value) { + return this.sanitizeObject(value, this.allowedQueryParameters, (v2, k2) => v2[k2]); } - }; - Body.mixIn(Response.prototype); - Object.defineProperties(Response.prototype, { - url: { enumerable: true }, - status: { enumerable: true }, - ok: { enumerable: true }, - redirected: { enumerable: true }, - statusText: { enumerable: true }, - headers: { enumerable: true }, - clone: { enumerable: true } - }); - Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: "Response", - writable: false, - enumerable: false, - configurable: true - }); - INTERNALS$2 = Symbol("Request internals"); - URL3 = Url.URL || whatwgUrl.URL; - parse_url = Url.parse; - format_url = Url.format; - streamDestructionSupported = "destroy" in Stream.Readable.prototype; - Request = class _Request { - constructor(input) { - let init2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - let parsedURL; - if (!isRequest(input)) { - if (input && input.href) { - parsedURL = parseURL(input.href); + sanitizeObject(value, allowedKeys, accessor) { + if (typeof value !== "object" || value === null) { + return value; + } + const sanitized = {}; + for (const k2 of Object.keys(value)) { + if (allowedKeys.has(k2.toLowerCase())) { + sanitized[k2] = accessor(value, k2); } else { - parsedURL = parseURL(`${input}`); + sanitized[k2] = RedactedString; } - input = {}; - } else { - parsedURL = parseURL(input.url); } - let method = init2.method || input.method || "GET"; - method = method.toUpperCase(); - if ((init2.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) { - throw new TypeError("Request with GET/HEAD method cannot have body"); + return sanitized; + } + sanitizeUrl(value) { + if (typeof value !== "string" || value === null) { + return value; } - let inputBody = init2.body != null ? init2.body : isRequest(input) && input.body !== null ? clone(input) : null; - Body.call(this, inputBody, { - timeout: init2.timeout || input.timeout || 0, - size: init2.size || input.size || 0 - }); - const headers = new Headers(init2.headers || input.headers || {}); - if (inputBody != null && !headers.has("Content-Type")) { - const contentType2 = extractContentType(inputBody); - if (contentType2) { - headers.append("Content-Type", contentType2); - } + const urlBuilder = URLBuilder.parse(value); + const queryString = urlBuilder.getQuery(); + if (!queryString) { + return value; } - let signal = isRequest(input) ? input.signal : null; - if ("signal" in init2) - signal = init2.signal; - if (signal != null && !isAbortSignal(signal)) { - throw new TypeError("Expected signal to be an instanceof AbortSignal"); + const query = URLQuery.parse(queryString); + for (const k2 of query.keys()) { + if (!this.allowedQueryParameters.has(k2.toLowerCase())) { + query.set(k2, RedactedString); + } } - this[INTERNALS$2] = { - method, - redirect: init2.redirect || input.redirect || "follow", - headers, - parsedURL, - signal - }; - this.follow = init2.follow !== void 0 ? init2.follow : input.follow !== void 0 ? input.follow : 20; - this.compress = init2.compress !== void 0 ? init2.compress : input.compress !== void 0 ? input.compress : true; - this.counter = init2.counter || input.counter || 0; - this.agent = init2.agent || input.agent; - } - get method() { - return this[INTERNALS$2].method; - } - get url() { - return format_url(this[INTERNALS$2].parsedURL); - } - get headers() { - return this[INTERNALS$2].headers; - } - get redirect() { - return this[INTERNALS$2].redirect; + urlBuilder.setQuery(query.toString()); + return urlBuilder.toString(); } - get signal() { - return this[INTERNALS$2].signal; + }; + } +}); + +// node_modules/@azure/core-http/dist-esm/src/util/inspect.js +import { inspect } from "util"; +var custom; +var init_inspect = __esm({ + "node_modules/@azure/core-http/dist-esm/src/util/inspect.js"() { + custom = inspect.custom; + } +}); + +// node_modules/@azure/core-http/dist-esm/src/restError.js +var errorSanitizer, RestError; +var init_restError = __esm({ + "node_modules/@azure/core-http/dist-esm/src/restError.js"() { + init_sanitizer(); + init_inspect(); + errorSanitizer = new Sanitizer(); + RestError = class _RestError extends Error { + constructor(message, code, statusCode, request, response) { + super(message); + this.name = "RestError"; + this.code = code; + this.statusCode = statusCode; + this.request = request; + this.response = response; + Object.setPrototypeOf(this, _RestError.prototype); } /** - * Clone this request - * - * @return Request + * Logging method for util.inspect in Node */ - clone() { - return new _Request(this); + [custom]() { + return `RestError: ${this.message} + ${errorSanitizer.sanitize(this)}`; } }; - Body.mixIn(Request.prototype); - Object.defineProperty(Request.prototype, Symbol.toStringTag, { - value: "Request", - writable: false, - enumerable: false, - configurable: true - }); - Object.defineProperties(Request.prototype, { - method: { enumerable: true }, - url: { enumerable: true }, - headers: { enumerable: true }, - redirect: { enumerable: true }, - clone: { enumerable: true }, - signal: { enumerable: true } + RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; + RestError.PARSE_ERROR = "PARSE_ERROR"; + } +}); + +// node_modules/@azure/logger/dist-esm/src/log.js +import { EOL } from "os"; +import util from "util"; +function log(message, ...args) { + process.stderr.write(`${util.format(message, ...args)}${EOL}`); +} +var init_log = __esm({ + "node_modules/@azure/logger/dist-esm/src/log.js"() { + } +}); + +// node_modules/@azure/logger/dist-esm/src/debug.js +function enable(namespaces) { + enabledString = namespaces; + enabledNamespaces = []; + skippedNamespaces = []; + const wildcard = /\*/g; + const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); + for (const ns of namespaceList) { + if (ns.startsWith("-")) { + skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); + } else { + enabledNamespaces.push(new RegExp(`^${ns}$`)); + } + } + for (const instance of debuggers) { + instance.enabled = enabled(instance.namespace); + } +} +function enabled(namespace) { + if (namespace.endsWith("*")) { + return true; + } + for (const skipped of skippedNamespaces) { + if (skipped.test(namespace)) { + return false; + } + } + for (const enabledNamespace of enabledNamespaces) { + if (enabledNamespace.test(namespace)) { + return true; + } + } + return false; +} +function disable() { + const result = enabledString || ""; + enable(""); + return result; +} +function createDebugger(namespace) { + const newDebugger = Object.assign(debug3, { + enabled: enabled(namespace), + destroy, + log: debugObj.log, + namespace, + extend + }); + function debug3(...args) { + if (!newDebugger.enabled) { + return; + } + if (args.length > 0) { + args[0] = `${namespace} ${args[0]}`; + } + newDebugger.log(...args); + } + debuggers.push(newDebugger); + return newDebugger; +} +function destroy() { + const index = debuggers.indexOf(this); + if (index >= 0) { + debuggers.splice(index, 1); + return true; + } + return false; +} +function extend(namespace) { + const newDebugger = createDebugger(`${this.namespace}:${namespace}`); + newDebugger.log = this.log; + return newDebugger; +} +var debugEnvVariable, enabledString, enabledNamespaces, skippedNamespaces, debuggers, debugObj, debug_default; +var init_debug = __esm({ + "node_modules/@azure/logger/dist-esm/src/debug.js"() { + init_log(); + debugEnvVariable = typeof process !== "undefined" && process.env && process.env.DEBUG || void 0; + enabledNamespaces = []; + skippedNamespaces = []; + debuggers = []; + if (debugEnvVariable) { + enable(debugEnvVariable); + } + debugObj = Object.assign((namespace) => { + return createDebugger(namespace); + }, { + enable, + enabled, + disable, + log }); - AbortError2.prototype = Object.create(Error.prototype); - AbortError2.prototype.constructor = AbortError2; - AbortError2.prototype.name = "AbortError"; - URL$1 = Url.URL || whatwgUrl.URL; - PassThrough$1 = Stream.PassThrough; - isDomainOrSubdomain = function isDomainOrSubdomain2(destination, original) { - const orig = new URL$1(original).hostname; - const dest = new URL$1(destination).hostname; - return orig === dest || orig[orig.length - dest.length - 1] === "." && orig.endsWith(dest); - }; - isSameProtocol = function isSameProtocol2(destination, original) { - const orig = new URL$1(original).protocol; - const dest = new URL$1(destination).protocol; - return orig === dest; + debug_default = debugObj; + } +}); + +// node_modules/@azure/logger/dist-esm/src/index.js +function setLogLevel(level) { + if (level && !isAzureLogLevel(level)) { + throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); + } + azureLogLevel = level; + const enabledNamespaces2 = []; + for (const logger4 of registeredLoggers) { + if (shouldEnable(logger4)) { + enabledNamespaces2.push(logger4.namespace); + } + } + debug_default.enable(enabledNamespaces2.join(",")); +} +function createClientLogger(namespace) { + const clientRootLogger = AzureLogger.extend(namespace); + patchLogMethod(AzureLogger, clientRootLogger); + return { + error: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose") + }; +} +function patchLogMethod(parent, child) { + child.log = (...args) => { + parent.log(...args); + }; +} +function createLogger(parent, level) { + const logger4 = Object.assign(parent.extend(level), { + level + }); + patchLogMethod(parent, logger4); + if (shouldEnable(logger4)) { + const enabledNamespaces2 = debug_default.disable(); + debug_default.enable(enabledNamespaces2 + "," + logger4.namespace); + } + registeredLoggers.add(logger4); + return logger4; +} +function shouldEnable(logger4) { + return Boolean(azureLogLevel && levelMap[logger4.level] <= levelMap[azureLogLevel]); +} +function isAzureLogLevel(logLevel) { + return AZURE_LOG_LEVELS.includes(logLevel); +} +var registeredLoggers, logLevelFromEnv, azureLogLevel, AzureLogger, AZURE_LOG_LEVELS, levelMap; +var init_src = __esm({ + "node_modules/@azure/logger/dist-esm/src/index.js"() { + init_debug(); + registeredLoggers = /* @__PURE__ */ new Set(); + logLevelFromEnv = typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL || void 0; + AzureLogger = debug_default("azure"); + AzureLogger.log = (...args) => { + debug_default.log(...args); }; - fetch.isRedirect = function(code) { - return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; + AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; + if (logLevelFromEnv) { + if (isAzureLogLevel(logLevelFromEnv)) { + setLogLevel(logLevelFromEnv); + } else { + console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); + } + } + levelMap = { + verbose: 400, + info: 300, + warning: 200, + error: 100 }; - fetch.Promise = global.Promise; - lib_default = fetch; + } +}); + +// node_modules/@azure/core-http/dist-esm/src/log.js +var logger; +var init_log2 = __esm({ + "node_modules/@azure/core-http/dist-esm/src/log.js"() { + init_src(); + logger = createClientLogger("core-http"); } }); // node_modules/@azure/core-http/dist-esm/src/nodeFetchHttpClient.js import * as http2 from "http"; import * as https2 from "https"; -import { Transform as Transform2 } from "stream"; +import { Transform } from "stream"; function getCachedAgent(isHttps, agentCache) { return isHttps ? agentCache.httpsAgent : agentCache.httpAgent; } @@ -22762,7 +37273,7 @@ var init_nodeFetchHttpClient = __esm({ init_restError(); init_log2(); init_lib(); - ReportTransform = class extends Transform2 { + ReportTransform = class extends Transform { constructor(progressCallback) { super(); this.progressCallback = progressCallback; @@ -22790,7 +37301,7 @@ var init_nodeFetchHttpClient = __esm({ if (!httpRequest && typeof httpRequest !== "object") { throw new Error("'httpRequest' (WebResourceLike) cannot be null or undefined and must be of type object."); } - const abortController = new AbortController(); + const abortController = new AbortController2(); let abortListener; if (httpRequest.abortSignal) { if (httpRequest.abortSignal.aborted) { @@ -27344,6 +41855,9 @@ var require_sax = __commonJS({ Stream2 = function() { }; } + if (!Stream2) + Stream2 = function() { + }; var streamWraps = sax.EVENTS.filter(function(ev) { return ev !== "error" && ev !== "end"; }); @@ -28553,9 +43067,16 @@ var require_sax = __commonJS({ break; } if (c2 === ";") { - parser[buffer] += parseEntity(parser); - parser.entity = ""; - parser.state = returnState; + if (parser.opt.unparsedEntities) { + var parsedEntity = parseEntity(parser); + parser.entity = ""; + parser.state = returnState; + parser.write(parsedEntity); + } else { + parser[buffer] += parseEntity(parser); + parser.entity = ""; + parser.state = returnState; + } } else if (isMatch(parser.entity.length ? entityBody : entityStart, c2)) { parser.entity += c2; } else { @@ -28565,8 +43086,9 @@ var require_sax = __commonJS({ parser.state = returnState; } continue; - default: + default: { throw new Error(parser, "Unknown state: " + parser.state); + } } } if (parser.position >= parser.bufferCheckPosition) { @@ -29219,11 +43741,11 @@ function shouldDeserializeResponse(parsedResponse) { return result; } function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options = {}) { - var _a2, _b, _c; + var _a2, _b2, _c2; const updatedOptions = { rootName: (_a2 = options.rootName) !== null && _a2 !== void 0 ? _a2 : "", - includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY + includeRoot: (_b2 = options.includeRoot) !== null && _b2 !== void 0 ? _b2 : false, + xmlCharKey: (_c2 = options.xmlCharKey) !== null && _c2 !== void 0 ? _c2 : XML_CHARKEY }; return parse2(jsonContentTypes, xmlContentTypes, response, updatedOptions).then((parsedResponse) => { if (!shouldDeserializeResponse(parsedResponse)) { @@ -29486,14 +44008,6 @@ var init_exponentialBackoffStrategy = __esm({ } }); -// node_modules/@azure/core-util/dist-esm/src/isNode.js -var _a, isNode; -var init_isNode = __esm({ - "node_modules/@azure/core-util/dist-esm/src/isNode.js"() { - isNode = typeof process !== "undefined" && Boolean(process.version) && Boolean((_a = process.versions) === null || _a === void 0 ? void 0 : _a.node); - } -}); - // node_modules/@azure/core-util/dist-esm/src/createAbortablePromise.js function createAbortablePromise(buildPromise, options) { const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; @@ -29552,11 +44066,24 @@ var init_delay = __esm({ } }); +// node_modules/@azure/core-util/dist-esm/src/checkEnvironment.js +var _a, _b, _c, _d, isBrowser, isWebWorker, isNode, isDeno, isBun, isReactNative; +var init_checkEnvironment = __esm({ + "node_modules/@azure/core-util/dist-esm/src/checkEnvironment.js"() { + isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; + isWebWorker = typeof self === "object" && typeof (self === null || self === void 0 ? void 0 : self.importScripts) === "function" && (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "SharedWorkerGlobalScope"); + isNode = typeof process !== "undefined" && Boolean(process.version) && Boolean((_d = process.versions) === null || _d === void 0 ? void 0 : _d.node); + isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined"; + isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined"; + isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; + } +}); + // node_modules/@azure/core-util/dist-esm/src/index.js var init_src2 = __esm({ "node_modules/@azure/core-util/dist-esm/src/index.js"() { - init_isNode(); init_delay(); + init_checkEnvironment(); } }); @@ -30480,7 +45007,7 @@ var init_platform = __esm({ var VERSION; var init_version2 = __esm({ "node_modules/@opentelemetry/api/build/esm/version.js"() { - VERSION = "1.4.1"; + VERSION = "1.6.0"; } }); @@ -30580,13 +45107,13 @@ function registerGlobal(type3, instance, diag, allowOverride) { diag.debug("@opentelemetry/api: Registered a global for " + type3 + " v" + VERSION + "."); return true; } -function getGlobal2(type3) { - var _a2, _b; +function getGlobal(type3) { + var _a2, _b2; var globalVersion = (_a2 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a2 === void 0 ? void 0 : _a2.version; if (!globalVersion || !isCompatible(globalVersion)) { return; } - return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type3]; + return (_b2 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b2 === void 0 ? void 0 : _b2[type3]; } function unregisterGlobal(type3, diag) { diag.debug("@opentelemetry/api: Unregistering a global for " + type3 + " v" + VERSION + "."); @@ -30609,14 +45136,14 @@ var init_global_utils = __esm({ // node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js function logProxy(funcName, namespace, args) { - var logger4 = getGlobal2("diag"); + var logger4 = getGlobal("diag"); if (!logger4) { return; } args.unshift(namespace); - return logger4[funcName].apply(logger4, __spreadArray2([], __read(args), false)); + return logger4[funcName].apply(logger4, __spreadArray([], __read(args), false)); } -var __read, __spreadArray2, DiagComponentLogger; +var __read, __spreadArray, DiagComponentLogger; var init_ComponentLogger = __esm({ "node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js"() { init_global_utils(); @@ -30641,7 +45168,7 @@ var init_ComponentLogger = __esm({ } return ar2; }; - __spreadArray2 = function(to2, from, pack) { + __spreadArray = function(to2, from, pack) { if (pack || arguments.length === 2) for (var i2 = 0, l2 = from.length, ar2; i2 < l2; i2++) { if (ar2 || !(i2 in from)) { @@ -30744,7 +45271,7 @@ var init_logLevelLogger = __esm({ }); // node_modules/@opentelemetry/api/build/esm/api/diag.js -var __read2, __spreadArray3, API_NAME, DiagAPI; +var __read2, __spreadArray2, API_NAME, DiagAPI; var init_diag = __esm({ "node_modules/@opentelemetry/api/build/esm/api/diag.js"() { init_ComponentLogger(); @@ -30772,7 +45299,7 @@ var init_diag = __esm({ } return ar2; }; - __spreadArray3 = function(to2, from, pack) { + __spreadArray2 = function(to2, from, pack) { if (pack || arguments.length === 2) for (var i2 = 0, l2 = from.length, ar2; i2 < l2; i2++) { if (ar2 || !(i2 in from)) { @@ -30793,15 +45320,15 @@ var init_diag = __esm({ for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } - var logger4 = getGlobal2("diag"); + var logger4 = getGlobal("diag"); if (!logger4) return; - return logger4[funcName].apply(logger4, __spreadArray3([], __read2(args), false)); + return logger4[funcName].apply(logger4, __spreadArray2([], __read2(args), false)); }; } var self2 = this; var setLogger = function(logger4, optionsOrLogLevel) { - var _a2, _b, _c; + var _a2, _b2, _c2; if (optionsOrLogLevel === void 0) { optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }; } @@ -30815,10 +45342,10 @@ var init_diag = __esm({ logLevel: optionsOrLogLevel }; } - var oldLogger = getGlobal2("diag"); - var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger4); + var oldLogger = getGlobal("diag"); + var newLogger = createLogLevelDiagLogger((_b2 = optionsOrLogLevel.logLevel) !== null && _b2 !== void 0 ? _b2 : DiagLogLevel.INFO, logger4); if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) { - var stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : ""; + var stack = (_c2 = new Error().stack) !== null && _c2 !== void 0 ? _c2 : ""; oldLogger.warn("Current logger will be overwritten from " + stack); newLogger.warn("Current logger will overwrite one already registered from " + stack); } @@ -30881,7 +45408,7 @@ var init_context = __esm({ }); // node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js -var __read3, __spreadArray4, NoopContextManager; +var __read3, __spreadArray3, NoopContextManager; var init_NoopContextManager = __esm({ "node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js"() { init_context(); @@ -30906,7 +45433,7 @@ var init_NoopContextManager = __esm({ } return ar2; }; - __spreadArray4 = function(to2, from, pack) { + __spreadArray3 = function(to2, from, pack) { if (pack || arguments.length === 2) for (var i2 = 0, l2 = from.length, ar2; i2 < l2; i2++) { if (ar2 || !(i2 in from)) { @@ -30929,7 +45456,7 @@ var init_NoopContextManager = __esm({ for (var _i = 3; _i < arguments.length; _i++) { args[_i - 3] = arguments[_i]; } - return fn2.call.apply(fn2, __spreadArray4([thisArg], __read3(args), false)); + return fn2.call.apply(fn2, __spreadArray3([thisArg], __read3(args), false)); }; NoopContextManager2.prototype.bind = function(_context, target) { return target; @@ -30946,7 +45473,7 @@ var init_NoopContextManager = __esm({ }); // node_modules/@opentelemetry/api/build/esm/api/context.js -var __read4, __spreadArray5, API_NAME2, NOOP_CONTEXT_MANAGER, ContextAPI; +var __read4, __spreadArray4, API_NAME2, NOOP_CONTEXT_MANAGER, ContextAPI; var init_context2 = __esm({ "node_modules/@opentelemetry/api/build/esm/api/context.js"() { init_NoopContextManager(); @@ -30973,7 +45500,7 @@ var init_context2 = __esm({ } return ar2; }; - __spreadArray5 = function(to2, from, pack) { + __spreadArray4 = function(to2, from, pack) { if (pack || arguments.length === 2) for (var i2 = 0, l2 = from.length, ar2; i2 < l2; i2++) { if (ar2 || !(i2 in from)) { @@ -31008,13 +45535,13 @@ var init_context2 = __esm({ for (var _i = 3; _i < arguments.length; _i++) { args[_i - 3] = arguments[_i]; } - return (_a2 = this._getContextManager()).with.apply(_a2, __spreadArray5([context3, fn2, thisArg], __read4(args), false)); + return (_a2 = this._getContextManager()).with.apply(_a2, __spreadArray4([context3, fn2, thisArg], __read4(args), false)); }; ContextAPI2.prototype.bind = function(context3, target) { return this._getContextManager().bind(context3, target); }; ContextAPI2.prototype._getContextManager = function() { - return getGlobal2(API_NAME2) || NOOP_CONTEXT_MANAGER; + return getGlobal(API_NAME2) || NOOP_CONTEXT_MANAGER; }; ContextAPI2.prototype.disable = function() { this._getContextManager().disable(); @@ -31335,7 +45862,7 @@ var init_trace = __esm({ return success; }; TraceAPI2.prototype.getTracerProvider = function() { - return getGlobal2(API_NAME3) || this._proxyTracerProvider; + return getGlobal(API_NAME3) || this._proxyTracerProvider; }; TraceAPI2.prototype.getTracer = function(name2, version4) { return this.getTracerProvider().getTracer(name2, version4); @@ -31378,7 +45905,7 @@ function getTracer(name2, version4) { return trace.getTracer(name2 || "azure/core-tracing", version4); } var SpanKind, context2, SpanStatusCode; -var init_interfaces2 = __esm({ +var init_interfaces = __esm({ "node_modules/@azure/core-tracing/dist-esm/src/interfaces.js"() { init_esm(); (function(SpanKind2) { @@ -31438,7 +45965,7 @@ function createSpanFunction(args) { } var init_createSpan = __esm({ "node_modules/@azure/core-tracing/dist-esm/src/createSpan.js"() { - init_interfaces2(); + init_interfaces(); init_esm(); } }); @@ -31471,7 +45998,7 @@ var init_traceParentHeader = __esm({ var init_src4 = __esm({ "node_modules/@azure/core-tracing/dist-esm/src/index.js"() { init_createSpan(); - init_interfaces2(); + init_interfaces(); init_traceParentHeader(); } }); @@ -31591,11 +46118,11 @@ var init_tracingPolicy = __esm({ // node_modules/@azure/core-http/dist-esm/src/serviceClient.js function serializeRequestBody(serviceClient, httpRequest, operationArguments, operationSpec) { - var _a2, _b, _c, _d, _e2, _f; - const serializerOptions = (_b = (_a2 = operationArguments.options) === null || _a2 === void 0 ? void 0 : _a2.serializerOptions) !== null && _b !== void 0 ? _b : {}; + var _a2, _b2, _c2, _d2, _e2, _f; + const serializerOptions = (_b2 = (_a2 = operationArguments.options) === null || _a2 === void 0 ? void 0 : _a2.serializerOptions) !== null && _b2 !== void 0 ? _b2 : {}; const updatedOptions = { - rootName: (_c = serializerOptions.rootName) !== null && _c !== void 0 ? _c : "", - includeRoot: (_d = serializerOptions.includeRoot) !== null && _d !== void 0 ? _d : false, + rootName: (_c2 = serializerOptions.rootName) !== null && _c2 !== void 0 ? _c2 : "", + includeRoot: (_d2 = serializerOptions.includeRoot) !== null && _d2 !== void 0 ? _d2 : false, xmlCharKey: (_e2 = serializerOptions.xmlCharKey) !== null && _e2 !== void 0 ? _e2 : XML_CHARKEY }; const xmlCharKey = serializerOptions.xmlCharKey; @@ -33577,7 +48104,8 @@ var init_mappers = __esm({ name: "Enum", allowedValues: [ "rehydrate-pending-to-hot", - "rehydrate-pending-to-cool" + "rehydrate-pending-to-cool", + "rehydrate-pending-to-cold" ] } }, @@ -40565,7 +55093,7 @@ var init_parameters = __esm({ version2 = { parameterPath: "version", mapper: { - defaultValue: "2023-01-03", + defaultValue: "2023-08-03", isConstant: true, serializedName: "x-ms-version", type: { @@ -41398,204 +55926,651 @@ var init_parameters = __esm({ } } }; - comp14 = { - parameterPath: "comp", + comp14 = { + parameterPath: "comp", + mapper: { + defaultValue: "snapshot", + isConstant: true, + serializedName: "comp", + type: { + name: "String" + } + } + }; + tier = { + parameterPath: ["options", "tier"], + mapper: { + serializedName: "x-ms-access-tier", + xmlName: "x-ms-access-tier", + type: { + name: "Enum", + allowedValues: [ + "P4", + "P6", + "P10", + "P15", + "P20", + "P30", + "P40", + "P50", + "P60", + "P70", + "P80", + "Hot", + "Cool", + "Archive", + "Cold" + ] + } + } + }; + rehydratePriority = { + parameterPath: ["options", "rehydratePriority"], + mapper: { + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", + type: { + name: "Enum", + allowedValues: ["High", "Standard"] + } + } + }; + sourceIfModifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfModifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-modified-since", + xmlName: "x-ms-source-if-modified-since", + type: { + name: "DateTimeRfc1123" + } + } + }; + sourceIfUnmodifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfUnmodifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-unmodified-since", + xmlName: "x-ms-source-if-unmodified-since", + type: { + name: "DateTimeRfc1123" + } + } + }; + sourceIfMatch = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], + mapper: { + serializedName: "x-ms-source-if-match", + xmlName: "x-ms-source-if-match", + type: { + name: "String" + } + } + }; + sourceIfNoneMatch = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfNoneMatch" + ], + mapper: { + serializedName: "x-ms-source-if-none-match", + xmlName: "x-ms-source-if-none-match", + type: { + name: "String" + } + } + }; + sourceIfTags = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], + mapper: { + serializedName: "x-ms-source-if-tags", + xmlName: "x-ms-source-if-tags", + type: { + name: "String" + } + } + }; + copySource = { + parameterPath: "copySource", + mapper: { + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", + type: { + name: "String" + } + } + }; + blobTagsString = { + parameterPath: ["options", "blobTagsString"], + mapper: { + serializedName: "x-ms-tags", + xmlName: "x-ms-tags", + type: { + name: "String" + } + } + }; + sealBlob = { + parameterPath: ["options", "sealBlob"], + mapper: { + serializedName: "x-ms-seal-blob", + xmlName: "x-ms-seal-blob", + type: { + name: "Boolean" + } + } + }; + legalHold1 = { + parameterPath: ["options", "legalHold"], + mapper: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", + type: { + name: "Boolean" + } + } + }; + xMsRequiresSync = { + parameterPath: "xMsRequiresSync", + mapper: { + defaultValue: "true", + isConstant: true, + serializedName: "x-ms-requires-sync", + type: { + name: "String" + } + } + }; + sourceContentMD5 = { + parameterPath: ["options", "sourceContentMD5"], + mapper: { + serializedName: "x-ms-source-content-md5", + xmlName: "x-ms-source-content-md5", + type: { + name: "ByteArray" + } + } + }; + copySourceAuthorization = { + parameterPath: ["options", "copySourceAuthorization"], + mapper: { + serializedName: "x-ms-copy-source-authorization", + xmlName: "x-ms-copy-source-authorization", + type: { + name: "String" + } + } + }; + copySourceTags = { + parameterPath: ["options", "copySourceTags"], + mapper: { + serializedName: "x-ms-copy-source-tag-option", + xmlName: "x-ms-copy-source-tag-option", + type: { + name: "Enum", + allowedValues: ["REPLACE", "COPY"] + } + } + }; + comp15 = { + parameterPath: "comp", + mapper: { + defaultValue: "copy", + isConstant: true, + serializedName: "comp", + type: { + name: "String" + } + } + }; + copyActionAbortConstant = { + parameterPath: "copyActionAbortConstant", + mapper: { + defaultValue: "abort", + isConstant: true, + serializedName: "x-ms-copy-action", + type: { + name: "String" + } + } + }; + copyId = { + parameterPath: "copyId", + mapper: { + serializedName: "copyid", + required: true, + xmlName: "copyid", + type: { + name: "String" + } + } + }; + comp16 = { + parameterPath: "comp", + mapper: { + defaultValue: "tier", + isConstant: true, + serializedName: "comp", + type: { + name: "String" + } + } + }; + tier1 = { + parameterPath: "tier", + mapper: { + serializedName: "x-ms-access-tier", + required: true, + xmlName: "x-ms-access-tier", + type: { + name: "Enum", + allowedValues: [ + "P4", + "P6", + "P10", + "P15", + "P20", + "P30", + "P40", + "P50", + "P60", + "P70", + "P80", + "Hot", + "Cool", + "Archive", + "Cold" + ] + } + } + }; + queryRequest = { + parameterPath: ["options", "queryRequest"], + mapper: QueryRequest + }; + comp17 = { + parameterPath: "comp", + mapper: { + defaultValue: "query", + isConstant: true, + serializedName: "comp", + type: { + name: "String" + } + } + }; + comp18 = { + parameterPath: "comp", + mapper: { + defaultValue: "tags", + isConstant: true, + serializedName: "comp", + type: { + name: "String" + } + } + }; + tags = { + parameterPath: ["options", "tags"], + mapper: BlobTags + }; + transactionalContentMD5 = { + parameterPath: ["options", "transactionalContentMD5"], + mapper: { + serializedName: "Content-MD5", + xmlName: "Content-MD5", + type: { + name: "ByteArray" + } + } + }; + transactionalContentCrc64 = { + parameterPath: ["options", "transactionalContentCrc64"], + mapper: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", + type: { + name: "ByteArray" + } + } + }; + blobType = { + parameterPath: "blobType", + mapper: { + defaultValue: "PageBlob", + isConstant: true, + serializedName: "x-ms-blob-type", + type: { + name: "String" + } + } + }; + blobContentLength = { + parameterPath: "blobContentLength", + mapper: { + serializedName: "x-ms-blob-content-length", + required: true, + xmlName: "x-ms-blob-content-length", + type: { + name: "Number" + } + } + }; + blobSequenceNumber = { + parameterPath: ["options", "blobSequenceNumber"], + mapper: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", + type: { + name: "Number" + } + } + }; + contentType1 = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/octet-stream", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } + }; + body1 = { + parameterPath: "body", + mapper: { + serializedName: "body", + required: true, + xmlName: "body", + type: { + name: "Stream" + } + } + }; + accept2 = { + parameterPath: "accept", + mapper: { + defaultValue: "application/xml", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } + }; + comp19 = { + parameterPath: "comp", + mapper: { + defaultValue: "page", + isConstant: true, + serializedName: "comp", + type: { + name: "String" + } + } + }; + pageWrite = { + parameterPath: "pageWrite", + mapper: { + defaultValue: "update", + isConstant: true, + serializedName: "x-ms-page-write", + type: { + name: "String" + } + } + }; + ifSequenceNumberLessThanOrEqualTo = { + parameterPath: [ + "options", + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThanOrEqualTo" + ], + mapper: { + serializedName: "x-ms-if-sequence-number-le", + xmlName: "x-ms-if-sequence-number-le", + type: { + name: "Number" + } + } + }; + ifSequenceNumberLessThan = { + parameterPath: [ + "options", + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThan" + ], + mapper: { + serializedName: "x-ms-if-sequence-number-lt", + xmlName: "x-ms-if-sequence-number-lt", + type: { + name: "Number" + } + } + }; + ifSequenceNumberEqualTo = { + parameterPath: [ + "options", + "sequenceNumberAccessConditions", + "ifSequenceNumberEqualTo" + ], + mapper: { + serializedName: "x-ms-if-sequence-number-eq", + xmlName: "x-ms-if-sequence-number-eq", + type: { + name: "Number" + } + } + }; + pageWrite1 = { + parameterPath: "pageWrite", + mapper: { + defaultValue: "clear", + isConstant: true, + serializedName: "x-ms-page-write", + type: { + name: "String" + } + } + }; + sourceUrl = { + parameterPath: "sourceUrl", + mapper: { + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", + type: { + name: "String" + } + } + }; + sourceRange = { + parameterPath: "sourceRange", mapper: { - defaultValue: "snapshot", - isConstant: true, - serializedName: "comp", + serializedName: "x-ms-source-range", + required: true, + xmlName: "x-ms-source-range", type: { name: "String" } } }; - tier = { - parameterPath: ["options", "tier"], + sourceContentCrc64 = { + parameterPath: ["options", "sourceContentCrc64"], mapper: { - serializedName: "x-ms-access-tier", - xmlName: "x-ms-access-tier", + serializedName: "x-ms-source-content-crc64", + xmlName: "x-ms-source-content-crc64", type: { - name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] + name: "ByteArray" } } }; - rehydratePriority = { - parameterPath: ["options", "rehydratePriority"], + range1 = { + parameterPath: "range", mapper: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", + serializedName: "x-ms-range", + required: true, + xmlName: "x-ms-range", type: { - name: "Enum", - allowedValues: ["High", "Standard"] + name: "String" } } }; - sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" - ], + comp20 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-source-if-modified-since", - xmlName: "x-ms-source-if-modified-since", + defaultValue: "pagelist", + isConstant: true, + serializedName: "comp", type: { - name: "DateTimeRfc1123" + name: "String" } } }; - sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" - ], + prevsnapshot = { + parameterPath: ["options", "prevsnapshot"], mapper: { - serializedName: "x-ms-source-if-unmodified-since", - xmlName: "x-ms-source-if-unmodified-since", + serializedName: "prevsnapshot", + xmlName: "prevsnapshot", type: { - name: "DateTimeRfc1123" + name: "String" } } }; - sourceIfMatch = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], + prevSnapshotUrl = { + parameterPath: ["options", "prevSnapshotUrl"], mapper: { - serializedName: "x-ms-source-if-match", - xmlName: "x-ms-source-if-match", + serializedName: "x-ms-previous-snapshot-url", + xmlName: "x-ms-previous-snapshot-url", type: { name: "String" } } }; - sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" - ], + sequenceNumberAction = { + parameterPath: "sequenceNumberAction", mapper: { - serializedName: "x-ms-source-if-none-match", - xmlName: "x-ms-source-if-none-match", + serializedName: "x-ms-sequence-number-action", + required: true, + xmlName: "x-ms-sequence-number-action", type: { - name: "String" + name: "Enum", + allowedValues: ["max", "update", "increment"] } } }; - sourceIfTags = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], + comp21 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-source-if-tags", - xmlName: "x-ms-source-if-tags", + defaultValue: "incrementalcopy", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; - copySource = { - parameterPath: "copySource", + blobType1 = { + parameterPath: "blobType", mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", + defaultValue: "AppendBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { name: "String" } } }; - blobTagsString = { - parameterPath: ["options", "blobTagsString"], + comp22 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-tags", - xmlName: "x-ms-tags", + defaultValue: "appendblock", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; - sealBlob = { - parameterPath: ["options", "sealBlob"], + maxSize = { + parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], mapper: { - serializedName: "x-ms-seal-blob", - xmlName: "x-ms-seal-blob", + serializedName: "x-ms-blob-condition-maxsize", + xmlName: "x-ms-blob-condition-maxsize", type: { - name: "Boolean" + name: "Number" } } }; - legalHold1 = { - parameterPath: ["options", "legalHold"], + appendPosition = { + parameterPath: [ + "options", + "appendPositionAccessConditions", + "appendPosition" + ], mapper: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + serializedName: "x-ms-blob-condition-appendpos", + xmlName: "x-ms-blob-condition-appendpos", type: { - name: "Boolean" + name: "Number" } } }; - xMsRequiresSync = { - parameterPath: "xMsRequiresSync", + sourceRange1 = { + parameterPath: ["options", "sourceRange"], mapper: { - defaultValue: "true", - isConstant: true, - serializedName: "x-ms-requires-sync", + serializedName: "x-ms-source-range", + xmlName: "x-ms-source-range", type: { name: "String" } } }; - sourceContentMD5 = { - parameterPath: ["options", "sourceContentMD5"], + comp23 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-source-content-md5", - xmlName: "x-ms-source-content-md5", + defaultValue: "seal", + isConstant: true, + serializedName: "comp", type: { - name: "ByteArray" + name: "String" } } }; - copySourceAuthorization = { - parameterPath: ["options", "copySourceAuthorization"], + blobType2 = { + parameterPath: "blobType", mapper: { - serializedName: "x-ms-copy-source-authorization", - xmlName: "x-ms-copy-source-authorization", + defaultValue: "BlockBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { name: "String" } } }; - copySourceTags = { - parameterPath: ["options", "copySourceTags"], + copySourceBlobProperties = { + parameterPath: ["options", "copySourceBlobProperties"], mapper: { - serializedName: "x-ms-copy-source-tag-option", - xmlName: "x-ms-copy-source-tag-option", + serializedName: "x-ms-copy-source-blob-properties", + xmlName: "x-ms-copy-source-blob-properties", type: { - name: "Enum", - allowedValues: ["REPLACE", "COPY"] + name: "Boolean" } } }; - comp15 = { + comp24 = { parameterPath: "comp", mapper: { - defaultValue: "copy", + defaultValue: "block", isConstant: true, serializedName: "comp", type: { @@ -41603,32 +56578,25 @@ var init_parameters = __esm({ } } }; - copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", - mapper: { - defaultValue: "abort", - isConstant: true, - serializedName: "x-ms-copy-action", - type: { - name: "String" - } - } - }; - copyId = { - parameterPath: "copyId", + blockId = { + parameterPath: "blockId", mapper: { - serializedName: "copyid", + serializedName: "blockid", required: true, - xmlName: "copyid", + xmlName: "blockid", type: { name: "String" } } }; - comp16 = { + blocks = { + parameterPath: "blocks", + mapper: BlockLookupList + }; + comp25 = { parameterPath: "comp", mapper: { - defaultValue: "tier", + defaultValue: "blocklist", isConstant: true, serializedName: "comp", type: { @@ -41636,535 +56604,1406 @@ var init_parameters = __esm({ } } }; - tier1 = { - parameterPath: "tier", + listType = { + parameterPath: "listType", mapper: { - serializedName: "x-ms-access-tier", + defaultValue: "committed", + serializedName: "blocklisttype", required: true, - xmlName: "x-ms-access-tier", + xmlName: "blocklisttype", type: { name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] + allowedValues: ["committed", "uncommitted", "all"] } } }; - queryRequest = { - parameterPath: ["options", "queryRequest"], - mapper: QueryRequest + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/service.js +var Service, xmlSerializer, setPropertiesOperationSpec, getPropertiesOperationSpec, getStatisticsOperationSpec, listContainersSegmentOperationSpec, getUserDelegationKeyOperationSpec, getAccountInfoOperationSpec, submitBatchOperationSpec, filterBlobsOperationSpec; +var init_service = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/service.js"() { + init_src5(); + init_mappers(); + init_parameters(); + Service = class { + /** + * Initialize a new instance of the class Service class. + * @param client Reference to the service client + */ + constructor(client) { + this.client = client; + } + /** + * Sets properties for a storage account's Blob service endpoint, including properties for Storage + * Analytics and CORS (Cross-Origin Resource Sharing) rules + * @param blobServiceProperties The StorageService properties. + * @param options The options parameters. + */ + setProperties(blobServiceProperties2, options) { + const operationArguments = { + blobServiceProperties: blobServiceProperties2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setPropertiesOperationSpec); + } + /** + * gets the properties of a storage account's Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @param options The options parameters. + */ + getProperties(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec); + } + /** + * Retrieves statistics related to replication for the Blob service. It is only available on the + * secondary location endpoint when read-access geo-redundant replication is enabled for the storage + * account. + * @param options The options parameters. + */ + getStatistics(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getStatisticsOperationSpec); + } + /** + * The List Containers Segment operation returns a list of the containers under the specified account + * @param options The options parameters. + */ + listContainersSegment(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, listContainersSegmentOperationSpec); + } + /** + * Retrieves a user delegation key for the Blob service. This is only a valid operation when using + * bearer token authentication. + * @param keyInfo Key information + * @param options The options parameters. + */ + getUserDelegationKey(keyInfo2, options) { + const operationArguments = { + keyInfo: keyInfo2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getUserDelegationKeyOperationSpec); + } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec); + } + /** + * The Batch operation allows multiple API calls to be embedded into a single HTTP request. + * @param contentLength The length of the request. + * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch + * boundary. Example header value: multipart/mixed; boundary=batch_ + * @param body Initial data + * @param options The options parameters. + */ + submitBatch(contentLength2, multipartContentType2, body2, options) { + const operationArguments = { + contentLength: contentLength2, + multipartContentType: multipartContentType2, + body: body2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec); + } + /** + * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a + * given search expression. Filter blobs searches across all containers within a storage account but + * can be scoped within the expression to a single container. + * @param options The options parameters. + */ + filterBlobs(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec); + } + }; + xmlSerializer = new Serializer( + mappers_exports, + /* isXml */ + true + ); + setPropertiesOperationSpec = { + path: "/", + httpMethod: "PUT", + responses: { + 202: { + headersMapper: ServiceSetPropertiesHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ServiceSetPropertiesExceptionHeaders + } + }, + requestBody: blobServiceProperties, + queryParameters: [ + restype, + comp, + timeoutInSeconds + ], + urlParameters: [url], + headerParameters: [ + contentType, + accept, + version2, + requestId + ], + isXML: true, + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer + }; + getPropertiesOperationSpec = { + path: "/", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: BlobServiceProperties, + headersMapper: ServiceGetPropertiesHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ServiceGetPropertiesExceptionHeaders + } + }, + queryParameters: [ + restype, + comp, + timeoutInSeconds + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1 + ], + isXML: true, + serializer: xmlSerializer + }; + getStatisticsOperationSpec = { + path: "/", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: BlobServiceStatistics, + headersMapper: ServiceGetStatisticsHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ServiceGetStatisticsExceptionHeaders + } + }, + queryParameters: [ + restype, + timeoutInSeconds, + comp1 + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1 + ], + isXML: true, + serializer: xmlSerializer + }; + listContainersSegmentOperationSpec = { + path: "/", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: ListContainersSegmentResponse, + headersMapper: ServiceListContainersSegmentHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ServiceListContainersSegmentExceptionHeaders + } + }, + queryParameters: [ + timeoutInSeconds, + comp2, + prefix, + marker, + maxPageSize, + include + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1 + ], + isXML: true, + serializer: xmlSerializer + }; + getUserDelegationKeyOperationSpec = { + path: "/", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: UserDelegationKey, + headersMapper: ServiceGetUserDelegationKeyHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ServiceGetUserDelegationKeyExceptionHeaders + } + }, + requestBody: keyInfo, + queryParameters: [ + restype, + timeoutInSeconds, + comp3 + ], + urlParameters: [url], + headerParameters: [ + contentType, + accept, + version2, + requestId + ], + isXML: true, + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer }; - comp17 = { - parameterPath: "comp", - mapper: { - defaultValue: "query", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + getAccountInfoOperationSpec = { + path: "/", + httpMethod: "GET", + responses: { + 200: { + headersMapper: ServiceGetAccountInfoHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ServiceGetAccountInfoExceptionHeaders } - } + }, + queryParameters: [comp, restype1], + urlParameters: [url], + headerParameters: [version2, accept1], + isXML: true, + serializer: xmlSerializer }; - comp18 = { - parameterPath: "comp", - mapper: { - defaultValue: "tags", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + submitBatchOperationSpec = { + path: "/", + httpMethod: "POST", + responses: { + 202: { + bodyMapper: { + type: { name: "Stream" }, + serializedName: "parsedResponse" + }, + headersMapper: ServiceSubmitBatchHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ServiceSubmitBatchExceptionHeaders } - } - }; - tags = { - parameterPath: ["options", "tags"], - mapper: BlobTags + }, + requestBody: body, + queryParameters: [timeoutInSeconds, comp4], + urlParameters: [url], + headerParameters: [ + contentType, + accept, + version2, + requestId, + contentLength, + multipartContentType + ], + isXML: true, + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer }; - transactionalContentMD5 = { - parameterPath: ["options", "transactionalContentMD5"], - mapper: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" + filterBlobsOperationSpec = { + path: "/", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: FilterBlobSegment, + headersMapper: ServiceFilterBlobsHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ServiceFilterBlobsExceptionHeaders } - } + }, + queryParameters: [ + timeoutInSeconds, + marker, + maxPageSize, + comp5, + where + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1 + ], + isXML: true, + serializer: xmlSerializer }; - transactionalContentCrc64 = { - parameterPath: ["options", "transactionalContentCrc64"], - mapper: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/container.js +var Container, xmlSerializer2, createOperationSpec, getPropertiesOperationSpec2, deleteOperationSpec, setMetadataOperationSpec, getAccessPolicyOperationSpec, setAccessPolicyOperationSpec, restoreOperationSpec, renameOperationSpec, submitBatchOperationSpec2, filterBlobsOperationSpec2, acquireLeaseOperationSpec, releaseLeaseOperationSpec, renewLeaseOperationSpec, breakLeaseOperationSpec, changeLeaseOperationSpec, listBlobFlatSegmentOperationSpec, listBlobHierarchySegmentOperationSpec, getAccountInfoOperationSpec2; +var init_container = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/container.js"() { + init_src5(); + init_mappers(); + init_parameters(); + Container = class { + /** + * Initialize a new instance of the class Container class. + * @param client Reference to the service client + */ + constructor(client) { + this.client = client; } - }; - blobType = { - parameterPath: "blobType", - mapper: { - defaultValue: "PageBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" - } + /** + * creates a new container under the specified account. If the container with the same name already + * exists, the operation fails + * @param options The options parameters. + */ + create(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, createOperationSpec); } - }; - blobContentLength = { - parameterPath: "blobContentLength", - mapper: { - serializedName: "x-ms-blob-content-length", - required: true, - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" - } + /** + * returns all user-defined metadata and system properties for the specified container. The data + * returned does not include the container's list of blobs + * @param options The options parameters. + */ + getProperties(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec2); } - }; - blobSequenceNumber = { - parameterPath: ["options", "blobSequenceNumber"], - mapper: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } + /** + * operation marks the specified container for deletion. The container and any blobs contained within + * it are later deleted during garbage collection + * @param options The options parameters. + */ + delete(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, deleteOperationSpec); } - }; - contentType1 = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/octet-stream", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" - } + /** + * operation sets one or more user-defined name-value pairs for the specified container. + * @param options The options parameters. + */ + setMetadata(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec); } - }; - body1 = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" - } + /** + * gets the permissions for the specified container. The permissions indicate whether container data + * may be accessed publicly. + * @param options The options parameters. + */ + getAccessPolicy(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getAccessPolicyOperationSpec); } - }; - accept2 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" - } + /** + * sets the permissions for the specified container. The permissions indicate whether blobs in a + * container may be accessed publicly. + * @param options The options parameters. + */ + setAccessPolicy(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setAccessPolicyOperationSpec); } - }; - comp19 = { - parameterPath: "comp", - mapper: { - defaultValue: "page", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * Restores a previously-deleted container. + * @param options The options parameters. + */ + restore(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, restoreOperationSpec); } - }; - pageWrite = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "update", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" - } + /** + * Renames an existing container. + * @param sourceContainerName Required. Specifies the name of the container to rename. + * @param options The options parameters. + */ + rename(sourceContainerName2, options) { + const operationArguments = { + sourceContainerName: sourceContainerName2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, renameOperationSpec); } - }; - ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-le", - xmlName: "x-ms-if-sequence-number-le", - type: { - name: "Number" - } + /** + * The Batch operation allows multiple API calls to be embedded into a single HTTP request. + * @param contentLength The length of the request. + * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch + * boundary. Example header value: multipart/mixed; boundary=batch_ + * @param body Initial data + * @param options The options parameters. + */ + submitBatch(contentLength2, multipartContentType2, body2, options) { + const operationArguments = { + contentLength: contentLength2, + multipartContentType: multipartContentType2, + body: body2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec2); } - }; - ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-lt", - xmlName: "x-ms-if-sequence-number-lt", - type: { - name: "Number" - } + /** + * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given + * search expression. Filter blobs searches within the given container. + * @param options The options parameters. + */ + filterBlobs(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec2); } - }; - ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-eq", - xmlName: "x-ms-if-sequence-number-eq", - type: { - name: "Number" - } + /** + * [Update] establishes and manages a lock on a container for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite + * @param options The options parameters. + */ + acquireLease(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec); } - }; - pageWrite1 = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "clear", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" - } + /** + * [Update] establishes and manages a lock on a container for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite + * @param leaseId Specifies the current lease ID on the resource. + * @param options The options parameters. + */ + releaseLease(leaseId2, options) { + const operationArguments = { + leaseId: leaseId2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec); } - }; - sourceUrl = { - parameterPath: "sourceUrl", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" - } + /** + * [Update] establishes and manages a lock on a container for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite + * @param leaseId Specifies the current lease ID on the resource. + * @param options The options parameters. + */ + renewLease(leaseId2, options) { + const operationArguments = { + leaseId: leaseId2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec); } - }; - sourceRange = { - parameterPath: "sourceRange", - mapper: { - serializedName: "x-ms-source-range", - required: true, - xmlName: "x-ms-source-range", - type: { - name: "String" - } + /** + * [Update] establishes and manages a lock on a container for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite + * @param options The options parameters. + */ + breakLease(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec); } - }; - sourceContentCrc64 = { - parameterPath: ["options", "sourceContentCrc64"], - mapper: { - serializedName: "x-ms-source-content-crc64", - xmlName: "x-ms-source-content-crc64", - type: { - name: "ByteArray" - } + /** + * [Update] establishes and manages a lock on a container for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite + * @param leaseId Specifies the current lease ID on the resource. + * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 + * (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor + * (String) for a list of valid GUID string formats. + * @param options The options parameters. + */ + changeLease(leaseId2, proposedLeaseId2, options) { + const operationArguments = { + leaseId: leaseId2, + proposedLeaseId: proposedLeaseId2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec); } - }; - range1 = { - parameterPath: "range", - mapper: { - serializedName: "x-ms-range", - required: true, - xmlName: "x-ms-range", - type: { - name: "String" - } + /** + * [Update] The List Blobs operation returns a list of the blobs under the specified container + * @param options The options parameters. + */ + listBlobFlatSegment(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, listBlobFlatSegmentOperationSpec); } - }; - comp20 = { - parameterPath: "comp", - mapper: { - defaultValue: "pagelist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [Update] The List Blobs operation returns a list of the blobs under the specified container + * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix + * element in the response body that acts as a placeholder for all blobs whose names begin with the + * same substring up to the appearance of the delimiter character. The delimiter may be a single + * character or a string. + * @param options The options parameters. + */ + listBlobHierarchySegment(delimiter2, options) { + const operationArguments = { + delimiter: delimiter2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, listBlobHierarchySegmentOperationSpec); + } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec2); } }; - prevsnapshot = { - parameterPath: ["options", "prevsnapshot"], - mapper: { - serializedName: "prevsnapshot", - xmlName: "prevsnapshot", - type: { - name: "String" + xmlSerializer2 = new Serializer( + mappers_exports, + /* isXml */ + true + ); + createOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: ContainerCreateHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerCreateExceptionHeaders } - } + }, + queryParameters: [timeoutInSeconds, restype2], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + metadata2, + access, + defaultEncryptionScope, + preventEncryptionScopeOverride + ], + isXML: true, + serializer: xmlSerializer2 }; - prevSnapshotUrl = { - parameterPath: ["options", "prevSnapshotUrl"], - mapper: { - serializedName: "x-ms-previous-snapshot-url", - xmlName: "x-ms-previous-snapshot-url", - type: { - name: "String" + getPropertiesOperationSpec2 = { + path: "/{containerName}", + httpMethod: "GET", + responses: { + 200: { + headersMapper: ContainerGetPropertiesHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerGetPropertiesExceptionHeaders } - } + }, + queryParameters: [timeoutInSeconds, restype2], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + leaseId + ], + isXML: true, + serializer: xmlSerializer2 }; - sequenceNumberAction = { - parameterPath: "sequenceNumberAction", - mapper: { - serializedName: "x-ms-sequence-number-action", - required: true, - xmlName: "x-ms-sequence-number-action", - type: { - name: "Enum", - allowedValues: ["max", "update", "increment"] + deleteOperationSpec = { + path: "/{containerName}", + httpMethod: "DELETE", + responses: { + 202: { + headersMapper: ContainerDeleteHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerDeleteExceptionHeaders } - } + }, + queryParameters: [timeoutInSeconds, restype2], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince + ], + isXML: true, + serializer: xmlSerializer2 }; - comp21 = { - parameterPath: "comp", - mapper: { - defaultValue: "incrementalcopy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + setMetadataOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: ContainerSetMetadataHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerSetMetadataExceptionHeaders } - } + }, + queryParameters: [ + timeoutInSeconds, + restype2, + comp6 + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + metadata2, + leaseId, + ifModifiedSince + ], + isXML: true, + serializer: xmlSerializer2 }; - blobType1 = { - parameterPath: "blobType", - mapper: { - defaultValue: "AppendBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + getAccessPolicyOperationSpec = { + path: "/{containerName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: { + type: { + name: "Sequence", + element: { + type: { name: "Composite", className: "SignedIdentifier" } + } + }, + serializedName: "SignedIdentifiers", + xmlName: "SignedIdentifiers", + xmlIsWrapped: true, + xmlElementName: "SignedIdentifier" + }, + headersMapper: ContainerGetAccessPolicyHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerGetAccessPolicyExceptionHeaders } - } + }, + queryParameters: [ + timeoutInSeconds, + restype2, + comp7 + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + leaseId + ], + isXML: true, + serializer: xmlSerializer2 }; - comp22 = { - parameterPath: "comp", - mapper: { - defaultValue: "appendblock", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + setAccessPolicyOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: ContainerSetAccessPolicyHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerSetAccessPolicyExceptionHeaders } - } + }, + requestBody: containerAcl, + queryParameters: [ + timeoutInSeconds, + restype2, + comp7 + ], + urlParameters: [url], + headerParameters: [ + contentType, + accept, + version2, + requestId, + access, + leaseId, + ifModifiedSince, + ifUnmodifiedSince + ], + isXML: true, + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer2 }; - maxSize = { - parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], - mapper: { - serializedName: "x-ms-blob-condition-maxsize", - xmlName: "x-ms-blob-condition-maxsize", - type: { - name: "Number" + restoreOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: ContainerRestoreHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerRestoreExceptionHeaders } - } + }, + queryParameters: [ + timeoutInSeconds, + restype2, + comp8 + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + deletedContainerName, + deletedContainerVersion + ], + isXML: true, + serializer: xmlSerializer2 }; - appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" + renameOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: ContainerRenameHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerRenameExceptionHeaders + } + }, + queryParameters: [ + timeoutInSeconds, + restype2, + comp9 ], - mapper: { - serializedName: "x-ms-blob-condition-appendpos", - xmlName: "x-ms-blob-condition-appendpos", - type: { - name: "Number" + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + sourceContainerName, + sourceLeaseId + ], + isXML: true, + serializer: xmlSerializer2 + }; + submitBatchOperationSpec2 = { + path: "/{containerName}", + httpMethod: "POST", + responses: { + 202: { + bodyMapper: { + type: { name: "Stream" }, + serializedName: "parsedResponse" + }, + headersMapper: ContainerSubmitBatchHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerSubmitBatchExceptionHeaders } - } + }, + requestBody: body, + queryParameters: [ + timeoutInSeconds, + comp4, + restype2 + ], + urlParameters: [url], + headerParameters: [ + contentType, + accept, + version2, + requestId, + contentLength, + multipartContentType + ], + isXML: true, + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer2 }; - sourceRange1 = { - parameterPath: ["options", "sourceRange"], - mapper: { - serializedName: "x-ms-source-range", - xmlName: "x-ms-source-range", - type: { - name: "String" + filterBlobsOperationSpec2 = { + path: "/{containerName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: FilterBlobSegment, + headersMapper: ContainerFilterBlobsHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerFilterBlobsExceptionHeaders } - } + }, + queryParameters: [ + timeoutInSeconds, + marker, + maxPageSize, + comp5, + where, + restype2 + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1 + ], + isXML: true, + serializer: xmlSerializer2 }; - comp23 = { - parameterPath: "comp", - mapper: { - defaultValue: "seal", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + acquireLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: ContainerAcquireLeaseHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerAcquireLeaseExceptionHeaders } - } + }, + queryParameters: [ + timeoutInSeconds, + restype2, + comp10 + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + ifModifiedSince, + ifUnmodifiedSince, + action, + duration, + proposedLeaseId + ], + isXML: true, + serializer: xmlSerializer2 }; - blobType2 = { - parameterPath: "blobType", - mapper: { - defaultValue: "BlockBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + releaseLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: ContainerReleaseLeaseHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerReleaseLeaseExceptionHeaders } - } + }, + queryParameters: [ + timeoutInSeconds, + restype2, + comp10 + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + ifModifiedSince, + ifUnmodifiedSince, + action1, + leaseId1 + ], + isXML: true, + serializer: xmlSerializer2 }; - copySourceBlobProperties = { - parameterPath: ["options", "copySourceBlobProperties"], - mapper: { - serializedName: "x-ms-copy-source-blob-properties", - xmlName: "x-ms-copy-source-blob-properties", - type: { - name: "Boolean" + renewLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: ContainerRenewLeaseHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerRenewLeaseExceptionHeaders } - } + }, + queryParameters: [ + timeoutInSeconds, + restype2, + comp10 + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + ifModifiedSince, + ifUnmodifiedSince, + leaseId1, + action2 + ], + isXML: true, + serializer: xmlSerializer2 }; - comp24 = { - parameterPath: "comp", - mapper: { - defaultValue: "block", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + breakLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 202: { + headersMapper: ContainerBreakLeaseHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerBreakLeaseExceptionHeaders } - } + }, + queryParameters: [ + timeoutInSeconds, + restype2, + comp10 + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + ifModifiedSince, + ifUnmodifiedSince, + action3, + breakPeriod + ], + isXML: true, + serializer: xmlSerializer2 }; - blockId = { - parameterPath: "blockId", - mapper: { - serializedName: "blockid", - required: true, - xmlName: "blockid", - type: { - name: "String" + changeLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: ContainerChangeLeaseHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerChangeLeaseExceptionHeaders } - } + }, + queryParameters: [ + timeoutInSeconds, + restype2, + comp10 + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + ifModifiedSince, + ifUnmodifiedSince, + leaseId1, + action4, + proposedLeaseId1 + ], + isXML: true, + serializer: xmlSerializer2 }; - blocks = { - parameterPath: "blocks", - mapper: BlockLookupList + listBlobFlatSegmentOperationSpec = { + path: "/{containerName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: ListBlobsFlatSegmentResponse, + headersMapper: ContainerListBlobFlatSegmentHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerListBlobFlatSegmentExceptionHeaders + } + }, + queryParameters: [ + timeoutInSeconds, + comp2, + prefix, + marker, + maxPageSize, + restype2, + include1 + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1 + ], + isXML: true, + serializer: xmlSerializer2 }; - comp25 = { - parameterPath: "comp", - mapper: { - defaultValue: "blocklist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + listBlobHierarchySegmentOperationSpec = { + path: "/{containerName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: ListBlobsHierarchySegmentResponse, + headersMapper: ContainerListBlobHierarchySegmentHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders } - } + }, + queryParameters: [ + timeoutInSeconds, + comp2, + prefix, + marker, + maxPageSize, + restype2, + include1, + delimiter + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1 + ], + isXML: true, + serializer: xmlSerializer2 }; - listType = { - parameterPath: "listType", - mapper: { - defaultValue: "committed", - serializedName: "blocklisttype", - required: true, - xmlName: "blocklisttype", - type: { - name: "Enum", - allowedValues: ["committed", "uncommitted", "all"] + getAccountInfoOperationSpec2 = { + path: "/{containerName}", + httpMethod: "GET", + responses: { + 200: { + headersMapper: ContainerGetAccountInfoHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerGetAccountInfoExceptionHeaders } - } + }, + queryParameters: [comp, restype1], + urlParameters: [url], + headerParameters: [version2, accept1], + isXML: true, + serializer: xmlSerializer2 }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/service.js -var Service, xmlSerializer, setPropertiesOperationSpec, getPropertiesOperationSpec, getStatisticsOperationSpec, listContainersSegmentOperationSpec, getUserDelegationKeyOperationSpec, getAccountInfoOperationSpec, submitBatchOperationSpec, filterBlobsOperationSpec; -var init_service = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/service.js"() { +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/blob.js +var Blob3, xmlSerializer3, downloadOperationSpec, getPropertiesOperationSpec3, deleteOperationSpec2, undeleteOperationSpec, setExpiryOperationSpec, setHttpHeadersOperationSpec, setImmutabilityPolicyOperationSpec, deleteImmutabilityPolicyOperationSpec, setLegalHoldOperationSpec, setMetadataOperationSpec2, acquireLeaseOperationSpec2, releaseLeaseOperationSpec2, renewLeaseOperationSpec2, changeLeaseOperationSpec2, breakLeaseOperationSpec2, createSnapshotOperationSpec, startCopyFromURLOperationSpec, copyFromURLOperationSpec, abortCopyFromURLOperationSpec, setTierOperationSpec, getAccountInfoOperationSpec3, queryOperationSpec, getTagsOperationSpec, setTagsOperationSpec; +var init_blob = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/blob.js"() { init_src5(); init_mappers(); init_parameters(); - Service = class { + Blob3 = class { /** - * Initialize a new instance of the class Service class. + * Initialize a new instance of the class Blob class. * @param client Reference to the service client */ constructor(client) { this.client = client; } /** - * Sets properties for a storage account's Blob service endpoint, including properties for Storage - * Analytics and CORS (Cross-Origin Resource Sharing) rules - * @param blobServiceProperties The StorageService properties. + * The Download operation reads or downloads a blob from the system, including its metadata and + * properties. You can also call Download to read a snapshot. * @param options The options parameters. */ - setProperties(blobServiceProperties2, options) { + download(options) { const operationArguments = { - blobServiceProperties: blobServiceProperties2, options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, setPropertiesOperationSpec); + return this.client.sendOperationRequest(operationArguments, downloadOperationSpec); } /** - * gets the properties of a storage account's Blob service, including properties for Storage Analytics - * and CORS (Cross-Origin Resource Sharing) rules. + * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system + * properties for the blob. It does not return the content of the blob. * @param options The options parameters. */ getProperties(options) { const operationArguments = { options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec); + return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec3); } /** - * Retrieves statistics related to replication for the Blob service. It is only available on the - * secondary location endpoint when read-access geo-redundant replication is enabled for the storage - * account. + * If the storage account's soft delete feature is disabled then, when a blob is deleted, it is + * permanently removed from the storage account. If the storage account's soft delete feature is + * enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible + * immediately. However, the blob service retains the blob or snapshot for the number of days specified + * by the DeleteRetentionPolicy section of [Storage service properties] + * (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is + * permanently removed from the storage account. Note that you continue to be charged for the + * soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and specify the + * "include=deleted" query parameter to discover which blobs and snapshots have been soft deleted. You + * can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a + * soft-deleted blob or snapshot causes the service to return an HTTP status code of 404 + * (ResourceNotFound). * @param options The options parameters. */ - getStatistics(options) { + delete(options) { const operationArguments = { options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, getStatisticsOperationSpec); + return this.client.sendOperationRequest(operationArguments, deleteOperationSpec2); } /** - * The List Containers Segment operation returns a list of the containers under the specified account + * Undelete a blob that was previously soft deleted * @param options The options parameters. */ - listContainersSegment(options) { + undelete(options) { const operationArguments = { options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, listContainersSegmentOperationSpec); + return this.client.sendOperationRequest(operationArguments, undeleteOperationSpec); } /** - * Retrieves a user delegation key for the Blob service. This is only a valid operation when using - * bearer token authentication. - * @param keyInfo Key information + * Sets the time a blob will expire and be deleted. + * @param expiryOptions Required. Indicates mode of the expiry time * @param options The options parameters. */ - getUserDelegationKey(keyInfo2, options) { + setExpiry(expiryOptions2, options) { const operationArguments = { - keyInfo: keyInfo2, + expiryOptions: expiryOptions2, options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, getUserDelegationKeyOperationSpec); + return this.client.sendOperationRequest(operationArguments, setExpiryOperationSpec); + } + /** + * The Set HTTP Headers operation sets system properties on the blob + * @param options The options parameters. + */ + setHttpHeaders(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setHttpHeadersOperationSpec); + } + /** + * The Set Immutability Policy operation sets the immutability policy on the blob + * @param options The options parameters. + */ + setImmutabilityPolicy(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setImmutabilityPolicyOperationSpec); + } + /** + * The Delete Immutability Policy operation deletes the immutability policy on the blob + * @param options The options parameters. + */ + deleteImmutabilityPolicy(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, deleteImmutabilityPolicyOperationSpec); + } + /** + * The Set Legal Hold operation sets a legal hold on the blob. + * @param legalHold Specified if a legal hold should be set on the blob. + * @param options The options parameters. + */ + setLegalHold(legalHold2, options) { + const operationArguments = { + legalHold: legalHold2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setLegalHoldOperationSpec); + } + /** + * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more + * name-value pairs + * @param options The options parameters. + */ + setMetadata(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec2); + } + /** + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete + * operations + * @param options The options parameters. + */ + acquireLease(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec2); + } + /** + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete + * operations + * @param leaseId Specifies the current lease ID on the resource. + * @param options The options parameters. + */ + releaseLease(leaseId2, options) { + const operationArguments = { + leaseId: leaseId2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec2); + } + /** + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete + * operations + * @param leaseId Specifies the current lease ID on the resource. + * @param options The options parameters. + */ + renewLease(leaseId2, options) { + const operationArguments = { + leaseId: leaseId2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec2); + } + /** + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete + * operations + * @param leaseId Specifies the current lease ID on the resource. + * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 + * (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor + * (String) for a list of valid GUID string formats. + * @param options The options parameters. + */ + changeLease(leaseId2, proposedLeaseId2, options) { + const operationArguments = { + leaseId: leaseId2, + proposedLeaseId: proposedLeaseId2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec2); + } + /** + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete + * operations + * @param options The options parameters. + */ + breakLease(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec2); + } + /** + * The Create Snapshot operation creates a read-only snapshot of a blob + * @param options The options parameters. + */ + createSnapshot(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, createSnapshotOperationSpec); + } + /** + * The Start Copy From URL operation copies a blob or an internet resource to a new blob. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to + * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would + * appear in a request URI. The source blob must either be public or must be authenticated via a shared + * access signature. + * @param options The options parameters. + */ + startCopyFromURL(copySource2, options) { + const operationArguments = { + copySource: copySource2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, startCopyFromURLOperationSpec); + } + /** + * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return + * a response until the copy is complete. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to + * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would + * appear in a request URI. The source blob must either be public or must be authenticated via a shared + * access signature. + * @param options The options parameters. + */ + copyFromURL(copySource2, options) { + const operationArguments = { + copySource: copySource2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, copyFromURLOperationSpec); + } + /** + * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination + * blob with zero length and full metadata. + * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob + * operation. + * @param options The options parameters. + */ + abortCopyFromURL(copyId2, options) { + const operationArguments = { + copyId: copyId2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, abortCopyFromURLOperationSpec); + } + /** + * The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium + * storage account and on a block blob in a blob storage account (locally redundant storage only). A + * premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block + * blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's + * ETag. + * @param tier Indicates the tier to be set on the blob. + * @param options The options parameters. + */ + setTier(tier2, options) { + const operationArguments = { + tier: tier2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setTierOperationSpec); } /** * Returns the sku name and account kind @@ -42174,91 +58013,176 @@ var init_service = __esm({ const operationArguments = { options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec); + return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec3); } /** - * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * @param contentLength The length of the request. - * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch - * boundary. Example header value: multipart/mixed; boundary=batch_ - * @param body Initial data + * The Query operation enables users to select/project on blob data by providing simple query + * expressions. * @param options The options parameters. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { + query(options) { const operationArguments = { - contentLength: contentLength2, - multipartContentType: multipartContentType2, - body: body2, options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec); + return this.client.sendOperationRequest(operationArguments, queryOperationSpec); } /** - * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a - * given search expression. Filter blobs searches across all containers within a storage account but - * can be scoped within the expression to a single container. + * The Get Tags operation enables users to get the tags associated with a blob. * @param options The options parameters. */ - filterBlobs(options) { + getTags(options) { const operationArguments = { options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec); + return this.client.sendOperationRequest(operationArguments, getTagsOperationSpec); + } + /** + * The Set Tags operation enables users to set tags on a blob. + * @param options The options parameters. + */ + setTags(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setTagsOperationSpec); } }; - xmlSerializer = new Serializer( - mappers_exports, - /* isXml */ - true - ); - setPropertiesOperationSpec = { - path: "/", - httpMethod: "PUT", + xmlSerializer3 = new Serializer( + mappers_exports, + /* isXml */ + true + ); + downloadOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: { + type: { name: "Stream" }, + serializedName: "parsedResponse" + }, + headersMapper: BlobDownloadHeaders + }, + 206: { + bodyMapper: { + type: { name: "Stream" }, + serializedName: "parsedResponse" + }, + headersMapper: BlobDownloadHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlobDownloadExceptionHeaders + } + }, + queryParameters: [ + timeoutInSeconds, + snapshot, + versionId + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + range, + rangeGetContentMD5, + rangeGetContentCRC64, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifMatch, + ifNoneMatch, + ifTags + ], + isXML: true, + serializer: xmlSerializer3 + }; + getPropertiesOperationSpec3 = { + path: "/{containerName}/{blob}", + httpMethod: "HEAD", + responses: { + 200: { + headersMapper: BlobGetPropertiesHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlobGetPropertiesExceptionHeaders + } + }, + queryParameters: [ + timeoutInSeconds, + snapshot, + versionId + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifMatch, + ifNoneMatch, + ifTags + ], + isXML: true, + serializer: xmlSerializer3 + }; + deleteOperationSpec2 = { + path: "/{containerName}/{blob}", + httpMethod: "DELETE", responses: { 202: { - headersMapper: ServiceSetPropertiesHeaders + headersMapper: BlobDeleteHeaders }, default: { bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesExceptionHeaders + headersMapper: BlobDeleteExceptionHeaders } }, - requestBody: blobServiceProperties, queryParameters: [ - restype, - comp, - timeoutInSeconds + timeoutInSeconds, + snapshot, + versionId, + blobDeleteType ], urlParameters: [url], headerParameters: [ - contentType, - accept, version2, - requestId + requestId, + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + ifTags, + deleteSnapshots ], isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer + serializer: xmlSerializer3 }; - getPropertiesOperationSpec = { - path: "/", - httpMethod: "GET", + undeleteOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: BlobServiceProperties, - headersMapper: ServiceGetPropertiesHeaders + headersMapper: BlobUndeleteHeaders }, default: { bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesExceptionHeaders + headersMapper: BlobUndeleteExceptionHeaders } }, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], + queryParameters: [timeoutInSeconds, comp8], urlParameters: [url], headerParameters: [ version2, @@ -42266,573 +58190,543 @@ var init_service = __esm({ accept1 ], isXML: true, - serializer: xmlSerializer + serializer: xmlSerializer3 }; - getStatisticsOperationSpec = { - path: "/", - httpMethod: "GET", + setExpiryOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: BlobServiceStatistics, - headersMapper: ServiceGetStatisticsHeaders + headersMapper: BlobSetExpiryHeaders }, default: { bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsExceptionHeaders + headersMapper: BlobSetExpiryExceptionHeaders } }, - queryParameters: [ - restype, - timeoutInSeconds, - comp1 - ], + queryParameters: [timeoutInSeconds, comp11], urlParameters: [url], headerParameters: [ version2, requestId, - accept1 + accept1, + expiryOptions, + expiresOn ], isXML: true, - serializer: xmlSerializer + serializer: xmlSerializer3 }; - listContainersSegmentOperationSpec = { - path: "/", - httpMethod: "GET", + setHttpHeadersOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: ListContainersSegmentResponse, - headersMapper: ServiceListContainersSegmentHeaders + headersMapper: BlobSetHttpHeadersHeaders }, default: { bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentExceptionHeaders + headersMapper: BlobSetHttpHeadersExceptionHeaders } }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - include - ], + queryParameters: [comp, timeoutInSeconds], urlParameters: [url], headerParameters: [ version2, requestId, - accept1 + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + ifTags, + blobCacheControl, + blobContentType, + blobContentMD5, + blobContentEncoding, + blobContentLanguage, + blobContentDisposition ], isXML: true, - serializer: xmlSerializer + serializer: xmlSerializer3 }; - getUserDelegationKeyOperationSpec = { - path: "/", - httpMethod: "POST", + setImmutabilityPolicyOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: UserDelegationKey, - headersMapper: ServiceGetUserDelegationKeyHeaders + headersMapper: BlobSetImmutabilityPolicyHeaders }, default: { bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyExceptionHeaders + headersMapper: BlobSetImmutabilityPolicyExceptionHeaders } }, - requestBody: keyInfo, - queryParameters: [ - restype, - timeoutInSeconds, - comp3 - ], + queryParameters: [timeoutInSeconds, comp12], urlParameters: [url], headerParameters: [ - contentType, - accept, version2, - requestId + requestId, + accept1, + ifUnmodifiedSince, + immutabilityPolicyExpiry, + immutabilityPolicyMode ], isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer + serializer: xmlSerializer3 }; - getAccountInfoOperationSpec = { - path: "/", - httpMethod: "GET", + deleteImmutabilityPolicyOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "DELETE", responses: { 200: { - headersMapper: ServiceGetAccountInfoHeaders + headersMapper: BlobDeleteImmutabilityPolicyHeaders }, default: { bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoExceptionHeaders + headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders } }, - queryParameters: [comp, restype1], + queryParameters: [timeoutInSeconds, comp12], urlParameters: [url], - headerParameters: [version2, accept1], + headerParameters: [ + version2, + requestId, + accept1 + ], isXML: true, - serializer: xmlSerializer + serializer: xmlSerializer3 }; - submitBatchOperationSpec = { - path: "/", - httpMethod: "POST", + setLegalHoldOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ServiceSubmitBatchHeaders + 200: { + headersMapper: BlobSetLegalHoldHeaders }, default: { bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchExceptionHeaders + headersMapper: BlobSetLegalHoldExceptionHeaders } }, - requestBody: body, - queryParameters: [timeoutInSeconds, comp4], + queryParameters: [timeoutInSeconds, comp13], urlParameters: [url], headerParameters: [ - contentType, - accept, version2, requestId, - contentLength, - multipartContentType + accept1, + legalHold ], isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer + serializer: xmlSerializer3 }; - filterBlobsOperationSpec = { - path: "/", - httpMethod: "GET", + setMetadataOperationSpec2 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ServiceFilterBlobsHeaders + headersMapper: BlobSetMetadataHeaders }, default: { bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsExceptionHeaders + headersMapper: BlobSetMetadataExceptionHeaders } }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where + queryParameters: [timeoutInSeconds, comp6], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + metadata2, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifMatch, + ifNoneMatch, + ifTags, + encryptionScope ], + isXML: true, + serializer: xmlSerializer3 + }; + acquireLeaseOperationSpec2 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: BlobAcquireLeaseHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlobAcquireLeaseExceptionHeaders + } + }, + queryParameters: [timeoutInSeconds, comp10], urlParameters: [url], headerParameters: [ version2, requestId, - accept1 + accept1, + ifModifiedSince, + ifUnmodifiedSince, + action, + duration, + proposedLeaseId, + ifMatch, + ifNoneMatch, + ifTags ], isXML: true, - serializer: xmlSerializer + serializer: xmlSerializer3 }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/container.js -var Container, xmlSerializer2, createOperationSpec, getPropertiesOperationSpec2, deleteOperationSpec, setMetadataOperationSpec, getAccessPolicyOperationSpec, setAccessPolicyOperationSpec, restoreOperationSpec, renameOperationSpec, submitBatchOperationSpec2, filterBlobsOperationSpec2, acquireLeaseOperationSpec, releaseLeaseOperationSpec, renewLeaseOperationSpec, breakLeaseOperationSpec, changeLeaseOperationSpec, listBlobFlatSegmentOperationSpec, listBlobHierarchySegmentOperationSpec, getAccountInfoOperationSpec2; -var init_container = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/container.js"() { - init_src5(); - init_mappers(); - init_parameters(); - Container = class { - /** - * Initialize a new instance of the class Container class. - * @param client Reference to the service client - */ - constructor(client) { - this.client = client; - } - /** - * creates a new container under the specified account. If the container with the same name already - * exists, the operation fails - * @param options The options parameters. - */ - create(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, createOperationSpec); - } - /** - * returns all user-defined metadata and system properties for the specified container. The data - * returned does not include the container's list of blobs - * @param options The options parameters. - */ - getProperties(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec2); - } - /** - * operation marks the specified container for deletion. The container and any blobs contained within - * it are later deleted during garbage collection - * @param options The options parameters. - */ - delete(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, deleteOperationSpec); - } - /** - * operation sets one or more user-defined name-value pairs for the specified container. - * @param options The options parameters. - */ - setMetadata(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec); - } - /** - * gets the permissions for the specified container. The permissions indicate whether container data - * may be accessed publicly. - * @param options The options parameters. - */ - getAccessPolicy(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getAccessPolicyOperationSpec); - } - /** - * sets the permissions for the specified container. The permissions indicate whether blobs in a - * container may be accessed publicly. - * @param options The options parameters. - */ - setAccessPolicy(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setAccessPolicyOperationSpec); - } - /** - * Restores a previously-deleted container. - * @param options The options parameters. - */ - restore(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, restoreOperationSpec); - } - /** - * Renames an existing container. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param options The options parameters. - */ - rename(sourceContainerName2, options) { - const operationArguments = { - sourceContainerName: sourceContainerName2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, renameOperationSpec); - } - /** - * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * @param contentLength The length of the request. - * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch - * boundary. Example header value: multipart/mixed; boundary=batch_ - * @param body Initial data - * @param options The options parameters. - */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - const operationArguments = { - contentLength: contentLength2, - multipartContentType: multipartContentType2, - body: body2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec2); - } - /** - * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given - * search expression. Filter blobs searches within the given container. - * @param options The options parameters. - */ - filterBlobs(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec2); - } - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can - * be 15 to 60 seconds, or can be infinite - * @param options The options parameters. - */ - acquireLease(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec); - } - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can - * be 15 to 60 seconds, or can be infinite - * @param leaseId Specifies the current lease ID on the resource. - * @param options The options parameters. - */ - releaseLease(leaseId2, options) { - const operationArguments = { - leaseId: leaseId2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec); - } - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can - * be 15 to 60 seconds, or can be infinite - * @param leaseId Specifies the current lease ID on the resource. - * @param options The options parameters. - */ - renewLease(leaseId2, options) { - const operationArguments = { - leaseId: leaseId2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec); - } - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can - * be 15 to 60 seconds, or can be infinite - * @param options The options parameters. - */ - breakLease(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec); - } - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can - * be 15 to 60 seconds, or can be infinite - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 - * (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor - * (String) for a list of valid GUID string formats. - * @param options The options parameters. - */ - changeLease(leaseId2, proposedLeaseId2, options) { - const operationArguments = { - leaseId: leaseId2, - proposedLeaseId: proposedLeaseId2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec); - } - /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container - * @param options The options parameters. - */ - listBlobFlatSegment(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, listBlobFlatSegmentOperationSpec); - } - /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container - * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix - * element in the response body that acts as a placeholder for all blobs whose names begin with the - * same substring up to the appearance of the delimiter character. The delimiter may be a single - * character or a string. - * @param options The options parameters. - */ - listBlobHierarchySegment(delimiter2, options) { - const operationArguments = { - delimiter: delimiter2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, listBlobHierarchySegmentOperationSpec); - } - /** - * Returns the sku name and account kind - * @param options The options parameters. - */ - getAccountInfo(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec2); - } + releaseLeaseOperationSpec2 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: BlobReleaseLeaseHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlobReleaseLeaseExceptionHeaders + } + }, + queryParameters: [timeoutInSeconds, comp10], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + ifModifiedSince, + ifUnmodifiedSince, + action1, + leaseId1, + ifMatch, + ifNoneMatch, + ifTags + ], + isXML: true, + serializer: xmlSerializer3 }; - xmlSerializer2 = new Serializer( - mappers_exports, - /* isXml */ - true - ); - createOperationSpec = { - path: "/{containerName}", + renewLeaseOperationSpec2 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: BlobRenewLeaseHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlobRenewLeaseExceptionHeaders + } + }, + queryParameters: [timeoutInSeconds, comp10], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + ifModifiedSince, + ifUnmodifiedSince, + leaseId1, + action2, + ifMatch, + ifNoneMatch, + ifTags + ], + isXML: true, + serializer: xmlSerializer3 + }; + changeLeaseOperationSpec2 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: BlobChangeLeaseHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlobChangeLeaseExceptionHeaders + } + }, + queryParameters: [timeoutInSeconds, comp10], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + ifModifiedSince, + ifUnmodifiedSince, + leaseId1, + action4, + proposedLeaseId1, + ifMatch, + ifNoneMatch, + ifTags + ], + isXML: true, + serializer: xmlSerializer3 + }; + breakLeaseOperationSpec2 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 202: { + headersMapper: BlobBreakLeaseHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlobBreakLeaseExceptionHeaders + } + }, + queryParameters: [timeoutInSeconds, comp10], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + ifModifiedSince, + ifUnmodifiedSince, + action3, + breakPeriod, + ifMatch, + ifNoneMatch, + ifTags + ], + isXML: true, + serializer: xmlSerializer3 + }; + createSnapshotOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 201: { - headersMapper: ContainerCreateHeaders + headersMapper: BlobCreateSnapshotHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerCreateExceptionHeaders + headersMapper: BlobCreateSnapshotExceptionHeaders } }, - queryParameters: [timeoutInSeconds, restype2], + queryParameters: [timeoutInSeconds, comp14], urlParameters: [url], headerParameters: [ version2, requestId, accept1, metadata2, - access, - defaultEncryptionScope, - preventEncryptionScopeOverride + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifMatch, + ifNoneMatch, + ifTags, + encryptionScope ], isXML: true, - serializer: xmlSerializer2 + serializer: xmlSerializer3 }; - getPropertiesOperationSpec2 = { - path: "/{containerName}", - httpMethod: "GET", + startCopyFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - headersMapper: ContainerGetPropertiesHeaders + 202: { + headersMapper: BlobStartCopyFromURLHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesExceptionHeaders + headersMapper: BlobStartCopyFromURLExceptionHeaders } }, - queryParameters: [timeoutInSeconds, restype2], + queryParameters: [timeoutInSeconds], urlParameters: [url], headerParameters: [ version2, requestId, accept1, - leaseId + metadata2, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + ifTags, + immutabilityPolicyExpiry, + immutabilityPolicyMode, + tier, + rehydratePriority, + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + sourceIfTags, + copySource, + blobTagsString, + sealBlob, + legalHold1 ], isXML: true, - serializer: xmlSerializer2 + serializer: xmlSerializer3 }; - deleteOperationSpec = { - path: "/{containerName}", - httpMethod: "DELETE", + copyFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 202: { - headersMapper: ContainerDeleteHeaders + headersMapper: BlobCopyFromURLHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerDeleteExceptionHeaders + headersMapper: BlobCopyFromURLExceptionHeaders } }, - queryParameters: [timeoutInSeconds, restype2], + queryParameters: [timeoutInSeconds], urlParameters: [url], headerParameters: [ version2, requestId, accept1, + metadata2, leaseId, ifModifiedSince, - ifUnmodifiedSince + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + ifTags, + immutabilityPolicyExpiry, + immutabilityPolicyMode, + encryptionScope, + tier, + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + copySource, + blobTagsString, + legalHold1, + xMsRequiresSync, + sourceContentMD5, + copySourceAuthorization, + copySourceTags ], isXML: true, - serializer: xmlSerializer2 + serializer: xmlSerializer3 }; - setMetadataOperationSpec = { - path: "/{containerName}", + abortCopyFromURLOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { - 200: { - headersMapper: ContainerSetMetadataHeaders + 204: { + headersMapper: BlobAbortCopyFromURLHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerSetMetadataExceptionHeaders + headersMapper: BlobAbortCopyFromURLExceptionHeaders } }, queryParameters: [ timeoutInSeconds, - restype2, - comp6 + comp15, + copyId ], urlParameters: [url], headerParameters: [ version2, requestId, accept1, - metadata2, leaseId, - ifModifiedSince + copyActionAbortConstant ], isXML: true, - serializer: xmlSerializer2 + serializer: xmlSerializer3 }; - getAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", + setTierOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: { - type: { - name: "Sequence", - element: { - type: { name: "Composite", className: "SignedIdentifier" } - } - }, - serializedName: "SignedIdentifiers", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier" - }, - headersMapper: ContainerGetAccessPolicyHeaders + headersMapper: BlobSetTierHeaders + }, + 202: { + headersMapper: BlobSetTierHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyExceptionHeaders + headersMapper: BlobSetTierExceptionHeaders } }, queryParameters: [ timeoutInSeconds, - restype2, - comp7 + snapshot, + versionId, + comp16 ], urlParameters: [url], headerParameters: [ version2, requestId, accept1, - leaseId + leaseId, + ifTags, + rehydratePriority, + tier1 ], isXML: true, - serializer: xmlSerializer2 + serializer: xmlSerializer3 }; - setAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", + getAccountInfoOperationSpec3 = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { 200: { - headersMapper: ContainerSetAccessPolicyHeaders + headersMapper: BlobGetAccountInfoHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyExceptionHeaders + headersMapper: BlobGetAccountInfoExceptionHeaders } }, - requestBody: containerAcl, + queryParameters: [comp, restype1], + urlParameters: [url], + headerParameters: [version2, accept1], + isXML: true, + serializer: xmlSerializer3 + }; + queryOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: { + type: { name: "Stream" }, + serializedName: "parsedResponse" + }, + headersMapper: BlobQueryHeaders + }, + 206: { + bodyMapper: { + type: { name: "Stream" }, + serializedName: "parsedResponse" + }, + headersMapper: BlobQueryHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlobQueryExceptionHeaders + } + }, + requestBody: queryRequest, queryParameters: [ timeoutInSeconds, - restype2, - comp7 + snapshot, + comp17 ], urlParameters: [url], headerParameters: [ @@ -42840,761 +58734,1164 @@ var init_container = __esm({ accept, version2, requestId, - access, leaseId, ifModifiedSince, - ifUnmodifiedSince + ifUnmodifiedSince, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifMatch, + ifNoneMatch, + ifTags ], isXML: true, contentType: "application/xml; charset=utf-8", mediaType: "xml", - serializer: xmlSerializer2 + serializer: xmlSerializer3 }; - restoreOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", + getTagsOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { - 201: { - headersMapper: ContainerRestoreHeaders + 200: { + bodyMapper: BlobTags, + headersMapper: BlobGetTagsHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerRestoreExceptionHeaders + headersMapper: BlobGetTagsExceptionHeaders } }, queryParameters: [ timeoutInSeconds, - restype2, - comp8 + snapshot, + versionId, + comp18 ], urlParameters: [url], headerParameters: [ version2, requestId, accept1, - deletedContainerName, - deletedContainerVersion + leaseId, + ifTags ], isXML: true, - serializer: xmlSerializer2 + serializer: xmlSerializer3 }; - renameOperationSpec = { - path: "/{containerName}", + setTagsOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { - 200: { - headersMapper: ContainerRenameHeaders + 204: { + headersMapper: BlobSetTagsHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerRenameExceptionHeaders + headersMapper: BlobSetTagsExceptionHeaders } }, + requestBody: tags, queryParameters: [ timeoutInSeconds, - restype2, - comp9 + versionId, + comp18 ], urlParameters: [url], headerParameters: [ + contentType, + accept, version2, requestId, - accept1, - sourceContainerName, - sourceLeaseId + leaseId, + ifTags, + transactionalContentMD5, + transactionalContentCrc64 ], isXML: true, - serializer: xmlSerializer2 + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer3 }; - submitBatchOperationSpec2 = { - path: "/{containerName}", - httpMethod: "POST", + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/pageBlob.js +var PageBlob, xmlSerializer4, serializer, createOperationSpec2, uploadPagesOperationSpec, clearPagesOperationSpec, uploadPagesFromURLOperationSpec, getPageRangesOperationSpec, getPageRangesDiffOperationSpec, resizeOperationSpec, updateSequenceNumberOperationSpec, copyIncrementalOperationSpec; +var init_pageBlob = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/pageBlob.js"() { + init_src5(); + init_mappers(); + init_parameters(); + PageBlob = class { + /** + * Initialize a new instance of the class PageBlob class. + * @param client Reference to the service client + */ + constructor(client) { + this.client = client; + } + /** + * The Create operation creates a new page blob. + * @param contentLength The length of the request. + * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The + * page blob size must be aligned to a 512-byte boundary. + * @param options The options parameters. + */ + create(contentLength2, blobContentLength2, options) { + const operationArguments = { + contentLength: contentLength2, + blobContentLength: blobContentLength2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, createOperationSpec2); + } + /** + * The Upload Pages operation writes a range of pages to a page blob + * @param contentLength The length of the request. + * @param body Initial data + * @param options The options parameters. + */ + uploadPages(contentLength2, body2, options) { + const operationArguments = { + contentLength: contentLength2, + body: body2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, uploadPagesOperationSpec); + } + /** + * The Clear Pages operation clears a set of pages from a page blob + * @param contentLength The length of the request. + * @param options The options parameters. + */ + clearPages(contentLength2, options) { + const operationArguments = { + contentLength: contentLength2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, clearPagesOperationSpec); + } + /** + * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a + * URL + * @param sourceUrl Specify a URL to the copy source. + * @param sourceRange Bytes of source data in the specified range. The length of this range should + * match the ContentLength header and x-ms-range/Range destination range header. + * @param contentLength The length of the request. + * @param range The range of bytes to which the source range would be written. The range should be 512 + * aligned and range-end is required. + * @param options The options parameters. + */ + uploadPagesFromURL(sourceUrl2, sourceRange2, contentLength2, range2, options) { + const operationArguments = { + sourceUrl: sourceUrl2, + sourceRange: sourceRange2, + contentLength: contentLength2, + range: range2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, uploadPagesFromURLOperationSpec); + } + /** + * The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a + * page blob + * @param options The options parameters. + */ + getPageRanges(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getPageRangesOperationSpec); + } + /** + * The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were + * changed between target blob and previous snapshot. + * @param options The options parameters. + */ + getPageRangesDiff(options) { + const operationArguments = { + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getPageRangesDiffOperationSpec); + } + /** + * Resize the Blob + * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The + * page blob size must be aligned to a 512-byte boundary. + * @param options The options parameters. + */ + resize(blobContentLength2, options) { + const operationArguments = { + blobContentLength: blobContentLength2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, resizeOperationSpec); + } + /** + * Update the sequence number of the blob + * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request. + * This property applies to page blobs only. This property indicates how the service should modify the + * blob's sequence number + * @param options The options parameters. + */ + updateSequenceNumber(sequenceNumberAction2, options) { + const operationArguments = { + sequenceNumberAction: sequenceNumberAction2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, updateSequenceNumberOperationSpec); + } + /** + * The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. + * The snapshot is copied such that only the differential changes between the previously copied + * snapshot are transferred to the destination. The copied snapshots are complete copies of the + * original snapshot and can be read or copied from as usual. This API is supported since REST version + * 2016-05-31. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to + * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would + * appear in a request URI. The source blob must either be public or must be authenticated via a shared + * access signature. + * @param options The options parameters. + */ + copyIncremental(copySource2, options) { + const operationArguments = { + copySource: copySource2, + options: operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, copyIncrementalOperationSpec); + } + }; + xmlSerializer4 = new Serializer( + mappers_exports, + /* isXml */ + true + ); + serializer = new Serializer( + mappers_exports, + /* isXml */ + false + ); + createOperationSpec2 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ContainerSubmitBatchHeaders + 201: { + headersMapper: PageBlobCreateHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchExceptionHeaders + headersMapper: PageBlobCreateExceptionHeaders } }, - requestBody: body, - queryParameters: [ - timeoutInSeconds, - comp4, - restype2 - ], + queryParameters: [timeoutInSeconds], urlParameters: [url], headerParameters: [ - contentType, - accept, version2, requestId, + accept1, contentLength, - multipartContentType + metadata2, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifMatch, + ifNoneMatch, + ifTags, + blobCacheControl, + blobContentType, + blobContentMD5, + blobContentEncoding, + blobContentLanguage, + blobContentDisposition, + immutabilityPolicyExpiry, + immutabilityPolicyMode, + encryptionScope, + tier, + blobTagsString, + legalHold1, + blobType, + blobContentLength, + blobSequenceNumber ], isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer2 + serializer: xmlSerializer4 }; - filterBlobsOperationSpec2 = { - path: "/{containerName}", - httpMethod: "GET", + uploadPagesOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ContainerFilterBlobsHeaders + 201: { + headersMapper: PageBlobUploadPagesHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerFilterBlobsExceptionHeaders + headersMapper: PageBlobUploadPagesExceptionHeaders } }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where, - restype2 - ], + requestBody: body1, + queryParameters: [timeoutInSeconds, comp19], urlParameters: [url], headerParameters: [ version2, requestId, - accept1 + contentLength, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + range, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifMatch, + ifNoneMatch, + ifTags, + encryptionScope, + transactionalContentMD5, + transactionalContentCrc64, + contentType1, + accept2, + pageWrite, + ifSequenceNumberLessThanOrEqualTo, + ifSequenceNumberLessThan, + ifSequenceNumberEqualTo ], - isXML: true, - serializer: xmlSerializer2 + mediaType: "binary", + serializer }; - acquireLeaseOperationSpec = { - path: "/{containerName}", + clearPagesOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 201: { - headersMapper: ContainerAcquireLeaseHeaders + headersMapper: PageBlobClearPagesHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseExceptionHeaders + headersMapper: PageBlobClearPagesExceptionHeaders } }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], + queryParameters: [timeoutInSeconds, comp19], urlParameters: [url], headerParameters: [ version2, requestId, accept1, + contentLength, + leaseId, ifModifiedSince, ifUnmodifiedSince, - action, - duration, - proposedLeaseId + range, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifMatch, + ifNoneMatch, + ifTags, + encryptionScope, + ifSequenceNumberLessThanOrEqualTo, + ifSequenceNumberLessThan, + ifSequenceNumberEqualTo, + pageWrite1 ], isXML: true, - serializer: xmlSerializer2 + serializer: xmlSerializer4 }; - releaseLeaseOperationSpec = { - path: "/{containerName}", + uploadPagesFromURLOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { - 200: { - headersMapper: ContainerReleaseLeaseHeaders + 201: { + headersMapper: PageBlobUploadPagesFromURLHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseExceptionHeaders + headersMapper: PageBlobUploadPagesFromURLExceptionHeaders } }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], + queryParameters: [timeoutInSeconds, comp19], urlParameters: [url], headerParameters: [ version2, requestId, accept1, + contentLength, + leaseId, ifModifiedSince, ifUnmodifiedSince, - action1, - leaseId1 + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifMatch, + ifNoneMatch, + ifTags, + encryptionScope, + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + sourceContentMD5, + copySourceAuthorization, + pageWrite, + ifSequenceNumberLessThanOrEqualTo, + ifSequenceNumberLessThan, + ifSequenceNumberEqualTo, + sourceUrl, + sourceRange, + sourceContentCrc64, + range1 ], isXML: true, - serializer: xmlSerializer2 + serializer: xmlSerializer4 }; - renewLeaseOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", + getPageRangesOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { 200: { - headersMapper: ContainerRenewLeaseHeaders + bodyMapper: PageList, + headersMapper: PageBlobGetPageRangesHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseExceptionHeaders + headersMapper: PageBlobGetPageRangesExceptionHeaders } }, queryParameters: [ timeoutInSeconds, - restype2, - comp10 + marker, + maxPageSize, + snapshot, + comp20 ], urlParameters: [url], headerParameters: [ version2, requestId, accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, - leaseId1, - action2 + range, + ifMatch, + ifNoneMatch, + ifTags ], isXML: true, - serializer: xmlSerializer2 + serializer: xmlSerializer4 }; - breakLeaseOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", + getPageRangesDiffOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { - 202: { - headersMapper: ContainerBreakLeaseHeaders + 200: { + bodyMapper: PageList, + headersMapper: PageBlobGetPageRangesDiffHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseExceptionHeaders + headersMapper: PageBlobGetPageRangesDiffExceptionHeaders } }, queryParameters: [ timeoutInSeconds, - restype2, - comp10 + marker, + maxPageSize, + snapshot, + comp20, + prevsnapshot ], urlParameters: [url], headerParameters: [ version2, requestId, accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, - action3, - breakPeriod + range, + ifMatch, + ifNoneMatch, + ifTags, + prevSnapshotUrl ], isXML: true, - serializer: xmlSerializer2 + serializer: xmlSerializer4 }; - changeLeaseOperationSpec = { - path: "/{containerName}", + resizeOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 200: { - headersMapper: ContainerChangeLeaseHeaders + headersMapper: PageBlobResizeHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseExceptionHeaders + headersMapper: PageBlobResizeExceptionHeaders } }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], + queryParameters: [comp, timeoutInSeconds], urlParameters: [url], headerParameters: [ version2, requestId, accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1 + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifMatch, + ifNoneMatch, + ifTags, + encryptionScope, + blobContentLength ], isXML: true, - serializer: xmlSerializer2 + serializer: xmlSerializer4 }; - listBlobFlatSegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", + updateSequenceNumberOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: ListBlobsFlatSegmentResponse, - headersMapper: ContainerListBlobFlatSegmentHeaders + headersMapper: PageBlobUpdateSequenceNumberHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentExceptionHeaders + headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders } }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1 - ], + queryParameters: [comp, timeoutInSeconds], urlParameters: [url], headerParameters: [ version2, requestId, - accept1 + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + ifTags, + blobSequenceNumber, + sequenceNumberAction ], isXML: true, - serializer: xmlSerializer2 + serializer: xmlSerializer4 }; - listBlobHierarchySegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", + copyIncrementalOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders + 202: { + headersMapper: PageBlobCopyIncrementalHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders + headersMapper: PageBlobCopyIncrementalExceptionHeaders } }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1, - delimiter - ], + queryParameters: [timeoutInSeconds, comp21], urlParameters: [url], headerParameters: [ version2, requestId, - accept1 + accept1, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + ifTags, + copySource ], isXML: true, - serializer: xmlSerializer2 - }; - getAccountInfoOperationSpec2 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoExceptionHeaders - } - }, - queryParameters: [comp, restype1], - urlParameters: [url], - headerParameters: [version2, accept1], - isXML: true, - serializer: xmlSerializer2 + serializer: xmlSerializer4 }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/blob.js -var Blob3, xmlSerializer3, downloadOperationSpec, getPropertiesOperationSpec3, deleteOperationSpec2, undeleteOperationSpec, setExpiryOperationSpec, setHttpHeadersOperationSpec, setImmutabilityPolicyOperationSpec, deleteImmutabilityPolicyOperationSpec, setLegalHoldOperationSpec, setMetadataOperationSpec2, acquireLeaseOperationSpec2, releaseLeaseOperationSpec2, renewLeaseOperationSpec2, changeLeaseOperationSpec2, breakLeaseOperationSpec2, createSnapshotOperationSpec, startCopyFromURLOperationSpec, copyFromURLOperationSpec, abortCopyFromURLOperationSpec, setTierOperationSpec, getAccountInfoOperationSpec3, queryOperationSpec, getTagsOperationSpec, setTagsOperationSpec; -var init_blob = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/blob.js"() { +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/appendBlob.js +var AppendBlob, xmlSerializer5, serializer2, createOperationSpec3, appendBlockOperationSpec, appendBlockFromUrlOperationSpec, sealOperationSpec; +var init_appendBlob = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/appendBlob.js"() { init_src5(); init_mappers(); init_parameters(); - Blob3 = class { + AppendBlob = class { /** - * Initialize a new instance of the class Blob class. + * Initialize a new instance of the class AppendBlob class. * @param client Reference to the service client */ constructor(client) { this.client = client; } /** - * The Download operation reads or downloads a blob from the system, including its metadata and - * properties. You can also call Download to read a snapshot. - * @param options The options parameters. - */ - download(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, downloadOperationSpec); - } - /** - * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system - * properties for the blob. It does not return the content of the blob. - * @param options The options parameters. - */ - getProperties(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec3); - } - /** - * If the storage account's soft delete feature is disabled then, when a blob is deleted, it is - * permanently removed from the storage account. If the storage account's soft delete feature is - * enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible - * immediately. However, the blob service retains the blob or snapshot for the number of days specified - * by the DeleteRetentionPolicy section of [Storage service properties] - * (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is - * permanently removed from the storage account. Note that you continue to be charged for the - * soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and specify the - * "include=deleted" query parameter to discover which blobs and snapshots have been soft deleted. You - * can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a - * soft-deleted blob or snapshot causes the service to return an HTTP status code of 404 - * (ResourceNotFound). - * @param options The options parameters. - */ - delete(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, deleteOperationSpec2); - } - /** - * Undelete a blob that was previously soft deleted - * @param options The options parameters. - */ - undelete(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, undeleteOperationSpec); - } - /** - * Sets the time a blob will expire and be deleted. - * @param expiryOptions Required. Indicates mode of the expiry time - * @param options The options parameters. - */ - setExpiry(expiryOptions2, options) { - const operationArguments = { - expiryOptions: expiryOptions2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setExpiryOperationSpec); - } - /** - * The Set HTTP Headers operation sets system properties on the blob - * @param options The options parameters. - */ - setHttpHeaders(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setHttpHeadersOperationSpec); - } - /** - * The Set Immutability Policy operation sets the immutability policy on the blob - * @param options The options parameters. - */ - setImmutabilityPolicy(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setImmutabilityPolicyOperationSpec); - } - /** - * The Delete Immutability Policy operation deletes the immutability policy on the blob - * @param options The options parameters. - */ - deleteImmutabilityPolicy(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, deleteImmutabilityPolicyOperationSpec); - } - /** - * The Set Legal Hold operation sets a legal hold on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param options The options parameters. - */ - setLegalHold(legalHold2, options) { - const operationArguments = { - legalHold: legalHold2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setLegalHoldOperationSpec); - } - /** - * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more - * name-value pairs - * @param options The options parameters. - */ - setMetadata(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec2); - } - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param options The options parameters. - */ - acquireLease(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec2); - } - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param leaseId Specifies the current lease ID on the resource. - * @param options The options parameters. - */ - releaseLease(leaseId2, options) { - const operationArguments = { - leaseId: leaseId2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec2); - } - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param leaseId Specifies the current lease ID on the resource. + * The Create Append Blob operation creates a new append blob. + * @param contentLength The length of the request. * @param options The options parameters. */ - renewLease(leaseId2, options) { + create(contentLength2, options) { const operationArguments = { - leaseId: leaseId2, + contentLength: contentLength2, options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec2); + return this.client.sendOperationRequest(operationArguments, createOperationSpec3); } /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 - * (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor - * (String) for a list of valid GUID string formats. + * The Append Block operation commits a new block of data to the end of an existing append blob. The + * Append Block operation is permitted only if the blob was created with x-ms-blob-type set to + * AppendBlob. Append Block is supported only on version 2015-02-21 version or later. + * @param contentLength The length of the request. + * @param body Initial data * @param options The options parameters. */ - changeLease(leaseId2, proposedLeaseId2, options) { + appendBlock(contentLength2, body2, options) { const operationArguments = { - leaseId: leaseId2, - proposedLeaseId: proposedLeaseId2, + contentLength: contentLength2, + body: body2, options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec2); + return this.client.sendOperationRequest(operationArguments, appendBlockOperationSpec); } /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations + * The Append Block operation commits a new block of data to the end of an existing append blob where + * the contents are read from a source url. The Append Block operation is permitted only if the blob + * was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version + * 2015-02-21 version or later. + * @param sourceUrl Specify a URL to the copy source. + * @param contentLength The length of the request. * @param options The options parameters. */ - breakLease(options) { + appendBlockFromUrl(sourceUrl2, contentLength2, options) { const operationArguments = { + sourceUrl: sourceUrl2, + contentLength: contentLength2, options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec2); + return this.client.sendOperationRequest(operationArguments, appendBlockFromUrlOperationSpec); } /** - * The Create Snapshot operation creates a read-only snapshot of a blob + * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version + * 2019-12-12 version or later. * @param options The options parameters. */ - createSnapshot(options) { + seal(options) { const operationArguments = { options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, createSnapshotOperationSpec); + return this.client.sendOperationRequest(operationArguments, sealOperationSpec); + } + }; + xmlSerializer5 = new Serializer( + mappers_exports, + /* isXml */ + true + ); + serializer2 = new Serializer( + mappers_exports, + /* isXml */ + false + ); + createOperationSpec3 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: AppendBlobCreateHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: AppendBlobCreateExceptionHeaders + } + }, + queryParameters: [timeoutInSeconds], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + contentLength, + metadata2, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifMatch, + ifNoneMatch, + ifTags, + blobCacheControl, + blobContentType, + blobContentMD5, + blobContentEncoding, + blobContentLanguage, + blobContentDisposition, + immutabilityPolicyExpiry, + immutabilityPolicyMode, + encryptionScope, + blobTagsString, + legalHold1, + blobType1 + ], + isXML: true, + serializer: xmlSerializer5 + }; + appendBlockOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: AppendBlobAppendBlockHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: AppendBlobAppendBlockExceptionHeaders + } + }, + requestBody: body1, + queryParameters: [timeoutInSeconds, comp22], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + contentLength, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifMatch, + ifNoneMatch, + ifTags, + encryptionScope, + transactionalContentMD5, + transactionalContentCrc64, + contentType1, + accept2, + maxSize, + appendPosition + ], + mediaType: "binary", + serializer: serializer2 + }; + appendBlockFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: AppendBlobAppendBlockFromUrlHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders + } + }, + queryParameters: [timeoutInSeconds, comp22], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + contentLength, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifMatch, + ifNoneMatch, + ifTags, + encryptionScope, + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + sourceContentMD5, + copySourceAuthorization, + transactionalContentMD5, + sourceUrl, + sourceContentCrc64, + maxSize, + appendPosition, + sourceRange1 + ], + isXML: true, + serializer: xmlSerializer5 + }; + sealOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: AppendBlobSealHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: AppendBlobSealExceptionHeaders + } + }, + queryParameters: [timeoutInSeconds, comp23], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + appendPosition + ], + isXML: true, + serializer: xmlSerializer5 + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/blockBlob.js +var BlockBlob, xmlSerializer6, serializer3, uploadOperationSpec, putBlobFromUrlOperationSpec, stageBlockOperationSpec, stageBlockFromURLOperationSpec, commitBlockListOperationSpec, getBlockListOperationSpec; +var init_blockBlob = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/blockBlob.js"() { + init_src5(); + init_mappers(); + init_parameters(); + BlockBlob = class { + /** + * Initialize a new instance of the class BlockBlob class. + * @param client Reference to the service client + */ + constructor(client) { + this.client = client; } /** - * The Start Copy From URL operation copies a blob or an internet resource to a new blob. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to - * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would - * appear in a request URI. The source blob must either be public or must be authenticated via a shared - * access signature. + * The Upload Block Blob operation updates the content of an existing block blob. Updating an existing + * block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put + * Blob; the content of the existing blob is overwritten with the content of the new blob. To perform a + * partial update of the content of a block blob, use the Put Block List operation. + * @param contentLength The length of the request. + * @param body Initial data * @param options The options parameters. */ - startCopyFromURL(copySource2, options) { + upload(contentLength2, body2, options) { const operationArguments = { - copySource: copySource2, + contentLength: contentLength2, + body: body2, options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, startCopyFromURLOperationSpec); + return this.client.sendOperationRequest(operationArguments, uploadOperationSpec); } /** - * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return - * a response until the copy is complete. + * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read + * from a given URL. This API is supported beginning with the 2020-04-08 version. Partial updates are + * not supported with Put Blob from URL; the content of an existing blob is overwritten with the + * content of the new blob. To perform partial updates to a block blob’s contents using a source URL, + * use the Put Block from URL API in conjunction with Put Block List. + * @param contentLength The length of the request. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would * appear in a request URI. The source blob must either be public or must be authenticated via a shared * access signature. * @param options The options parameters. */ - copyFromURL(copySource2, options) { + putBlobFromUrl(contentLength2, copySource2, options) { const operationArguments = { + contentLength: contentLength2, copySource: copySource2, options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, copyFromURLOperationSpec); - } - /** - * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination - * blob with zero length and full metadata. - * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob - * operation. - * @param options The options parameters. - */ - abortCopyFromURL(copyId2, options) { - const operationArguments = { - copyId: copyId2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, abortCopyFromURLOperationSpec); - } - /** - * The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium - * storage account and on a block blob in a blob storage account (locally redundant storage only). A - * premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block - * blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's - * ETag. - * @param tier Indicates the tier to be set on the blob. - * @param options The options parameters. - */ - setTier(tier2, options) { - const operationArguments = { - tier: tier2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setTierOperationSpec); + return this.client.sendOperationRequest(operationArguments, putBlobFromUrlOperationSpec); } /** - * Returns the sku name and account kind + * The Stage Block operation creates a new block to be committed as part of a blob + * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string + * must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified + * for the blockid parameter must be the same size for each block. + * @param contentLength The length of the request. + * @param body Initial data * @param options The options parameters. */ - getAccountInfo(options) { + stageBlock(blockId2, contentLength2, body2, options) { const operationArguments = { + blockId: blockId2, + contentLength: contentLength2, + body: body2, options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec3); + return this.client.sendOperationRequest(operationArguments, stageBlockOperationSpec); } /** - * The Query operation enables users to select/project on blob data by providing simple query - * expressions. + * The Stage Block operation creates a new block to be committed as part of a blob where the contents + * are read from a URL. + * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string + * must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified + * for the blockid parameter must be the same size for each block. + * @param contentLength The length of the request. + * @param sourceUrl Specify a URL to the copy source. * @param options The options parameters. */ - query(options) { + stageBlockFromURL(blockId2, contentLength2, sourceUrl2, options) { const operationArguments = { + blockId: blockId2, + contentLength: contentLength2, + sourceUrl: sourceUrl2, options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, queryOperationSpec); + return this.client.sendOperationRequest(operationArguments, stageBlockFromURLOperationSpec); } /** - * The Get Tags operation enables users to get the tags associated with a blob. + * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the + * blob. In order to be written as part of a blob, a block must have been successfully written to the + * server in a prior Put Block operation. You can call Put Block List to update a blob by uploading + * only those blocks that have changed, then committing the new and existing blocks together. You can + * do this by specifying whether to commit a block from the committed block list or from the + * uncommitted block list, or to commit the most recently uploaded version of the block, whichever list + * it may belong to. + * @param blocks Blob Blocks. * @param options The options parameters. */ - getTags(options) { + commitBlockList(blocks2, options) { const operationArguments = { + blocks: blocks2, options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, getTagsOperationSpec); + return this.client.sendOperationRequest(operationArguments, commitBlockListOperationSpec); } /** - * The Set Tags operation enables users to set tags on a blob. + * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block + * blob + * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted + * blocks, or both lists together. * @param options The options parameters. */ - setTags(options) { + getBlockList(listType2, options) { const operationArguments = { + listType: listType2, options: operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest(operationArguments, setTagsOperationSpec); + return this.client.sendOperationRequest(operationArguments, getBlockListOperationSpec); } }; - xmlSerializer3 = new Serializer( + xmlSerializer6 = new Serializer( mappers_exports, /* isXml */ true ); - downloadOperationSpec = { + serializer3 = new Serializer( + mappers_exports, + /* isXml */ + false + ); + uploadOperationSpec = { path: "/{containerName}/{blob}", - httpMethod: "GET", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders + 201: { + headersMapper: BlockBlobUploadHeaders }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders + default: { + bodyMapper: StorageError, + headersMapper: BlockBlobUploadExceptionHeaders + } + }, + requestBody: body1, + queryParameters: [timeoutInSeconds], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + contentLength, + metadata2, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifMatch, + ifNoneMatch, + ifTags, + blobCacheControl, + blobContentType, + blobContentMD5, + blobContentEncoding, + blobContentLanguage, + blobContentDisposition, + immutabilityPolicyExpiry, + immutabilityPolicyMode, + encryptionScope, + tier, + blobTagsString, + legalHold1, + transactionalContentMD5, + transactionalContentCrc64, + contentType1, + accept2, + blobType2 + ], + mediaType: "binary", + serializer: serializer3 + }; + putBlobFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: BlockBlobPutBlobFromUrlHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders + } + }, + queryParameters: [timeoutInSeconds], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + accept1, + contentLength, + metadata2, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifMatch, + ifNoneMatch, + ifTags, + blobCacheControl, + blobContentType, + blobContentMD5, + blobContentEncoding, + blobContentLanguage, + blobContentDisposition, + encryptionScope, + tier, + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + sourceIfTags, + copySource, + blobTagsString, + sourceContentMD5, + copySourceAuthorization, + copySourceTags, + transactionalContentMD5, + blobType2, + copySourceBlobProperties + ], + isXML: true, + serializer: xmlSerializer6 + }; + stageBlockOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: BlockBlobStageBlockHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlockBlobStageBlockExceptionHeaders + } + }, + requestBody: body1, + queryParameters: [ + timeoutInSeconds, + comp24, + blockId + ], + urlParameters: [url], + headerParameters: [ + version2, + requestId, + contentLength, + leaseId, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + encryptionScope, + transactionalContentMD5, + transactionalContentCrc64, + contentType1, + accept2 + ], + mediaType: "binary", + serializer: serializer3 + }; + stageBlockFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: BlockBlobStageBlockFromURLHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobDownloadExceptionHeaders + headersMapper: BlockBlobStageBlockFromURLExceptionHeaders } }, queryParameters: [ timeoutInSeconds, - snapshot, - versionId + comp24, + blockId ], urlParameters: [url], headerParameters: [ version2, requestId, accept1, + contentLength, leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - rangeGetContentMD5, - rangeGetContentCRC64, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags + encryptionScope, + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + sourceContentMD5, + copySourceAuthorization, + sourceUrl, + sourceContentCrc64, + sourceRange1 ], isXML: true, - serializer: xmlSerializer3 + serializer: xmlSerializer6 }; - getPropertiesOperationSpec3 = { + commitBlockListOperationSpec = { path: "/{containerName}/{blob}", - httpMethod: "HEAD", + httpMethod: "PUT", responses: { - 200: { - headersMapper: BlobGetPropertiesHeaders + 201: { + headersMapper: BlockBlobCommitBlockListHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobGetPropertiesExceptionHeaders + headersMapper: BlockBlobCommitBlockListExceptionHeaders } }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], + requestBody: blocks, + queryParameters: [timeoutInSeconds, comp25], urlParameters: [url], headerParameters: [ + contentType, + accept, version2, requestId, - accept1, + metadata2, leaseId, ifModifiedSince, ifUnmodifiedSince, @@ -43603,28 +59900,45 @@ var init_blob = __esm({ encryptionAlgorithm, ifMatch, ifNoneMatch, - ifTags + ifTags, + blobCacheControl, + blobContentType, + blobContentMD5, + blobContentEncoding, + blobContentLanguage, + blobContentDisposition, + immutabilityPolicyExpiry, + immutabilityPolicyMode, + encryptionScope, + tier, + blobTagsString, + legalHold1, + transactionalContentMD5, + transactionalContentCrc64 ], isXML: true, - serializer: xmlSerializer3 + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer6 }; - deleteOperationSpec2 = { + getBlockListOperationSpec = { path: "/{containerName}/{blob}", - httpMethod: "DELETE", + httpMethod: "GET", responses: { - 202: { - headersMapper: BlobDeleteHeaders + 200: { + bodyMapper: BlockList, + headersMapper: BlockBlobGetBlockListHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobDeleteExceptionHeaders + headersMapper: BlockBlobGetBlockListExceptionHeaders } }, queryParameters: [ timeoutInSeconds, snapshot, - versionId, - blobDeleteType + comp25, + listType ], urlParameters: [url], headerParameters: [ @@ -43632,4712 +59946,4042 @@ var init_blob = __esm({ requestId, accept1, leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - deleteSnapshots + ifTags ], isXML: true, - serializer: xmlSerializer3 + serializer: xmlSerializer6 + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/index.js +var init_operations = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/index.js"() { + init_service(); + init_container(); + init_blob(); + init_pageBlob(); + init_appendBlob(); + init_blockBlob(); + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/log.js +var logger2; +var init_log3 = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/log.js"() { + init_src(); + logger2 = createClientLogger("storage-blob"); + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/constants.js +var SDK_VERSION, SERVICE_VERSION, BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES, BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES, BLOCK_BLOB_MAX_BLOCKS, DEFAULT_BLOCK_BUFFER_SIZE_BYTES, DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES, DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, REQUEST_TIMEOUT, StorageOAuthScopes, URLConstants, HTTPURLConnection, HeaderConstants, ETagNone, ETagAny, SIZE_1_MB, BATCH_MAX_REQUEST, BATCH_MAX_PAYLOAD_IN_BYTES, HTTP_LINE_ENDING, HTTP_VERSION_1_1, EncryptionAlgorithmAES25, DevelopmentConnectionString, StorageBlobLoggingAllowedHeaderNames, StorageBlobLoggingAllowedQueryParameters, BlobUsesCustomerSpecifiedEncryptionMsg, BlobDoesNotUseCustomerSpecifiedEncryption, PathStylePorts; +var init_constants2 = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/constants.js"() { + SDK_VERSION = "12.16.0"; + SERVICE_VERSION = "2023-08-03"; + BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; + BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; + BLOCK_BLOB_MAX_BLOCKS = 5e4; + DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; + DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; + DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; + REQUEST_TIMEOUT = 100 * 1e3; + StorageOAuthScopes = "https://storage.azure.com/.default"; + URLConstants = { + Parameters: { + FORCE_BROWSER_NO_CACHE: "_", + SIGNATURE: "sig", + SNAPSHOT: "snapshot", + VERSIONID: "versionid", + TIMEOUT: "timeout" + } + }; + HTTPURLConnection = { + HTTP_ACCEPTED: 202, + HTTP_CONFLICT: 409, + HTTP_NOT_FOUND: 404, + HTTP_PRECON_FAILED: 412, + HTTP_RANGE_NOT_SATISFIABLE: 416 + }; + HeaderConstants = { + AUTHORIZATION: "Authorization", + AUTHORIZATION_SCHEME: "Bearer", + CONTENT_ENCODING: "Content-Encoding", + CONTENT_ID: "Content-ID", + CONTENT_LANGUAGE: "Content-Language", + CONTENT_LENGTH: "Content-Length", + CONTENT_MD5: "Content-Md5", + CONTENT_TRANSFER_ENCODING: "Content-Transfer-Encoding", + CONTENT_TYPE: "Content-Type", + COOKIE: "Cookie", + DATE: "date", + IF_MATCH: "if-match", + IF_MODIFIED_SINCE: "if-modified-since", + IF_NONE_MATCH: "if-none-match", + IF_UNMODIFIED_SINCE: "if-unmodified-since", + PREFIX_FOR_STORAGE: "x-ms-", + RANGE: "Range", + USER_AGENT: "User-Agent", + X_MS_CLIENT_REQUEST_ID: "x-ms-client-request-id", + X_MS_COPY_SOURCE: "x-ms-copy-source", + X_MS_DATE: "x-ms-date", + X_MS_ERROR_CODE: "x-ms-error-code", + X_MS_VERSION: "x-ms-version" + }; + ETagNone = ""; + ETagAny = "*"; + SIZE_1_MB = 1 * 1024 * 1024; + BATCH_MAX_REQUEST = 256; + BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; + HTTP_LINE_ENDING = "\r\n"; + HTTP_VERSION_1_1 = "HTTP/1.1"; + EncryptionAlgorithmAES25 = "AES256"; + DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; + StorageBlobLoggingAllowedHeaderNames = [ + "Access-Control-Allow-Origin", + "Cache-Control", + "Content-Length", + "Content-Type", + "Date", + "Request-Id", + "traceparent", + "Transfer-Encoding", + "User-Agent", + "x-ms-client-request-id", + "x-ms-date", + "x-ms-error-code", + "x-ms-request-id", + "x-ms-return-client-request-id", + "x-ms-version", + "Accept-Ranges", + "Content-Disposition", + "Content-Encoding", + "Content-Language", + "Content-MD5", + "Content-Range", + "ETag", + "Last-Modified", + "Server", + "Vary", + "x-ms-content-crc64", + "x-ms-copy-action", + "x-ms-copy-completion-time", + "x-ms-copy-id", + "x-ms-copy-progress", + "x-ms-copy-status", + "x-ms-has-immutability-policy", + "x-ms-has-legal-hold", + "x-ms-lease-state", + "x-ms-lease-status", + "x-ms-range", + "x-ms-request-server-encrypted", + "x-ms-server-encrypted", + "x-ms-snapshot", + "x-ms-source-range", + "If-Match", + "If-Modified-Since", + "If-None-Match", + "If-Unmodified-Since", + "x-ms-access-tier", + "x-ms-access-tier-change-time", + "x-ms-access-tier-inferred", + "x-ms-account-kind", + "x-ms-archive-status", + "x-ms-blob-append-offset", + "x-ms-blob-cache-control", + "x-ms-blob-committed-block-count", + "x-ms-blob-condition-appendpos", + "x-ms-blob-condition-maxsize", + "x-ms-blob-content-disposition", + "x-ms-blob-content-encoding", + "x-ms-blob-content-language", + "x-ms-blob-content-length", + "x-ms-blob-content-md5", + "x-ms-blob-content-type", + "x-ms-blob-public-access", + "x-ms-blob-sequence-number", + "x-ms-blob-type", + "x-ms-copy-destination-snapshot", + "x-ms-creation-time", + "x-ms-default-encryption-scope", + "x-ms-delete-snapshots", + "x-ms-delete-type-permanent", + "x-ms-deny-encryption-scope-override", + "x-ms-encryption-algorithm", + "x-ms-if-sequence-number-eq", + "x-ms-if-sequence-number-le", + "x-ms-if-sequence-number-lt", + "x-ms-incremental-copy", + "x-ms-lease-action", + "x-ms-lease-break-period", + "x-ms-lease-duration", + "x-ms-lease-id", + "x-ms-lease-time", + "x-ms-page-write", + "x-ms-proposed-lease-id", + "x-ms-range-get-content-md5", + "x-ms-rehydrate-priority", + "x-ms-sequence-number-action", + "x-ms-sku-name", + "x-ms-source-content-md5", + "x-ms-source-if-match", + "x-ms-source-if-modified-since", + "x-ms-source-if-none-match", + "x-ms-source-if-unmodified-since", + "x-ms-tag-count", + "x-ms-encryption-key-sha256", + "x-ms-if-tags", + "x-ms-source-if-tags" + ]; + StorageBlobLoggingAllowedQueryParameters = [ + "comp", + "maxresults", + "rscc", + "rscd", + "rsce", + "rscl", + "rsct", + "se", + "si", + "sip", + "sp", + "spr", + "sr", + "srt", + "ss", + "st", + "sv", + "include", + "marker", + "prefix", + "copyid", + "restype", + "blockid", + "blocklisttype", + "delimiter", + "prevsnapshot", + "ske", + "skoid", + "sks", + "skt", + "sktid", + "skv", + "snapshot" + ]; + BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; + BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; + PathStylePorts = [ + "10000", + "10001", + "10002", + "10003", + "10004", + "10100", + "10101", + "10102", + "10103", + "10104", + "11000", + "11001", + "11002", + "11003", + "11004", + "11100", + "11101", + "11102", + "11103", + "11104" + ]; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/utils.common.js +function escapeURLPath(url2) { + const urlParsed = URLBuilder.parse(url2); + let path14 = urlParsed.getPath(); + path14 = path14 || "/"; + path14 = escape(path14); + urlParsed.setPath(path14); + return urlParsed.toString(); +} +function getProxyUriFromDevConnString(connectionString) { + let proxyUri = ""; + if (connectionString.search("DevelopmentStorageProxyUri=") !== -1) { + const matchCredentials = connectionString.split(";"); + for (const element of matchCredentials) { + if (element.trim().startsWith("DevelopmentStorageProxyUri=")) { + proxyUri = element.trim().match("DevelopmentStorageProxyUri=(.*)")[1]; + } + } + } + return proxyUri; +} +function getValueInConnString(connectionString, argument) { + const elements = connectionString.split(";"); + for (const element of elements) { + if (element.trim().startsWith(argument)) { + return element.trim().match(argument + "=(.*)")[1]; + } + } + return ""; +} +function extractConnectionStringParts(connectionString) { + let proxyUri = ""; + if (connectionString.startsWith("UseDevelopmentStorage=true")) { + proxyUri = getProxyUriFromDevConnString(connectionString); + connectionString = DevelopmentConnectionString; + } + let blobEndpoint = getValueInConnString(connectionString, "BlobEndpoint"); + blobEndpoint = blobEndpoint.endsWith("/") ? blobEndpoint.slice(0, -1) : blobEndpoint; + if (connectionString.search("DefaultEndpointsProtocol=") !== -1 && connectionString.search("AccountKey=") !== -1) { + let defaultEndpointsProtocol = ""; + let accountName = ""; + let accountKey = Buffer.from("accountKey", "base64"); + let endpointSuffix = ""; + accountName = getValueInConnString(connectionString, "AccountName"); + accountKey = Buffer.from(getValueInConnString(connectionString, "AccountKey"), "base64"); + if (!blobEndpoint) { + defaultEndpointsProtocol = getValueInConnString(connectionString, "DefaultEndpointsProtocol"); + const protocol = defaultEndpointsProtocol.toLowerCase(); + if (protocol !== "https" && protocol !== "http") { + throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'"); + } + endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix"); + if (!endpointSuffix) { + throw new Error("Invalid EndpointSuffix in the provided Connection String"); + } + blobEndpoint = `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`; + } + if (!accountName) { + throw new Error("Invalid AccountName in the provided Connection String"); + } else if (accountKey.length === 0) { + throw new Error("Invalid AccountKey in the provided Connection String"); + } + return { + kind: "AccountConnString", + url: blobEndpoint, + accountName, + accountKey, + proxyUri + }; + } else { + const accountSas = getValueInConnString(connectionString, "SharedAccessSignature"); + let accountName = getValueInConnString(connectionString, "AccountName"); + if (!accountName) { + accountName = getAccountNameFromUrl(blobEndpoint); + } + if (!blobEndpoint) { + throw new Error("Invalid BlobEndpoint in the provided SAS Connection String"); + } else if (!accountSas) { + throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String"); + } + return { kind: "SASConnString", url: blobEndpoint, accountName, accountSas }; + } +} +function escape(text) { + return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); +} +function appendToURLPath(url2, name2) { + const urlParsed = URLBuilder.parse(url2); + let path14 = urlParsed.getPath(); + path14 = path14 ? path14.endsWith("/") ? `${path14}${name2}` : `${path14}/${name2}` : name2; + urlParsed.setPath(path14); + const normalizedUrl = new URL(urlParsed.toString()); + return normalizedUrl.toString(); +} +function setURLParameter(url2, name2, value) { + const urlParsed = URLBuilder.parse(url2); + urlParsed.setQueryParameter(name2, value); + return urlParsed.toString(); +} +function getURLParameter(url2, name2) { + const urlParsed = URLBuilder.parse(url2); + return urlParsed.getQueryParameterValue(name2); +} +function setURLHost(url2, host) { + const urlParsed = URLBuilder.parse(url2); + urlParsed.setHost(host); + return urlParsed.toString(); +} +function getURLPath(url2) { + const urlParsed = URLBuilder.parse(url2); + return urlParsed.getPath(); +} +function getURLScheme(url2) { + const urlParsed = URLBuilder.parse(url2); + return urlParsed.getScheme(); +} +function getURLPathAndQuery(url2) { + const urlParsed = URLBuilder.parse(url2); + const pathString = urlParsed.getPath(); + if (!pathString) { + throw new RangeError("Invalid url without valid path."); + } + let queryString = urlParsed.getQuery() || ""; + queryString = queryString.trim(); + if (queryString !== "") { + queryString = queryString.startsWith("?") ? queryString : `?${queryString}`; + } + return `${pathString}${queryString}`; +} +function getURLQueries(url2) { + let queryString = URLBuilder.parse(url2).getQuery(); + if (!queryString) { + return {}; + } + queryString = queryString.trim(); + queryString = queryString.startsWith("?") ? queryString.substr(1) : queryString; + let querySubStrings = queryString.split("&"); + querySubStrings = querySubStrings.filter((value) => { + const indexOfEqual = value.indexOf("="); + const lastIndexOfEqual = value.lastIndexOf("="); + return indexOfEqual > 0 && indexOfEqual === lastIndexOfEqual && lastIndexOfEqual < value.length - 1; + }); + const queries = {}; + for (const querySubString of querySubStrings) { + const splitResults = querySubString.split("="); + const key = splitResults[0]; + const value = splitResults[1]; + queries[key] = value; + } + return queries; +} +function appendToURLQuery(url2, queryParts) { + const urlParsed = URLBuilder.parse(url2); + let query = urlParsed.getQuery(); + if (query) { + query += "&" + queryParts; + } else { + query = queryParts; + } + urlParsed.setQuery(query); + return urlParsed.toString(); +} +function truncatedISO8061Date(date, withMilliseconds = true) { + const dateString = date.toISOString(); + return withMilliseconds ? dateString.substring(0, dateString.length - 1) + "0000Z" : dateString.substring(0, dateString.length - 5) + "Z"; +} +function base64encode(content) { + return !isNode ? btoa(content) : Buffer.from(content).toString("base64"); +} +function generateBlockID(blockIDPrefix, blockIndex) { + const maxSourceStringLength = 48; + const maxBlockIndexLength = 6; + const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength; + if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) { + blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength); + } + const res = blockIDPrefix + padStart(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0"); + return base64encode(res); +} +async function delay2(timeInMs, aborter, abortError) { + return new Promise((resolve2, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); }; - undeleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobUndeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobUndeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp8], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer3 + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve2(); }; - setExpiryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetExpiryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetExpiryExceptionHeaders + timeout = setTimeout(resolveHandler, timeInMs); + if (aborter !== void 0) { + aborter.addEventListener("abort", abortHandler); + } + }); +} +function padStart(currentString, targetLength, padString = " ") { + if (String.prototype.padStart) { + return currentString.padStart(targetLength, padString); + } + padString = padString || " "; + if (currentString.length > targetLength) { + return currentString; + } else { + targetLength = targetLength - currentString.length; + if (targetLength > padString.length) { + padString += padString.repeat(targetLength / padString.length); + } + return padString.slice(0, targetLength) + currentString; + } +} +function iEqual(str1, str2) { + return str1.toLocaleLowerCase() === str2.toLocaleLowerCase(); +} +function getAccountNameFromUrl(url2) { + const parsedUrl = URLBuilder.parse(url2); + let accountName; + try { + if (parsedUrl.getHost().split(".")[1] === "blob") { + accountName = parsedUrl.getHost().split(".")[0]; + } else if (isIpEndpointStyle(parsedUrl)) { + accountName = parsedUrl.getPath().split("/")[1]; + } else { + accountName = ""; + } + return accountName; + } catch (error) { + throw new Error("Unable to extract accountName with provided information."); + } +} +function isIpEndpointStyle(parsedUrl) { + if (parsedUrl.getHost() === void 0) { + return false; + } + const host = parsedUrl.getHost() + (parsedUrl.getPort() === void 0 ? "" : ":" + parsedUrl.getPort()); + return /^.*:.*:.*$|^(localhost|host.docker.internal)(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(host) || parsedUrl.getPort() !== void 0 && PathStylePorts.includes(parsedUrl.getPort()); +} +function toBlobTagsString(tags2) { + if (tags2 === void 0) { + return void 0; + } + const tagPairs = []; + for (const key in tags2) { + if (Object.prototype.hasOwnProperty.call(tags2, key)) { + const value = tags2[key]; + tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); + } + } + return tagPairs.join("&"); +} +function toBlobTags(tags2) { + if (tags2 === void 0) { + return void 0; + } + const res = { + blobTagSet: [] + }; + for (const key in tags2) { + if (Object.prototype.hasOwnProperty.call(tags2, key)) { + const value = tags2[key]; + res.blobTagSet.push({ + key, + value + }); + } + } + return res; +} +function toTags(tags2) { + if (tags2 === void 0) { + return void 0; + } + const res = {}; + for (const blobTag of tags2.blobTagSet) { + res[blobTag.key] = blobTag.value; + } + return res; +} +function toQuerySerialization(textConfiguration) { + if (textConfiguration === void 0) { + return void 0; + } + switch (textConfiguration.kind) { + case "csv": + return { + format: { + type: "delimited", + delimitedTextConfiguration: { + columnSeparator: textConfiguration.columnSeparator || ",", + fieldQuote: textConfiguration.fieldQuote || "", + recordSeparator: textConfiguration.recordSeparator, + escapeChar: textConfiguration.escapeCharacter || "", + headersPresent: textConfiguration.hasHeaders || false + } } - }, - queryParameters: [timeoutInSeconds, comp11], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - expiryOptions, - expiresOn - ], - isXML: true, - serializer: xmlSerializer3 - }; - setHttpHeadersOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetHttpHeadersHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetHttpHeadersExceptionHeaders + }; + case "json": + return { + format: { + type: "json", + jsonTextConfiguration: { + recordSeparator: textConfiguration.recordSeparator + } } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition - ], - isXML: true, - serializer: xmlSerializer3 - }; - setImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetImmutabilityPolicyExceptionHeaders + }; + case "arrow": + return { + format: { + type: "arrow", + arrowConfiguration: { + schema: textConfiguration.schema + } } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - ifUnmodifiedSince, - immutabilityPolicyExpiry, - immutabilityPolicyMode - ], - isXML: true, - serializer: xmlSerializer3 - }; - deleteImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: BlobDeleteImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders + }; + case "parquet": + return { + format: { + type: "parquet" } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer3 + }; + default: + throw Error("Invalid BlobQueryTextConfiguration."); + } +} +function parseObjectReplicationRecord(objectReplicationRecord) { + if (!objectReplicationRecord) { + return void 0; + } + if ("policy-id" in objectReplicationRecord) { + return void 0; + } + const orProperties = []; + for (const key in objectReplicationRecord) { + const ids = key.split("_"); + const policyPrefix = "or-"; + if (ids[0].startsWith(policyPrefix)) { + ids[0] = ids[0].substring(policyPrefix.length); + } + const rule = { + ruleId: ids[1], + replicationStatus: objectReplicationRecord[key] }; - setLegalHoldOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetLegalHoldHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetLegalHoldExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp13], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - legalHold - ], - isXML: true, - serializer: xmlSerializer3 + const policyIndex = orProperties.findIndex((policy) => policy.policyId === ids[0]); + if (policyIndex > -1) { + orProperties[policyIndex].rules.push(rule); + } else { + orProperties.push({ + policyId: ids[0], + rules: [rule] + }); + } + } + return orProperties; +} +function attachCredential(thing, credential) { + thing.credential = credential; + return thing; +} +function httpAuthorizationToString(httpAuthorization) { + return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : void 0; +} +function BlobNameToString(name2) { + if (name2.encoded) { + return decodeURIComponent(name2.content); + } else { + return name2.content; + } +} +function ConvertInternalResponseOfListBlobFlat(internalResponse) { + return Object.assign(Object.assign({}, internalResponse), { segment: { + blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { + const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); + return blobItem; + }) + } }); +} +function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { + var _a2; + return Object.assign(Object.assign({}, internalResponse), { segment: { + blobPrefixes: (_a2 = internalResponse.segment.blobPrefixes) === null || _a2 === void 0 ? void 0 : _a2.map((blobPrefixInternal) => { + const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); + return blobPrefix; + }), + blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { + const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); + return blobItem; + }) + } }); +} +function* ExtractPageRangeInfoItems(getPageRangesSegment) { + let pageRange = []; + let clearRange = []; + if (getPageRangesSegment.pageRange) + pageRange = getPageRangesSegment.pageRange; + if (getPageRangesSegment.clearRange) + clearRange = getPageRangesSegment.clearRange; + let pageRangeIndex = 0; + let clearRangeIndex = 0; + while (pageRangeIndex < pageRange.length && clearRangeIndex < clearRange.length) { + if (pageRange[pageRangeIndex].start < clearRange[clearRangeIndex].start) { + yield { + start: pageRange[pageRangeIndex].start, + end: pageRange[pageRangeIndex].end, + isClear: false + }; + ++pageRangeIndex; + } else { + yield { + start: clearRange[clearRangeIndex].start, + end: clearRange[clearRangeIndex].end, + isClear: true + }; + ++clearRangeIndex; + } + } + for (; pageRangeIndex < pageRange.length; ++pageRangeIndex) { + yield { + start: pageRange[pageRangeIndex].start, + end: pageRange[pageRangeIndex].end, + isClear: false }; - setMetadataOperationSpec2 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetMetadataExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp6], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - metadata2, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer3 + } + for (; clearRangeIndex < clearRange.length; ++clearRangeIndex) { + yield { + start: clearRange[clearRangeIndex].start, + end: clearRange[clearRangeIndex].end, + isClear: true }; - acquireLeaseOperationSpec2 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseExceptionHeaders + } +} +function EscapePath(blobName) { + const split = blobName.split("/"); + for (let i2 = 0; i2 < split.length; i2++) { + split[i2] = encodeURIComponent(split[i2]); + } + return split.join("/"); +} +var init_utils_common = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/utils.common.js"() { + init_src5(); + init_constants2(); + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js +var StorageBrowserPolicy; +var init_StorageBrowserPolicy = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js"() { + init_src5(); + init_constants2(); + init_utils_common(); + StorageBrowserPolicy = class extends BaseRequestPolicy { + /** + * Creates an instance of StorageBrowserPolicy. + * @param nextPolicy - + * @param options - + */ + // The base class has a protected constructor. Adding a public one to enable constructing of this class. + /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/ + constructor(nextPolicy, options) { + super(nextPolicy, options); + } + /** + * Sends out request. + * + * @param request - + */ + async sendRequest(request) { + if (isNode) { + return this._nextPolicy.sendRequest(request); } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer3 + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(HeaderConstants.COOKIE); + request.headers.remove(HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/StorageBrowserPolicyFactory.js +var StorageBrowserPolicyFactory; +var init_StorageBrowserPolicyFactory = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/StorageBrowserPolicyFactory.js"() { + init_StorageBrowserPolicy(); + StorageBrowserPolicyFactory = class { + /** + * Creates a StorageBrowserPolicyFactory object. + * + * @param nextPolicy - + * @param options - + */ + create(nextPolicy, options) { + return new StorageBrowserPolicy(nextPolicy, options); + } }; - releaseLeaseOperationSpec2 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer3 + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js +var StorageRetryPolicyType, DEFAULT_RETRY_OPTIONS, RETRY_ABORT_ERROR, StorageRetryPolicy; +var init_StorageRetryPolicy = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js"() { + init_abort_controller(); + init_src5(); + init_constants2(); + init_utils_common(); + init_log3(); + (function(StorageRetryPolicyType2) { + StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; + StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; + })(StorageRetryPolicyType || (StorageRetryPolicyType = {})); + DEFAULT_RETRY_OPTIONS = { + maxRetryDelayInMs: 120 * 1e3, + maxTries: 4, + retryDelayInMs: 4 * 1e3, + retryPolicyType: StorageRetryPolicyType.EXPONENTIAL, + secondaryHost: "", + tryTimeoutInMs: void 0 + // Use server side default timeout strategy }; - renewLeaseOperationSpec2 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobRenewLeaseExceptionHeaders + RETRY_ABORT_ERROR = new AbortError("The operation was aborted."); + StorageRetryPolicy = class extends BaseRequestPolicy { + /** + * Creates an instance of RetryPolicy. + * + * @param nextPolicy - + * @param options - + * @param retryOptions - + */ + constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS) { + super(nextPolicy, options); + this.retryOptions = { + retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS.retryPolicyType, + maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS.maxTries, + tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs, + retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS.retryDelayInMs, + maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs, + secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS.secondaryHost + }; + } + /** + * Sends request. + * + * @param request - + */ + async sendRequest(request) { + return this.attemptSendRequest(request, false, 1); + } + /** + * Decide and perform next retry. Won't mutate request parameter. + * + * @param request - + * @param secondaryHas404 - If attempt was against the secondary & it returned a StatusNotFound (404), then + * the resource was not found. This may be due to replication delay. So, in this + * case, we'll never try the secondary again for this operation. + * @param attempt - How many retries has been attempted to performed, starting from 1, which includes + * the attempt will be performed by this method call. + */ + async attemptSendRequest(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; + if (!isPrimaryRetry) { + newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost); } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer3 - }; - changeLeaseOperationSpec2 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobChangeLeaseExceptionHeaders + if (this.retryOptions.tryTimeoutInMs) { + newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer3 - }; - breakLeaseOperationSpec2 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobBreakLeaseExceptionHeaders + let response; + try { + logger2.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); + response = await this._nextPolicy.sendRequest(newRequest); + if (!this.shouldRetry(isPrimaryRetry, attempt, response)) { + return response; + } + secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; + } catch (err) { + logger2.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); + if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) { + throw err; + } } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer3 - }; - createSnapshotOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobCreateSnapshotHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotExceptionHeaders + await this.delay(isPrimaryRetry, attempt, request.abortSignal); + return this.attemptSendRequest(request, secondaryHas404, ++attempt); + } + /** + * Decide whether to retry according to last HTTP response and retry counters. + * + * @param isPrimaryRetry - + * @param attempt - + * @param response - + * @param err - + */ + shouldRetry(isPrimaryRetry, attempt, response, err) { + if (attempt >= this.retryOptions.maxTries) { + logger2.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); + return false; } - }, - queryParameters: [timeoutInSeconds, comp14], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - metadata2, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer3 - }; - startCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobStartCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLExceptionHeaders + const retriableErrors = [ + "ETIMEDOUT", + "ESOCKETTIMEDOUT", + "ECONNREFUSED", + "ECONNRESET", + "ENOENT", + "ENOTFOUND", + "TIMEOUT", + "EPIPE", + "REQUEST_SEND_ERROR" + // For default xhr based http client provided in ms-rest-js + ]; + if (err) { + for (const retriableError of retriableErrors) { + if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { + logger2.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); + return true; + } + } } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - metadata2, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - tier, - rehydratePriority, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sealBlob, - legalHold1 - ], - isXML: true, - serializer: xmlSerializer3 - }; - copyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCopyFromURLExceptionHeaders + if (response || err) { + const statusCode = response ? response.status : err ? err.statusCode : 0; + if (!isPrimaryRetry && statusCode === 404) { + logger2.info(`RetryPolicy: Secondary access with 404, will retry.`); + return true; + } + if (statusCode === 503 || statusCode === 500) { + logger2.info(`RetryPolicy: Will retry for status code ${statusCode}.`); + return true; + } } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - metadata2, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - copySource, - blobTagsString, - legalHold1, - xMsRequiresSync, - sourceContentMD5, - copySourceAuthorization, - copySourceTags - ], - isXML: true, - serializer: xmlSerializer3 - }; - abortCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobAbortCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLExceptionHeaders + if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) { + logger2.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); + return true; } - }, - queryParameters: [ - timeoutInSeconds, - comp15, - copyId - ], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - leaseId, - copyActionAbortConstant - ], - isXML: true, - serializer: xmlSerializer3 - }; - setTierOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetTierHeaders - }, - 202: { - headersMapper: BlobSetTierHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTierExceptionHeaders + return false; + } + /** + * Delay a calculated time between retries. + * + * @param isPrimaryRetry - + * @param attempt - + * @param abortSignal - + */ + async delay(isPrimaryRetry, attempt, abortSignal) { + let delayTimeInMs = 0; + if (isPrimaryRetry) { + switch (this.retryOptions.retryPolicyType) { + case StorageRetryPolicyType.EXPONENTIAL: + delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); + break; + case StorageRetryPolicyType.FIXED: + delayTimeInMs = this.retryOptions.retryDelayInMs; + break; + } + } else { + delayTimeInMs = Math.random() * 1e3; } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp16 - ], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifTags, - rehydratePriority, - tier1 - ], - isXML: true, - serializer: xmlSerializer3 + logger2.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); + return delay2(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR); + } }; - getAccountInfoOperationSpec3 = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: BlobGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoExceptionHeaders - } - }, - queryParameters: [comp, restype1], - urlParameters: [url], - headerParameters: [version2, accept1], - isXML: true, - serializer: xmlSerializer3 + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/StorageRetryPolicyFactory.js +var StorageRetryPolicyFactory; +var init_StorageRetryPolicyFactory = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/StorageRetryPolicyFactory.js"() { + init_StorageRetryPolicy(); + StorageRetryPolicyFactory = class { + /** + * Creates an instance of StorageRetryPolicyFactory. + * @param retryOptions - + */ + constructor(retryOptions) { + this.retryOptions = retryOptions; + } + /** + * Creates a StorageRetryPolicy object. + * + * @param nextPolicy - + * @param options - + */ + create(nextPolicy, options) { + return new StorageRetryPolicy(nextPolicy, options, this.retryOptions); + } + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/CredentialPolicy.js +var CredentialPolicy; +var init_CredentialPolicy = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/CredentialPolicy.js"() { + init_src5(); + CredentialPolicy = class extends BaseRequestPolicy { + /** + * Sends out request. + * + * @param request - + */ + sendRequest(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } }; - queryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobQueryExceptionHeaders - } - }, - requestBody: queryRequest, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp17 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version2, - requestId, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer3 + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/AnonymousCredentialPolicy.js +var AnonymousCredentialPolicy; +var init_AnonymousCredentialPolicy = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/AnonymousCredentialPolicy.js"() { + init_CredentialPolicy(); + AnonymousCredentialPolicy = class extends CredentialPolicy { + /** + * Creates an instance of AnonymousCredentialPolicy. + * @param nextPolicy - + * @param options - + */ + // The base class has a protected constructor. Adding a public one to enable constructing of this class. + /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/ + constructor(nextPolicy, options) { + super(nextPolicy, options); + } }; - getTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobTags, - headersMapper: BlobGetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetTagsExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer3 + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/credentials/Credential.js +var Credential; +var init_Credential = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/credentials/Credential.js"() { + Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } }; - setTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobSetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTagsExceptionHeaders - } - }, - requestBody: tags, - queryParameters: [ - timeoutInSeconds, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version2, - requestId, - leaseId, - ifTags, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer3 + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/credentials/AnonymousCredential.js +var AnonymousCredential; +var init_AnonymousCredential = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/credentials/AnonymousCredential.js"() { + init_AnonymousCredentialPolicy(); + init_Credential(); + AnonymousCredential = class extends Credential { + /** + * Creates an {@link AnonymousCredentialPolicy} object. + * + * @param nextPolicy - + * @param options - + */ + create(nextPolicy, options) { + return new AnonymousCredentialPolicy(nextPolicy, options); + } }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/pageBlob.js -var PageBlob, xmlSerializer4, serializer, createOperationSpec2, uploadPagesOperationSpec, clearPagesOperationSpec, uploadPagesFromURLOperationSpec, getPageRangesOperationSpec, getPageRangesDiffOperationSpec, resizeOperationSpec, updateSequenceNumberOperationSpec, copyIncrementalOperationSpec; -var init_pageBlob = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/pageBlob.js"() { +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/TelemetryPolicy.js +var TelemetryPolicy; +var init_TelemetryPolicy = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/TelemetryPolicy.js"() { init_src5(); - init_mappers(); - init_parameters(); - PageBlob = class { + init_constants2(); + TelemetryPolicy = class extends BaseRequestPolicy { /** - * Initialize a new instance of the class PageBlob class. - * @param client Reference to the service client + * Creates an instance of TelemetryPolicy. + * @param nextPolicy - + * @param options - + * @param telemetry - */ - constructor(client) { - this.client = client; + constructor(nextPolicy, options, telemetry) { + super(nextPolicy, options); + this.telemetry = telemetry; } /** - * The Create operation creates a new page blob. - * @param contentLength The length of the request. - * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The - * page blob size must be aligned to a 512-byte boundary. - * @param options The options parameters. + * Sends out request. + * + * @param request - */ - create(contentLength2, blobContentLength2, options) { - const operationArguments = { - contentLength: contentLength2, - blobContentLength: blobContentLength2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, createOperationSpec2); + async sendRequest(request) { + if (isNode) { + if (!request.headers) { + request.headers = new HttpHeaders(); + } + if (!request.headers.get(HeaderConstants.USER_AGENT)) { + request.headers.set(HeaderConstants.USER_AGENT, this.telemetry); + } + } + return this._nextPolicy.sendRequest(request); } + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/TelemetryPolicyFactory.js +import * as os2 from "os"; +var TelemetryPolicyFactory; +var init_TelemetryPolicyFactory = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/TelemetryPolicyFactory.js"() { + init_src5(); + init_TelemetryPolicy(); + init_constants2(); + TelemetryPolicyFactory = class { /** - * The Upload Pages operation writes a range of pages to a page blob - * @param contentLength The length of the request. - * @param body Initial data - * @param options The options parameters. + * Creates an instance of TelemetryPolicyFactory. + * @param telemetry - */ - uploadPages(contentLength2, body2, options) { - const operationArguments = { - contentLength: contentLength2, - body: body2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, uploadPagesOperationSpec); + constructor(telemetry) { + const userAgentInfo = []; + if (isNode) { + if (telemetry) { + const telemetryString = telemetry.userAgentPrefix || ""; + if (telemetryString.length > 0 && userAgentInfo.indexOf(telemetryString) === -1) { + userAgentInfo.push(telemetryString); + } + } + const libInfo = `azsdk-js-storageblob/${SDK_VERSION}`; + if (userAgentInfo.indexOf(libInfo) === -1) { + userAgentInfo.push(libInfo); + } + let runtimeInfo = `(NODE-VERSION ${process.version})`; + if (os2) { + runtimeInfo = `(NODE-VERSION ${process.version}; ${os2.type()} ${os2.release()})`; + } + if (userAgentInfo.indexOf(runtimeInfo) === -1) { + userAgentInfo.push(runtimeInfo); + } + } + this.telemetryString = userAgentInfo.join(" "); } /** - * The Clear Pages operation clears a set of pages from a page blob - * @param contentLength The length of the request. - * @param options The options parameters. + * Creates a TelemetryPolicy object. + * + * @param nextPolicy - + * @param options - */ - clearPages(contentLength2, options) { - const operationArguments = { - contentLength: contentLength2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, clearPagesOperationSpec); + create(nextPolicy, options) { + return new TelemetryPolicy(nextPolicy, options, this.telemetryString); + } + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/cache.js +function getCachedDefaultHttpClient2() { + return _defaultHttpClient; +} +var _defaultHttpClient; +var init_cache = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/cache.js"() { + init_src5(); + _defaultHttpClient = new NodeFetchHttpClient(); + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/StorageBearerTokenChallengeAuthenticationPolicy.js +async function beginRefresh2(getAccessToken, retryIntervalInMs, timeoutInMs) { + async function tryGetAccessToken() { + if (Date.now() < timeoutInMs) { + try { + return await getAccessToken(); + } catch (_a2) { + return null; + } + } else { + const finalToken = await getAccessToken(); + if (finalToken === null) { + throw new Error("Failed to refresh access token."); + } + return finalToken; + } + } + let token = await tryGetAccessToken(); + while (token === null) { + await delay(retryIntervalInMs); + token = await tryGetAccessToken(); + } + return token; +} +function createTokenCycler2(credential, scopes, tokenCyclerOptions) { + let refreshWorker = null; + let token = null; + const options = Object.assign(Object.assign({}, DEFAULT_CYCLER_OPTIONS2), tokenCyclerOptions); + const cycler = { + /** + * Produces true if a refresh job is currently in progress. + */ + get isRefreshing() { + return refreshWorker !== null; + }, + /** + * Produces true if the cycler SHOULD refresh (we are within the refresh + * window and not already refreshing) + */ + get shouldRefresh() { + var _a2; + return !cycler.isRefreshing && ((_a2 = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a2 !== void 0 ? _a2 : 0) - options.refreshWindowInMs < Date.now(); + }, + /** + * Produces true if the cycler MUST refresh (null or nearly-expired + * token). + */ + get mustRefresh() { + return token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now(); + } + }; + function refresh(getTokenOptions) { + var _a2; + if (!cycler.isRefreshing) { + const tryGetAccessToken = () => credential.getToken(scopes, getTokenOptions); + refreshWorker = beginRefresh2( + tryGetAccessToken, + options.retryIntervalInMs, + // If we don't have a token, then we should timeout immediately + (_a2 = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a2 !== void 0 ? _a2 : Date.now() + ).then((_token) => { + refreshWorker = null; + token = _token; + return token; + }).catch((reason) => { + refreshWorker = null; + token = null; + throw reason; + }); + } + return refreshWorker; + } + return async (tokenOptions) => { + if (cycler.mustRefresh) + return refresh(tokenOptions); + if (cycler.shouldRefresh) { + refresh(tokenOptions); + } + return token; + }; +} +function getChallenge(response) { + const challenge = response.headers.get("WWW-Authenticate"); + if (response.status === 401 && challenge) { + return challenge; + } + return; +} +function parseChallenge(challenge) { + const bearerChallenge = challenge.slice("Bearer ".length); + const challengeParts = `${bearerChallenge.trim()} `.split(" ").filter((x2) => x2); + const keyValuePairs = challengeParts.map((keyValue) => (([key, value]) => ({ [key]: value }))(keyValue.trim().split("="))); + return keyValuePairs.reduce((a2, b2) => Object.assign(Object.assign({}, a2), b2), {}); +} +function storageBearerTokenChallengeAuthenticationPolicy(credential, scopes) { + let getToken = createTokenCycler2(credential, scopes); + class StorageBearerTokenChallengeAuthenticationPolicy extends BaseRequestPolicy { + constructor(nextPolicy, options) { + super(nextPolicy, options); + } + async sendRequest(webResource) { + if (!webResource.url.toLowerCase().startsWith("https://")) { + throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs."); + } + const getTokenInternal = getToken; + const token = (await getTokenInternal({ + abortSignal: webResource.abortSignal, + tracingOptions: { + tracingContext: webResource.tracingContext + } + })).token; + webResource.headers.set(Constants2.HeaderConstants.AUTHORIZATION, `Bearer ${token}`); + const response = await this._nextPolicy.sendRequest(webResource); + if ((response === null || response === void 0 ? void 0 : response.status) === 401) { + const challenge = getChallenge(response); + if (challenge) { + const challengeInfo = parseChallenge(challenge); + const challengeScopes = challengeInfo.resource_id + Constants2.DefaultScope; + const parsedAuthUri = URLBuilder.parse(challengeInfo.authorization_uri); + const pathSegments = parsedAuthUri.getPath().split("/"); + const tenantId = pathSegments[1]; + const getTokenForChallenge = createTokenCycler2(credential, challengeScopes); + const tokenForChallenge = (await getTokenForChallenge({ + abortSignal: webResource.abortSignal, + tracingOptions: { + tracingContext: webResource.tracingContext + }, + tenantId + })).token; + getToken = getTokenForChallenge; + webResource.headers.set(Constants2.HeaderConstants.AUTHORIZATION, `Bearer ${tokenForChallenge}`); + return this._nextPolicy.sendRequest(webResource); + } + } + return response; + } + } + return { + create: (nextPolicy, options) => { + return new StorageBearerTokenChallengeAuthenticationPolicy(nextPolicy, options); + } + }; +} +var Constants2, DEFAULT_CYCLER_OPTIONS2; +var init_StorageBearerTokenChallengeAuthenticationPolicy = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/StorageBearerTokenChallengeAuthenticationPolicy.js"() { + init_src5(); + init_src5(); + init_src5(); + Constants2 = { + DefaultScope: "/.default", + /** + * Defines constants for use with HTTP headers. + */ + HeaderConstants: { + /** + * The Authorization header. + */ + AUTHORIZATION: "authorization" } + }; + DEFAULT_CYCLER_OPTIONS2 = { + forcedRefreshWindowInMs: 1e3, + retryIntervalInMs: 3e3, + refreshWindowInMs: 1e3 * 60 * 2 + // Start refreshing 2m before expiry + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/Pipeline.js +function isPipelineLike(pipeline) { + if (!pipeline || typeof pipeline !== "object") { + return false; + } + const castPipeline = pipeline; + return Array.isArray(castPipeline.factories) && typeof castPipeline.options === "object" && typeof castPipeline.toServiceClientOptions === "function"; +} +function newPipeline(credential, pipelineOptions = {}) { + var _a2; + if (credential === void 0) { + credential = new AnonymousCredential(); + } + const telemetryPolicy = new TelemetryPolicyFactory(pipelineOptions.userAgentOptions); + const factories = [ + tracingPolicy({ userAgent: telemetryPolicy.telemetryString }), + keepAlivePolicy(pipelineOptions.keepAliveOptions), + telemetryPolicy, + generateClientRequestIdPolicy(), + new StorageBrowserPolicyFactory(), + new StorageRetryPolicyFactory(pipelineOptions.retryOptions), + // Default deserializationPolicy is provided by protocol layer + // Use customized XML char key of "#" so we could deserialize metadata + // with "_" key + deserializationPolicy(void 0, { xmlCharKey: "#" }), + logPolicy({ + logger: logger2.info, + allowedHeaderNames: StorageBlobLoggingAllowedHeaderNames, + allowedQueryParameters: StorageBlobLoggingAllowedQueryParameters + }) + ]; + if (isNode) { + factories.push(proxyPolicy(pipelineOptions.proxyOptions)); + factories.push(disableResponseDecompressionPolicy()); + } + factories.push(isTokenCredential(credential) ? attachCredential(storageBearerTokenChallengeAuthenticationPolicy(credential, (_a2 = pipelineOptions.audience) !== null && _a2 !== void 0 ? _a2 : StorageOAuthScopes), credential) : credential); + return new Pipeline(factories, pipelineOptions); +} +var Pipeline; +var init_Pipeline = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/Pipeline.js"() { + init_src5(); + init_log3(); + init_StorageBrowserPolicyFactory(); + init_StorageRetryPolicyFactory(); + init_AnonymousCredential(); + init_constants2(); + init_TelemetryPolicyFactory(); + init_cache(); + init_utils_common(); + init_StorageBearerTokenChallengeAuthenticationPolicy(); + Pipeline = class { /** - * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a - * URL - * @param sourceUrl Specify a URL to the copy source. - * @param sourceRange Bytes of source data in the specified range. The length of this range should - * match the ContentLength header and x-ms-range/Range destination range header. - * @param contentLength The length of the request. - * @param range The range of bytes to which the source range would be written. The range should be 512 - * aligned and range-end is required. - * @param options The options parameters. + * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface. + * + * @param factories - + * @param options - */ - uploadPagesFromURL(sourceUrl2, sourceRange2, contentLength2, range2, options) { - const operationArguments = { - sourceUrl: sourceUrl2, - sourceRange: sourceRange2, - contentLength: contentLength2, - range: range2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, uploadPagesFromURLOperationSpec); + constructor(factories, options = {}) { + this.factories = factories; + this.options = Object.assign(Object.assign({}, options), { httpClient: options.httpClient || getCachedDefaultHttpClient2() }); } /** - * The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a - * page blob - * @param options The options parameters. + * Transfer Pipeline object to ServiceClientOptions object which is required by + * ServiceClient constructor. + * + * @returns The ServiceClientOptions object from this Pipeline. */ - getPageRanges(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) + toServiceClientOptions() { + return { + httpClient: this.options.httpClient, + requestPolicyFactories: this.factories }; - return this.client.sendOperationRequest(operationArguments, getPageRangesOperationSpec); } + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js +var StorageSharedKeyCredentialPolicy; +var init_StorageSharedKeyCredentialPolicy = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js"() { + init_constants2(); + init_utils_common(); + init_CredentialPolicy(); + StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { /** - * The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were - * changed between target blob and previous snapshot. - * @param options The options parameters. + * Creates an instance of StorageSharedKeyCredentialPolicy. + * @param nextPolicy - + * @param options - + * @param factory - */ - getPageRangesDiff(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getPageRangesDiffOperationSpec); + constructor(nextPolicy, options, factory) { + super(nextPolicy, options); + this.factory = factory; } /** - * Resize the Blob - * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The - * page blob size must be aligned to a 512-byte boundary. - * @param options The options parameters. + * Signs request. + * + * @param request - */ - resize(blobContentLength2, options) { - const operationArguments = { - blobContentLength: blobContentLength2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, resizeOperationSpec); + signRequest(request) { + request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, HeaderConstants.DATE), + this.getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; } /** - * Update the sequence number of the blob - * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request. - * This property applies to page blobs only. This property indicates how the service should modify the - * blob's sequence number - * @param options The options parameters. + * Retrieve header value according to shared key sign rules. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key + * + * @param request - + * @param headerName - */ - updateSequenceNumber(sequenceNumberAction2, options) { - const operationArguments = { - sequenceNumberAction: sequenceNumberAction2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, updateSequenceNumberOperationSpec); + getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; } /** - * The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. - * The snapshot is copied such that only the differential changes between the previously copied - * snapshot are transferred to the destination. The copied snapshots are complete copies of the - * original snapshot and can be read or copied from as usual. This API is supported since REST version - * 2016-05-31. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to - * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would - * appear in a request URI. The source blob must either be public or must be authenticated via a shared - * access signature. - * @param options The options parameters. + * To construct the CanonicalizedHeaders portion of the signature string, follow these steps: + * 1. Retrieve all headers for the resource that begin with x-ms-, including the x-ms-date header. + * 2. Convert each HTTP header name to lowercase. + * 3. Sort the headers lexicographically by header name, in ascending order. + * Each header may appear only once in the string. + * 4. Replace any linear whitespace in the header value with a single space. + * 5. Trim any whitespace around the colon in the header. + * 6. Finally, append a new-line character to each canonicalized header in the resulting list. + * Construct the CanonicalizedHeaders string by concatenating all headers in this list into a single string. + * + * @param request - */ - copyIncremental(copySource2, options) { - const operationArguments = { - copySource: copySource2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, copyIncrementalOperationSpec); + getCanonicalizedHeadersString(request) { + let headersArray = request.headers.headersArray().filter((value) => { + return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); + }); + headersArray.sort((a2, b2) => { + return a2.name.toLowerCase().localeCompare(b2.name.toLowerCase()); + }); + headersArray = headersArray.filter((value, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; } - }; - xmlSerializer4 = new Serializer( - mappers_exports, - /* isXml */ - true - ); - serializer = new Serializer( - mappers_exports, - /* isXml */ - false - ); - createOperationSpec2 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - contentLength, - metadata2, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - blobType, - blobContentLength, - blobSequenceNumber - ], - isXML: true, - serializer: xmlSerializer4 - }; - uploadPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo - ], - mediaType: "binary", - serializer - }; - clearPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobClearPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobClearPagesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - pageWrite1 - ], - isXML: true, - serializer: xmlSerializer4 - }; - uploadPagesFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - sourceUrl, - sourceRange, - sourceContentCrc64, - range1 - ], - isXML: true, - serializer: xmlSerializer4 - }; - getPageRangesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20 - ], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer4 - }; - getPageRangesDiffOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesDiffHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20, - prevsnapshot - ], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags, - prevSnapshotUrl - ], - isXML: true, - serializer: xmlSerializer4 - }; - resizeOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobResizeHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobResizeExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - blobContentLength - ], - isXML: true, - serializer: xmlSerializer4 - }; - updateSequenceNumberOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobUpdateSequenceNumberHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobSequenceNumber, - sequenceNumberAction - ], - isXML: true, - serializer: xmlSerializer4 - }; - copyIncrementalOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: PageBlobCopyIncrementalHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalExceptionHeaders + /** + * Retrieves the webResource canonicalized resource string. + * + * @param request - + */ + getCanonicalizedResourceString(request) { + const path14 = getURLPath(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path14}`; + const queries = getURLQueries(request.url); + const lowercaseQueries = {}; + if (queries) { + const queryKeys = []; + for (const key in queries) { + if (Object.prototype.hasOwnProperty.call(queries, key)) { + const lowercaseKey = key.toLowerCase(); + lowercaseQueries[lowercaseKey] = queries[key]; + queryKeys.push(lowercaseKey); + } + } + queryKeys.sort(); + for (const key of queryKeys) { + canonicalizedResourceString += ` +${key}:${decodeURIComponent(lowercaseQueries[key])}`; + } } - }, - queryParameters: [timeoutInSeconds, comp21], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - copySource - ], - isXML: true, - serializer: xmlSerializer4 + return canonicalizedResourceString; + } }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/appendBlob.js -var AppendBlob, xmlSerializer5, serializer2, createOperationSpec3, appendBlockOperationSpec, appendBlockFromUrlOperationSpec, sealOperationSpec; -var init_appendBlob = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/appendBlob.js"() { - init_src5(); - init_mappers(); - init_parameters(); - AppendBlob = class { +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.js +import { createHmac } from "crypto"; +var StorageSharedKeyCredential; +var init_StorageSharedKeyCredential = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.js"() { + init_StorageSharedKeyCredentialPolicy(); + init_Credential(); + StorageSharedKeyCredential = class extends Credential { /** - * Initialize a new instance of the class AppendBlob class. - * @param client Reference to the service client + * Creates an instance of StorageSharedKeyCredential. + * @param accountName - + * @param accountKey - */ - constructor(client) { - this.client = client; + constructor(accountName, accountKey) { + super(); + this.accountName = accountName; + this.accountKey = Buffer.from(accountKey, "base64"); } /** - * The Create Append Blob operation creates a new append blob. - * @param contentLength The length of the request. - * @param options The options parameters. + * Creates a StorageSharedKeyCredentialPolicy object. + * + * @param nextPolicy - + * @param options - */ - create(contentLength2, options) { - const operationArguments = { - contentLength: contentLength2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, createOperationSpec3); + create(nextPolicy, options) { + return new StorageSharedKeyCredentialPolicy(nextPolicy, options, this); } /** - * The Append Block operation commits a new block of data to the end of an existing append blob. The - * Append Block operation is permitted only if the blob was created with x-ms-blob-type set to - * AppendBlob. Append Block is supported only on version 2015-02-21 version or later. - * @param contentLength The length of the request. - * @param body Initial data - * @param options The options parameters. + * Generates a hash signature for an HTTP request or for a SAS. + * + * @param stringToSign - */ - appendBlock(contentLength2, body2, options) { - const operationArguments = { - contentLength: contentLength2, - body: body2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, appendBlockOperationSpec); + computeHMACSHA256(stringToSign) { + return createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); } + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/storageClientContext.js +var packageName, packageVersion, StorageClientContext; +var init_storageClientContext = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/storageClientContext.js"() { + init_src5(); + packageName = "azure-storage-blob"; + packageVersion = "12.16.0"; + StorageClientContext = class extends ServiceClient { /** - * The Append Block operation commits a new block of data to the end of an existing append blob where - * the contents are read from a source url. The Append Block operation is permitted only if the blob - * was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version - * 2015-02-21 version or later. - * @param sourceUrl Specify a URL to the copy source. - * @param contentLength The length of the request. - * @param options The options parameters. + * Initializes a new instance of the StorageClientContext class. + * @param url The URL of the service account, container, or blob that is the target of the desired + * operation. + * @param options The parameter options */ - appendBlockFromUrl(sourceUrl2, contentLength2, options) { - const operationArguments = { - sourceUrl: sourceUrl2, - contentLength: contentLength2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, appendBlockFromUrlOperationSpec); + constructor(url2, options) { + if (url2 === void 0) { + throw new Error("'url' cannot be null"); + } + if (!options) { + options = {}; + } + if (!options.userAgent) { + const defaultUserAgent = getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + super(void 0, options); + this.requestContentType = "application/json; charset=utf-8"; + this.baseUri = options.endpoint || "{url}"; + this.url = url2; + this.version = options.version || "2023-08-03"; } + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/StorageClient.js +var StorageClient; +var init_StorageClient = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/StorageClient.js"() { + init_storageClientContext(); + init_utils_common(); + init_AnonymousCredential(); + init_StorageSharedKeyCredential(); + init_src5(); + StorageClient = class { /** - * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version - * 2019-12-12 version or later. - * @param options The options parameters. + * Creates an instance of StorageClient. + * @param url - url to resource + * @param pipeline - request policy pipeline. */ - seal(options) { - const operationArguments = { - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, sealOperationSpec); + constructor(url2, pipeline) { + this.url = escapeURLPath(url2); + this.accountName = getAccountNameFromUrl(url2); + this.pipeline = pipeline; + this.storageClientContext = new StorageClientContext(this.url, pipeline.toServiceClientOptions()); + this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); + this.credential = new AnonymousCredential(); + for (const factory of this.pipeline.factories) { + if (isNode && factory instanceof StorageSharedKeyCredential || factory instanceof AnonymousCredential) { + this.credential = factory; + } else if (isTokenCredential(factory.credential)) { + this.credential = factory.credential; + } + } + const storageClientContext = this.storageClientContext; + storageClientContext.requestContentType = void 0; } }; - xmlSerializer5 = new Serializer( - mappers_exports, - /* isXml */ - true - ); - serializer2 = new Serializer( - mappers_exports, - /* isXml */ - false - ); - createOperationSpec3 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobCreateExceptionHeaders + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/tracing.js +function convertTracingToRequestOptionsBase(options) { + var _a2, _b2; + return { + // By passing spanOptions if they exist at runtime, we're backwards compatible with @azure/core-tracing@preview.13 and earlier. + spanOptions: (_a2 = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _a2 === void 0 ? void 0 : _a2.spanOptions, + tracingContext: (_b2 = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _b2 === void 0 ? void 0 : _b2.tracingContext + }; +} +var createSpan2; +var init_tracing = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/tracing.js"() { + init_src4(); + createSpan2 = createSpanFunction({ + packagePrefix: "Azure.Storage.Blob", + namespace: "Microsoft.Storage" + }); + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/BlobSASPermissions.js +var BlobSASPermissions; +var init_BlobSASPermissions = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/BlobSASPermissions.js"() { + BlobSASPermissions = class _BlobSASPermissions { + constructor() { + this.read = false; + this.add = false; + this.create = false; + this.write = false; + this.delete = false; + this.deleteVersion = false; + this.tag = false; + this.move = false; + this.execute = false; + this.setImmutabilityPolicy = false; + this.permanentDelete = false; + } + /** + * Creates a {@link BlobSASPermissions} from the specified permissions string. This method will throw an + * Error if it encounters a character that does not correspond to a valid permission. + * + * @param permissions - + */ + static parse(permissions) { + const blobSASPermissions = new _BlobSASPermissions(); + for (const char of permissions) { + switch (char) { + case "r": + blobSASPermissions.read = true; + break; + case "a": + blobSASPermissions.add = true; + break; + case "c": + blobSASPermissions.create = true; + break; + case "w": + blobSASPermissions.write = true; + break; + case "d": + blobSASPermissions.delete = true; + break; + case "x": + blobSASPermissions.deleteVersion = true; + break; + case "t": + blobSASPermissions.tag = true; + break; + case "m": + blobSASPermissions.move = true; + break; + case "e": + blobSASPermissions.execute = true; + break; + case "i": + blobSASPermissions.setImmutabilityPolicy = true; + break; + case "y": + blobSASPermissions.permanentDelete = true; + break; + default: + throw new RangeError(`Invalid permission: ${char}`); + } } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - contentLength, - metadata2, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - blobTagsString, - legalHold1, - blobType1 - ], - isXML: true, - serializer: xmlSerializer5 - }; - appendBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockExceptionHeaders + return blobSASPermissions; + } + /** + * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it + * and boolean values for them. + * + * @param permissionLike - + */ + static from(permissionLike) { + const blobSASPermissions = new _BlobSASPermissions(); + if (permissionLike.read) { + blobSASPermissions.read = true; } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - maxSize, - appendPosition - ], - mediaType: "binary", - serializer: serializer2 - }; - appendBlockFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders + if (permissionLike.add) { + blobSASPermissions.add = true; } - }, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - transactionalContentMD5, - sourceUrl, - sourceContentCrc64, - maxSize, - appendPosition, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer5 - }; - sealOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: AppendBlobSealHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobSealExceptionHeaders + if (permissionLike.create) { + blobSASPermissions.create = true; } - }, - queryParameters: [timeoutInSeconds, comp23], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - appendPosition - ], - isXML: true, - serializer: xmlSerializer5 + if (permissionLike.write) { + blobSASPermissions.write = true; + } + if (permissionLike.delete) { + blobSASPermissions.delete = true; + } + if (permissionLike.deleteVersion) { + blobSASPermissions.deleteVersion = true; + } + if (permissionLike.tag) { + blobSASPermissions.tag = true; + } + if (permissionLike.move) { + blobSASPermissions.move = true; + } + if (permissionLike.execute) { + blobSASPermissions.execute = true; + } + if (permissionLike.setImmutabilityPolicy) { + blobSASPermissions.setImmutabilityPolicy = true; + } + if (permissionLike.permanentDelete) { + blobSASPermissions.permanentDelete = true; + } + return blobSASPermissions; + } + /** + * Converts the given permissions to a string. Using this method will guarantee the permissions are in an + * order accepted by the service. + * + * @returns A string which represents the BlobSASPermissions + */ + toString() { + const permissions = []; + if (this.read) { + permissions.push("r"); + } + if (this.add) { + permissions.push("a"); + } + if (this.create) { + permissions.push("c"); + } + if (this.write) { + permissions.push("w"); + } + if (this.delete) { + permissions.push("d"); + } + if (this.deleteVersion) { + permissions.push("x"); + } + if (this.tag) { + permissions.push("t"); + } + if (this.move) { + permissions.push("m"); + } + if (this.execute) { + permissions.push("e"); + } + if (this.setImmutabilityPolicy) { + permissions.push("i"); + } + if (this.permanentDelete) { + permissions.push("y"); + } + return permissions.join(""); + } }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/blockBlob.js -var BlockBlob, xmlSerializer6, serializer3, uploadOperationSpec, putBlobFromUrlOperationSpec, stageBlockOperationSpec, stageBlockFromURLOperationSpec, commitBlockListOperationSpec, getBlockListOperationSpec; -var init_blockBlob = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/blockBlob.js"() { - init_src5(); - init_mappers(); - init_parameters(); - BlockBlob = class { - /** - * Initialize a new instance of the class BlockBlob class. - * @param client Reference to the service client - */ - constructor(client) { - this.client = client; - } - /** - * The Upload Block Blob operation updates the content of an existing block blob. Updating an existing - * block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put - * Blob; the content of the existing blob is overwritten with the content of the new blob. To perform a - * partial update of the content of a block blob, use the Put Block List operation. - * @param contentLength The length of the request. - * @param body Initial data - * @param options The options parameters. - */ - upload(contentLength2, body2, options) { - const operationArguments = { - contentLength: contentLength2, - body: body2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, uploadOperationSpec); - } - /** - * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read - * from a given URL. This API is supported beginning with the 2020-04-08 version. Partial updates are - * not supported with Put Blob from URL; the content of an existing blob is overwritten with the - * content of the new blob. To perform partial updates to a block blob’s contents using a source URL, - * use the Put Block from URL API in conjunction with Put Block List. - * @param contentLength The length of the request. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to - * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would - * appear in a request URI. The source blob must either be public or must be authenticated via a shared - * access signature. - * @param options The options parameters. - */ - putBlobFromUrl(contentLength2, copySource2, options) { - const operationArguments = { - contentLength: contentLength2, - copySource: copySource2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, putBlobFromUrlOperationSpec); - } - /** - * The Stage Block operation creates a new block to be committed as part of a blob - * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string - * must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified - * for the blockid parameter must be the same size for each block. - * @param contentLength The length of the request. - * @param body Initial data - * @param options The options parameters. - */ - stageBlock(blockId2, contentLength2, body2, options) { - const operationArguments = { - blockId: blockId2, - contentLength: contentLength2, - body: body2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, stageBlockOperationSpec); +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js +var ContainerSASPermissions; +var init_ContainerSASPermissions = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js"() { + ContainerSASPermissions = class _ContainerSASPermissions { + constructor() { + this.read = false; + this.add = false; + this.create = false; + this.write = false; + this.delete = false; + this.deleteVersion = false; + this.list = false; + this.tag = false; + this.move = false; + this.execute = false; + this.setImmutabilityPolicy = false; + this.permanentDelete = false; + this.filterByTags = false; } /** - * The Stage Block operation creates a new block to be committed as part of a blob where the contents - * are read from a URL. - * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string - * must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified - * for the blockid parameter must be the same size for each block. - * @param contentLength The length of the request. - * @param sourceUrl Specify a URL to the copy source. - * @param options The options parameters. + * Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an + * Error if it encounters a character that does not correspond to a valid permission. + * + * @param permissions - */ - stageBlockFromURL(blockId2, contentLength2, sourceUrl2, options) { - const operationArguments = { - blockId: blockId2, - contentLength: contentLength2, - sourceUrl: sourceUrl2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, stageBlockFromURLOperationSpec); + static parse(permissions) { + const containerSASPermissions = new _ContainerSASPermissions(); + for (const char of permissions) { + switch (char) { + case "r": + containerSASPermissions.read = true; + break; + case "a": + containerSASPermissions.add = true; + break; + case "c": + containerSASPermissions.create = true; + break; + case "w": + containerSASPermissions.write = true; + break; + case "d": + containerSASPermissions.delete = true; + break; + case "l": + containerSASPermissions.list = true; + break; + case "t": + containerSASPermissions.tag = true; + break; + case "x": + containerSASPermissions.deleteVersion = true; + break; + case "m": + containerSASPermissions.move = true; + break; + case "e": + containerSASPermissions.execute = true; + break; + case "i": + containerSASPermissions.setImmutabilityPolicy = true; + break; + case "y": + containerSASPermissions.permanentDelete = true; + break; + case "f": + containerSASPermissions.filterByTags = true; + break; + default: + throw new RangeError(`Invalid permission ${char}`); + } + } + return containerSASPermissions; } /** - * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the - * blob. In order to be written as part of a blob, a block must have been successfully written to the - * server in a prior Put Block operation. You can call Put Block List to update a blob by uploading - * only those blocks that have changed, then committing the new and existing blocks together. You can - * do this by specifying whether to commit a block from the committed block list or from the - * uncommitted block list, or to commit the most recently uploaded version of the block, whichever list - * it may belong to. - * @param blocks Blob Blocks. - * @param options The options parameters. + * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it + * and boolean values for them. + * + * @param permissionLike - */ - commitBlockList(blocks2, options) { - const operationArguments = { - blocks: blocks2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, commitBlockListOperationSpec); + static from(permissionLike) { + const containerSASPermissions = new _ContainerSASPermissions(); + if (permissionLike.read) { + containerSASPermissions.read = true; + } + if (permissionLike.add) { + containerSASPermissions.add = true; + } + if (permissionLike.create) { + containerSASPermissions.create = true; + } + if (permissionLike.write) { + containerSASPermissions.write = true; + } + if (permissionLike.delete) { + containerSASPermissions.delete = true; + } + if (permissionLike.list) { + containerSASPermissions.list = true; + } + if (permissionLike.deleteVersion) { + containerSASPermissions.deleteVersion = true; + } + if (permissionLike.tag) { + containerSASPermissions.tag = true; + } + if (permissionLike.move) { + containerSASPermissions.move = true; + } + if (permissionLike.execute) { + containerSASPermissions.execute = true; + } + if (permissionLike.setImmutabilityPolicy) { + containerSASPermissions.setImmutabilityPolicy = true; + } + if (permissionLike.permanentDelete) { + containerSASPermissions.permanentDelete = true; + } + if (permissionLike.filterByTags) { + containerSASPermissions.filterByTags = true; + } + return containerSASPermissions; } /** - * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block - * blob - * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted - * blocks, or both lists together. - * @param options The options parameters. + * Converts the given permissions to a string. Using this method will guarantee the permissions are in an + * order accepted by the service. + * + * The order of the characters should be as specified here to ensure correctness. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * */ - getBlockList(listType2, options) { - const operationArguments = { - listType: listType2, - options: operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getBlockListOperationSpec); - } - }; - xmlSerializer6 = new Serializer( - mappers_exports, - /* isXml */ - true - ); - serializer3 = new Serializer( - mappers_exports, - /* isXml */ - false - ); - uploadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobUploadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobUploadExceptionHeaders + toString() { + const permissions = []; + if (this.read) { + permissions.push("r"); } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - contentLength, - metadata2, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - blobType2 - ], - mediaType: "binary", - serializer: serializer3 - }; - putBlobFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders + if (this.add) { + permissions.push("a"); } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - contentLength, - metadata2, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sourceContentMD5, - copySourceAuthorization, - copySourceTags, - transactionalContentMD5, - blobType2, - copySourceBlobProperties - ], - isXML: true, - serializer: xmlSerializer6 - }; - stageBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockExceptionHeaders + if (this.create) { + permissions.push("c"); } - }, - requestBody: body1, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2 - ], - mediaType: "binary", - serializer: serializer3 - }; - stageBlockFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLExceptionHeaders + if (this.write) { + permissions.push("w"); } - }, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - sourceUrl, - sourceContentCrc64, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer6 - }; - commitBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobCommitBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListExceptionHeaders + if (this.delete) { + permissions.push("d"); } - }, - requestBody: blocks, - queryParameters: [timeoutInSeconds, comp25], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version2, - requestId, - metadata2, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer6 - }; - getBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListExceptionHeaders + if (this.deleteVersion) { + permissions.push("x"); + } + if (this.list) { + permissions.push("l"); + } + if (this.tag) { + permissions.push("t"); + } + if (this.move) { + permissions.push("m"); + } + if (this.execute) { + permissions.push("e"); } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp25, - listType - ], - urlParameters: [url], - headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer6 + if (this.setImmutabilityPolicy) { + permissions.push("i"); + } + if (this.permanentDelete) { + permissions.push("y"); + } + if (this.filterByTags) { + permissions.push("f"); + } + return permissions.join(""); + } }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/index.js -var init_operations = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/operations/index.js"() { - init_service(); - init_container(); - init_blob(); - init_pageBlob(); - init_appendBlob(); - init_blockBlob(); +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.js +import { createHmac as createHmac2 } from "crypto"; +var UserDelegationKeyCredential; +var init_UserDelegationKeyCredential = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.js"() { + UserDelegationKeyCredential = class { + /** + * Creates an instance of UserDelegationKeyCredential. + * @param accountName - + * @param userDelegationKey - + */ + constructor(accountName, userDelegationKey) { + this.accountName = accountName; + this.userDelegationKey = userDelegationKey; + this.key = Buffer.from(userDelegationKey.value, "base64"); + } + /** + * Generates a hash signature for an HTTP request or for a SAS. + * + * @param stringToSign - + */ + computeHMACSHA256(stringToSign) { + return createHmac2("sha256", this.key).update(stringToSign, "utf8").digest("base64"); + } + }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/log.js -var logger2; -var init_log3 = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/log.js"() { - init_src(); - logger2 = createClientLogger("storage-blob"); +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/SasIPRange.js +function ipRangeToString(ipRange) { + return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; +} +var init_SasIPRange = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/SasIPRange.js"() { } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/constants.js -var SDK_VERSION, SERVICE_VERSION, BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES, BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES, BLOCK_BLOB_MAX_BLOCKS, DEFAULT_BLOCK_BUFFER_SIZE_BYTES, DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES, DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, REQUEST_TIMEOUT, StorageOAuthScopes, URLConstants, HTTPURLConnection, HeaderConstants, ETagNone, ETagAny, SIZE_1_MB, BATCH_MAX_REQUEST, BATCH_MAX_PAYLOAD_IN_BYTES, HTTP_LINE_ENDING, HTTP_VERSION_1_1, EncryptionAlgorithmAES25, DevelopmentConnectionString, StorageBlobLoggingAllowedHeaderNames, StorageBlobLoggingAllowedQueryParameters, BlobUsesCustomerSpecifiedEncryptionMsg, BlobDoesNotUseCustomerSpecifiedEncryption, PathStylePorts; -var init_constants2 = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/constants.js"() { - SDK_VERSION = "12.15.0"; - SERVICE_VERSION = "2023-01-03"; - BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; - BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; - BLOCK_BLOB_MAX_BLOCKS = 5e4; - DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; - DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; - DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; - REQUEST_TIMEOUT = 100 * 1e3; - StorageOAuthScopes = "https://storage.azure.com/.default"; - URLConstants = { - Parameters: { - FORCE_BROWSER_NO_CACHE: "_", - SIGNATURE: "sig", - SNAPSHOT: "snapshot", - VERSIONID: "versionid", - TIMEOUT: "timeout" +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/SASQueryParameters.js +var SASProtocol, SASQueryParameters; +var init_SASQueryParameters = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/SASQueryParameters.js"() { + init_SasIPRange(); + init_utils_common(); + (function(SASProtocol2) { + SASProtocol2["Https"] = "https"; + SASProtocol2["HttpsAndHttp"] = "https,http"; + })(SASProtocol || (SASProtocol = {})); + SASQueryParameters = class { + constructor(version4, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { + this.version = version4; + this.signature = signature; + if (permissionsOrOptions !== void 0 && typeof permissionsOrOptions !== "string") { + this.permissions = permissionsOrOptions.permissions; + this.services = permissionsOrOptions.services; + this.resourceTypes = permissionsOrOptions.resourceTypes; + this.protocol = permissionsOrOptions.protocol; + this.startsOn = permissionsOrOptions.startsOn; + this.expiresOn = permissionsOrOptions.expiresOn; + this.ipRangeInner = permissionsOrOptions.ipRange; + this.identifier = permissionsOrOptions.identifier; + this.encryptionScope = permissionsOrOptions.encryptionScope; + this.resource = permissionsOrOptions.resource; + this.cacheControl = permissionsOrOptions.cacheControl; + this.contentDisposition = permissionsOrOptions.contentDisposition; + this.contentEncoding = permissionsOrOptions.contentEncoding; + this.contentLanguage = permissionsOrOptions.contentLanguage; + this.contentType = permissionsOrOptions.contentType; + if (permissionsOrOptions.userDelegationKey) { + this.signedOid = permissionsOrOptions.userDelegationKey.signedObjectId; + this.signedTenantId = permissionsOrOptions.userDelegationKey.signedTenantId; + this.signedStartsOn = permissionsOrOptions.userDelegationKey.signedStartsOn; + this.signedExpiresOn = permissionsOrOptions.userDelegationKey.signedExpiresOn; + this.signedService = permissionsOrOptions.userDelegationKey.signedService; + this.signedVersion = permissionsOrOptions.userDelegationKey.signedVersion; + this.preauthorizedAgentObjectId = permissionsOrOptions.preauthorizedAgentObjectId; + this.correlationId = permissionsOrOptions.correlationId; + } + } else { + this.services = services; + this.resourceTypes = resourceTypes; + this.expiresOn = expiresOn2; + this.permissions = permissionsOrOptions; + this.protocol = protocol; + this.startsOn = startsOn; + this.ipRangeInner = ipRange; + this.encryptionScope = encryptionScope2; + this.identifier = identifier; + this.resource = resource; + this.cacheControl = cacheControl; + this.contentDisposition = contentDisposition; + this.contentEncoding = contentEncoding; + this.contentLanguage = contentLanguage; + this.contentType = contentType2; + if (userDelegationKey) { + this.signedOid = userDelegationKey.signedObjectId; + this.signedTenantId = userDelegationKey.signedTenantId; + this.signedStartsOn = userDelegationKey.signedStartsOn; + this.signedExpiresOn = userDelegationKey.signedExpiresOn; + this.signedService = userDelegationKey.signedService; + this.signedVersion = userDelegationKey.signedVersion; + this.preauthorizedAgentObjectId = preauthorizedAgentObjectId; + this.correlationId = correlationId; + } + } } - }; - HTTPURLConnection = { - HTTP_ACCEPTED: 202, - HTTP_CONFLICT: 409, - HTTP_NOT_FOUND: 404, - HTTP_PRECON_FAILED: 412, - HTTP_RANGE_NOT_SATISFIABLE: 416 - }; - HeaderConstants = { - AUTHORIZATION: "Authorization", - AUTHORIZATION_SCHEME: "Bearer", - CONTENT_ENCODING: "Content-Encoding", - CONTENT_ID: "Content-ID", - CONTENT_LANGUAGE: "Content-Language", - CONTENT_LENGTH: "Content-Length", - CONTENT_MD5: "Content-Md5", - CONTENT_TRANSFER_ENCODING: "Content-Transfer-Encoding", - CONTENT_TYPE: "Content-Type", - COOKIE: "Cookie", - DATE: "date", - IF_MATCH: "if-match", - IF_MODIFIED_SINCE: "if-modified-since", - IF_NONE_MATCH: "if-none-match", - IF_UNMODIFIED_SINCE: "if-unmodified-since", - PREFIX_FOR_STORAGE: "x-ms-", - RANGE: "Range", - USER_AGENT: "User-Agent", - X_MS_CLIENT_REQUEST_ID: "x-ms-client-request-id", - X_MS_COPY_SOURCE: "x-ms-copy-source", - X_MS_DATE: "x-ms-date", - X_MS_ERROR_CODE: "x-ms-error-code", - X_MS_VERSION: "x-ms-version" - }; - ETagNone = ""; - ETagAny = "*"; - SIZE_1_MB = 1 * 1024 * 1024; - BATCH_MAX_REQUEST = 256; - BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; - HTTP_LINE_ENDING = "\r\n"; - HTTP_VERSION_1_1 = "HTTP/1.1"; - EncryptionAlgorithmAES25 = "AES256"; - DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; - StorageBlobLoggingAllowedHeaderNames = [ - "Access-Control-Allow-Origin", - "Cache-Control", - "Content-Length", - "Content-Type", - "Date", - "Request-Id", - "traceparent", - "Transfer-Encoding", - "User-Agent", - "x-ms-client-request-id", - "x-ms-date", - "x-ms-error-code", - "x-ms-request-id", - "x-ms-return-client-request-id", - "x-ms-version", - "Accept-Ranges", - "Content-Disposition", - "Content-Encoding", - "Content-Language", - "Content-MD5", - "Content-Range", - "ETag", - "Last-Modified", - "Server", - "Vary", - "x-ms-content-crc64", - "x-ms-copy-action", - "x-ms-copy-completion-time", - "x-ms-copy-id", - "x-ms-copy-progress", - "x-ms-copy-status", - "x-ms-has-immutability-policy", - "x-ms-has-legal-hold", - "x-ms-lease-state", - "x-ms-lease-status", - "x-ms-range", - "x-ms-request-server-encrypted", - "x-ms-server-encrypted", - "x-ms-snapshot", - "x-ms-source-range", - "If-Match", - "If-Modified-Since", - "If-None-Match", - "If-Unmodified-Since", - "x-ms-access-tier", - "x-ms-access-tier-change-time", - "x-ms-access-tier-inferred", - "x-ms-account-kind", - "x-ms-archive-status", - "x-ms-blob-append-offset", - "x-ms-blob-cache-control", - "x-ms-blob-committed-block-count", - "x-ms-blob-condition-appendpos", - "x-ms-blob-condition-maxsize", - "x-ms-blob-content-disposition", - "x-ms-blob-content-encoding", - "x-ms-blob-content-language", - "x-ms-blob-content-length", - "x-ms-blob-content-md5", - "x-ms-blob-content-type", - "x-ms-blob-public-access", - "x-ms-blob-sequence-number", - "x-ms-blob-type", - "x-ms-copy-destination-snapshot", - "x-ms-creation-time", - "x-ms-default-encryption-scope", - "x-ms-delete-snapshots", - "x-ms-delete-type-permanent", - "x-ms-deny-encryption-scope-override", - "x-ms-encryption-algorithm", - "x-ms-if-sequence-number-eq", - "x-ms-if-sequence-number-le", - "x-ms-if-sequence-number-lt", - "x-ms-incremental-copy", - "x-ms-lease-action", - "x-ms-lease-break-period", - "x-ms-lease-duration", - "x-ms-lease-id", - "x-ms-lease-time", - "x-ms-page-write", - "x-ms-proposed-lease-id", - "x-ms-range-get-content-md5", - "x-ms-rehydrate-priority", - "x-ms-sequence-number-action", - "x-ms-sku-name", - "x-ms-source-content-md5", - "x-ms-source-if-match", - "x-ms-source-if-modified-since", - "x-ms-source-if-none-match", - "x-ms-source-if-unmodified-since", - "x-ms-tag-count", - "x-ms-encryption-key-sha256", - "x-ms-if-tags", - "x-ms-source-if-tags" - ]; - StorageBlobLoggingAllowedQueryParameters = [ - "comp", - "maxresults", - "rscc", - "rscd", - "rsce", - "rscl", - "rsct", - "se", - "si", - "sip", - "sp", - "spr", - "sr", - "srt", - "ss", - "st", - "sv", - "include", - "marker", - "prefix", - "copyid", - "restype", - "blockid", - "blocklisttype", - "delimiter", - "prevsnapshot", - "ske", - "skoid", - "sks", - "skt", - "sktid", - "skv", - "snapshot" - ]; - BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; - BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; - PathStylePorts = [ - "10000", - "10001", - "10002", - "10003", - "10004", - "10100", - "10101", - "10102", - "10103", - "10104", - "11000", - "11001", - "11002", - "11003", - "11004", - "11100", - "11101", - "11102", - "11103", - "11104" - ]; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/utils.common.js -function escapeURLPath(url2) { - const urlParsed = URLBuilder.parse(url2); - let path15 = urlParsed.getPath(); - path15 = path15 || "/"; - path15 = escape(path15); - urlParsed.setPath(path15); - return urlParsed.toString(); -} -function getProxyUriFromDevConnString(connectionString) { - let proxyUri = ""; - if (connectionString.search("DevelopmentStorageProxyUri=") !== -1) { - const matchCredentials = connectionString.split(";"); - for (const element of matchCredentials) { - if (element.trim().startsWith("DevelopmentStorageProxyUri=")) { - proxyUri = element.trim().match("DevelopmentStorageProxyUri=(.*)")[1]; + /** + * Optional. IP range allowed for this SAS. + * + * @readonly + */ + get ipRange() { + if (this.ipRangeInner) { + return { + end: this.ipRangeInner.end, + start: this.ipRangeInner.start + }; + } + return void 0; + } + /** + * Encodes all SAS query parameters into a string that can be appended to a URL. + * + */ + toString() { + const params = [ + "sv", + "ss", + "srt", + "spr", + "st", + "se", + "sip", + "si", + "ses", + "skoid", + "sktid", + "skt", + "ske", + "sks", + "skv", + "sr", + "sp", + "sig", + "rscc", + "rscd", + "rsce", + "rscl", + "rsct", + "saoid", + "scid" + ]; + const queries = []; + for (const param of params) { + switch (param) { + case "sv": + this.tryAppendQueryParameter(queries, param, this.version); + break; + case "ss": + this.tryAppendQueryParameter(queries, param, this.services); + break; + case "srt": + this.tryAppendQueryParameter(queries, param, this.resourceTypes); + break; + case "spr": + this.tryAppendQueryParameter(queries, param, this.protocol); + break; + case "st": + this.tryAppendQueryParameter(queries, param, this.startsOn ? truncatedISO8061Date(this.startsOn, false) : void 0); + break; + case "se": + this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : void 0); + break; + case "sip": + this.tryAppendQueryParameter(queries, param, this.ipRange ? ipRangeToString(this.ipRange) : void 0); + break; + case "si": + this.tryAppendQueryParameter(queries, param, this.identifier); + break; + case "ses": + this.tryAppendQueryParameter(queries, param, this.encryptionScope); + break; + case "skoid": + this.tryAppendQueryParameter(queries, param, this.signedOid); + break; + case "sktid": + this.tryAppendQueryParameter(queries, param, this.signedTenantId); + break; + case "skt": + this.tryAppendQueryParameter(queries, param, this.signedStartsOn ? truncatedISO8061Date(this.signedStartsOn, false) : void 0); + break; + case "ske": + this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? truncatedISO8061Date(this.signedExpiresOn, false) : void 0); + break; + case "sks": + this.tryAppendQueryParameter(queries, param, this.signedService); + break; + case "skv": + this.tryAppendQueryParameter(queries, param, this.signedVersion); + break; + case "sr": + this.tryAppendQueryParameter(queries, param, this.resource); + break; + case "sp": + this.tryAppendQueryParameter(queries, param, this.permissions); + break; + case "sig": + this.tryAppendQueryParameter(queries, param, this.signature); + break; + case "rscc": + this.tryAppendQueryParameter(queries, param, this.cacheControl); + break; + case "rscd": + this.tryAppendQueryParameter(queries, param, this.contentDisposition); + break; + case "rsce": + this.tryAppendQueryParameter(queries, param, this.contentEncoding); + break; + case "rscl": + this.tryAppendQueryParameter(queries, param, this.contentLanguage); + break; + case "rsct": + this.tryAppendQueryParameter(queries, param, this.contentType); + break; + case "saoid": + this.tryAppendQueryParameter(queries, param, this.preauthorizedAgentObjectId); + break; + case "scid": + this.tryAppendQueryParameter(queries, param, this.correlationId); + break; + } + } + return queries.join("&"); + } + /** + * A private helper method used to filter and append query key/value pairs into an array. + * + * @param queries - + * @param key - + * @param value - + */ + tryAppendQueryParameter(queries, key, value) { + if (!value) { + return; + } + key = encodeURIComponent(key); + value = encodeURIComponent(value); + if (key.length > 0 && value.length > 0) { + queries.push(`${key}=${value}`); + } } - } + }; } - return proxyUri; -} -function getValueInConnString(connectionString, argument) { - const elements = connectionString.split(";"); - for (const element of elements) { - if (element.trim().startsWith(argument)) { - return element.trim().match(argument + "=(.*)")[1]; - } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js +function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { + const version4 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; + const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; + let userDelegationKeyCredential; + if (sharedKeyCredential === void 0 && accountName !== void 0) { + userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); } - return ""; -} -function extractConnectionStringParts(connectionString) { - let proxyUri = ""; - if (connectionString.startsWith("UseDevelopmentStorage=true")) { - proxyUri = getProxyUriFromDevConnString(connectionString); - connectionString = DevelopmentConnectionString; + if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { + throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); } - let blobEndpoint = getValueInConnString(connectionString, "BlobEndpoint"); - blobEndpoint = blobEndpoint.endsWith("/") ? blobEndpoint.slice(0, -1) : blobEndpoint; - if (connectionString.search("DefaultEndpointsProtocol=") !== -1 && connectionString.search("AccountKey=") !== -1) { - let defaultEndpointsProtocol = ""; - let accountName = ""; - let accountKey = Buffer.from("accountKey", "base64"); - let endpointSuffix = ""; - accountName = getValueInConnString(connectionString, "AccountName"); - accountKey = Buffer.from(getValueInConnString(connectionString, "AccountKey"), "base64"); - if (!blobEndpoint) { - defaultEndpointsProtocol = getValueInConnString(connectionString, "DefaultEndpointsProtocol"); - const protocol = defaultEndpointsProtocol.toLowerCase(); - if (protocol !== "https" && protocol !== "http") { - throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'"); - } - endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix"); - if (!endpointSuffix) { - throw new Error("Invalid EndpointSuffix in the provided Connection String"); - } - blobEndpoint = `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`; + if (version4 >= "2020-12-06") { + if (sharedKeyCredential !== void 0) { + return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); + } else { + return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); } - if (!accountName) { - throw new Error("Invalid AccountName in the provided Connection String"); - } else if (accountKey.length === 0) { - throw new Error("Invalid AccountKey in the provided Connection String"); + } + if (version4 >= "2018-11-09") { + if (sharedKeyCredential !== void 0) { + return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); + } else { + if (version4 >= "2020-02-10") { + return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); + } else { + return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); + } } - return { - kind: "AccountConnString", - url: blobEndpoint, - accountName, - accountKey, - proxyUri - }; - } else { - const accountSas = getValueInConnString(connectionString, "SharedAccessSignature"); - const accountName = getAccountNameFromUrl(blobEndpoint); - if (!blobEndpoint) { - throw new Error("Invalid BlobEndpoint in the provided SAS Connection String"); - } else if (!accountSas) { - throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String"); + } + if (version4 >= "2015-04-05") { + if (sharedKeyCredential !== void 0) { + return generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential); + } else { + throw new RangeError("'version' must be >= '2018-11-09' when generating user delegation SAS using user delegation key."); } - return { kind: "SASConnString", url: blobEndpoint, accountName, accountSas }; } + throw new RangeError("'version' must be >= '2015-04-05'."); } -function escape(text) { - return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); -} -function appendToURLPath(url2, name2) { - const urlParsed = URLBuilder.parse(url2); - let path15 = urlParsed.getPath(); - path15 = path15 ? path15.endsWith("/") ? `${path15}${name2}` : `${path15}/${name2}` : name2; - urlParsed.setPath(path15); - const normalizedUrl = new URL(urlParsed.toString()); - return normalizedUrl.toString(); -} -function setURLParameter(url2, name2, value) { - const urlParsed = URLBuilder.parse(url2); - urlParsed.setQueryParameter(name2, value); - return urlParsed.toString(); -} -function getURLParameter(url2, name2) { - const urlParsed = URLBuilder.parse(url2); - return urlParsed.getQueryParameterValue(name2); -} -function setURLHost(url2, host) { - const urlParsed = URLBuilder.parse(url2); - urlParsed.setHost(host); - return urlParsed.toString(); -} -function getURLPath(url2) { - const urlParsed = URLBuilder.parse(url2); - return urlParsed.getPath(); -} -function getURLScheme(url2) { - const urlParsed = URLBuilder.parse(url2); - return urlParsed.getScheme(); -} -function getURLPathAndQuery(url2) { - const urlParsed = URLBuilder.parse(url2); - const pathString = urlParsed.getPath(); - if (!pathString) { - throw new RangeError("Invalid url without valid path."); +function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential) { + blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); + if (!blobSASSignatureValues.identifier && !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) { + throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); } - let queryString = urlParsed.getQuery() || ""; - queryString = queryString.trim(); - if (queryString !== "") { - queryString = queryString.startsWith("?") ? queryString : `?${queryString}`; + let resource = "c"; + if (blobSASSignatureValues.blobName) { + resource = "b"; } - return `${pathString}${queryString}`; + let verifiedPermissions; + if (blobSASSignatureValues.permissions) { + if (blobSASSignatureValues.blobName) { + verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + } else { + verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + } + } + const stringToSign = [ + verifiedPermissions ? verifiedPermissions : "", + blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", + blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", + getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), + blobSASSignatureValues.identifier, + blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", + blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", + blobSASSignatureValues.version, + blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "", + blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "", + blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "", + blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "", + blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "" + ].join("\n"); + const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); + return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType); } -function getURLQueries(url2) { - let queryString = URLBuilder.parse(url2).getQuery(); - if (!queryString) { - return {}; +function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential) { + blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); + if (!blobSASSignatureValues.identifier && !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) { + throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); } - queryString = queryString.trim(); - queryString = queryString.startsWith("?") ? queryString.substr(1) : queryString; - let querySubStrings = queryString.split("&"); - querySubStrings = querySubStrings.filter((value) => { - const indexOfEqual = value.indexOf("="); - const lastIndexOfEqual = value.lastIndexOf("="); - return indexOfEqual > 0 && indexOfEqual === lastIndexOfEqual && lastIndexOfEqual < value.length - 1; - }); - const queries = {}; - for (const querySubString of querySubStrings) { - const splitResults = querySubString.split("="); - const key = splitResults[0]; - const value = splitResults[1]; - queries[key] = value; + let resource = "c"; + let timestamp = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp = blobSASSignatureValues.versionId; + } } - return queries; -} -function appendToURLQuery(url2, queryParts) { - const urlParsed = URLBuilder.parse(url2); - let query = urlParsed.getQuery(); - if (query) { - query += "&" + queryParts; - } else { - query = queryParts; + let verifiedPermissions; + if (blobSASSignatureValues.permissions) { + if (blobSASSignatureValues.blobName) { + verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + } else { + verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + } } - urlParsed.setQuery(query); - return urlParsed.toString(); -} -function truncatedISO8061Date(date, withMilliseconds = true) { - const dateString = date.toISOString(); - return withMilliseconds ? dateString.substring(0, dateString.length - 1) + "0000Z" : dateString.substring(0, dateString.length - 5) + "Z"; -} -function base64encode(content) { - return !isNode ? btoa(content) : Buffer.from(content).toString("base64"); + const stringToSign = [ + verifiedPermissions ? verifiedPermissions : "", + blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", + blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", + getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), + blobSASSignatureValues.identifier, + blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", + blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", + blobSASSignatureValues.version, + resource, + timestamp, + blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "", + blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "", + blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "", + blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "", + blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "" + ].join("\n"); + const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); + return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType); } -function generateBlockID(blockIDPrefix, blockIndex) { - const maxSourceStringLength = 48; - const maxBlockIndexLength = 6; - const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength; - if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) { - blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength); +function generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential) { + blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); + if (!blobSASSignatureValues.identifier && !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) { + throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); } - const res = blockIDPrefix + padStart(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0"); - return base64encode(res); -} -async function delay2(timeInMs, aborter, abortError) { - return new Promise((resolve2, reject) => { - let timeout; - const abortHandler = () => { - if (timeout !== void 0) { - clearTimeout(timeout); - } - reject(abortError); - }; - const resolveHandler = () => { - if (aborter !== void 0) { - aborter.removeEventListener("abort", abortHandler); - } - resolve2(); - }; - timeout = setTimeout(resolveHandler, timeInMs); - if (aborter !== void 0) { - aborter.addEventListener("abort", abortHandler); + let resource = "c"; + let timestamp = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp = blobSASSignatureValues.versionId; } - }); -} -function padStart(currentString, targetLength, padString = " ") { - if (String.prototype.padStart) { - return currentString.padStart(targetLength, padString); } - padString = padString || " "; - if (currentString.length > targetLength) { - return currentString; - } else { - targetLength = targetLength - currentString.length; - if (targetLength > padString.length) { - padString += padString.repeat(targetLength / padString.length); + let verifiedPermissions; + if (blobSASSignatureValues.permissions) { + if (blobSASSignatureValues.blobName) { + verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + } else { + verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); } - return padString.slice(0, targetLength) + currentString; } + const stringToSign = [ + verifiedPermissions ? verifiedPermissions : "", + blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", + blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", + getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), + blobSASSignatureValues.identifier, + blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", + blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", + blobSASSignatureValues.version, + resource, + timestamp, + blobSASSignatureValues.encryptionScope, + blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "", + blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "", + blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "", + blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "", + blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "" + ].join("\n"); + const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); + return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, void 0, void 0, void 0, blobSASSignatureValues.encryptionScope); } -function iEqual(str1, str2) { - return str1.toLocaleLowerCase() === str2.toLocaleLowerCase(); -} -function getAccountNameFromUrl(url2) { - const parsedUrl = URLBuilder.parse(url2); - let accountName; - try { - if (parsedUrl.getHost().split(".")[1] === "blob") { - accountName = parsedUrl.getHost().split(".")[0]; - } else if (isIpEndpointStyle(parsedUrl)) { - accountName = parsedUrl.getPath().split("/")[1]; +function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential) { + blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); + if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) { + throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS."); + } + let resource = "c"; + let timestamp = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp = blobSASSignatureValues.versionId; + } + } + let verifiedPermissions; + if (blobSASSignatureValues.permissions) { + if (blobSASSignatureValues.blobName) { + verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); } else { - accountName = ""; + verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); } - return accountName; - } catch (error) { - throw new Error("Unable to extract accountName with provided information."); } + const stringToSign = [ + verifiedPermissions ? verifiedPermissions : "", + blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", + blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", + getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), + userDelegationKeyCredential.userDelegationKey.signedObjectId, + userDelegationKeyCredential.userDelegationKey.signedTenantId, + userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", + userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", + userDelegationKeyCredential.userDelegationKey.signedService, + userDelegationKeyCredential.userDelegationKey.signedVersion, + blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", + blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", + blobSASSignatureValues.version, + resource, + timestamp, + blobSASSignatureValues.cacheControl, + blobSASSignatureValues.contentDisposition, + blobSASSignatureValues.contentEncoding, + blobSASSignatureValues.contentLanguage, + blobSASSignatureValues.contentType + ].join("\n"); + const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); + return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey); } -function isIpEndpointStyle(parsedUrl) { - if (parsedUrl.getHost() === void 0) { - return false; +function generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential) { + blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); + if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) { + throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS."); } - const host = parsedUrl.getHost() + (parsedUrl.getPort() === void 0 ? "" : ":" + parsedUrl.getPort()); - return /^.*:.*:.*$|^localhost(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(host) || parsedUrl.getPort() !== void 0 && PathStylePorts.includes(parsedUrl.getPort()); -} -function toBlobTagsString(tags2) { - if (tags2 === void 0) { - return void 0; + let resource = "c"; + let timestamp = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp = blobSASSignatureValues.versionId; + } } - const tagPairs = []; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); + let verifiedPermissions; + if (blobSASSignatureValues.permissions) { + if (blobSASSignatureValues.blobName) { + verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + } else { + verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); } } - return tagPairs.join("&"); + const stringToSign = [ + verifiedPermissions ? verifiedPermissions : "", + blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", + blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", + getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), + userDelegationKeyCredential.userDelegationKey.signedObjectId, + userDelegationKeyCredential.userDelegationKey.signedTenantId, + userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", + userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", + userDelegationKeyCredential.userDelegationKey.signedService, + userDelegationKeyCredential.userDelegationKey.signedVersion, + blobSASSignatureValues.preauthorizedAgentObjectId, + void 0, + blobSASSignatureValues.correlationId, + blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", + blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", + blobSASSignatureValues.version, + resource, + timestamp, + blobSASSignatureValues.cacheControl, + blobSASSignatureValues.contentDisposition, + blobSASSignatureValues.contentEncoding, + blobSASSignatureValues.contentLanguage, + blobSASSignatureValues.contentType + ].join("\n"); + const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); + return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId); } -function toBlobTags(tags2) { - if (tags2 === void 0) { - return void 0; +function generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential) { + blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); + if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) { + throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS."); } - const res = { - blobTagSet: [] - }; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - res.blobTagSet.push({ - key, - value - }); + let resource = "c"; + let timestamp = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp = blobSASSignatureValues.versionId; } } - return res; + let verifiedPermissions; + if (blobSASSignatureValues.permissions) { + if (blobSASSignatureValues.blobName) { + verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + } else { + verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + } + } + const stringToSign = [ + verifiedPermissions ? verifiedPermissions : "", + blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", + blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", + getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), + userDelegationKeyCredential.userDelegationKey.signedObjectId, + userDelegationKeyCredential.userDelegationKey.signedTenantId, + userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", + userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", + userDelegationKeyCredential.userDelegationKey.signedService, + userDelegationKeyCredential.userDelegationKey.signedVersion, + blobSASSignatureValues.preauthorizedAgentObjectId, + void 0, + blobSASSignatureValues.correlationId, + blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", + blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", + blobSASSignatureValues.version, + resource, + timestamp, + blobSASSignatureValues.encryptionScope, + blobSASSignatureValues.cacheControl, + blobSASSignatureValues.contentDisposition, + blobSASSignatureValues.contentEncoding, + blobSASSignatureValues.contentLanguage, + blobSASSignatureValues.contentType + ].join("\n"); + const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); + return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId, blobSASSignatureValues.encryptionScope); +} +function getCanonicalName(accountName, containerName, blobName) { + const elements = [`/blob/${accountName}/${containerName}`]; + if (blobName) { + elements.push(`/${blobName}`); + } + return elements.join(""); } -function toTags(tags2) { - if (tags2 === void 0) { - return void 0; +function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) { + const version4 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; + if (blobSASSignatureValues.snapshotTime && version4 < "2018-11-09") { + throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'."); } - const res = {}; - for (const blobTag of tags2.blobTagSet) { - res[blobTag.key] = blobTag.value; + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { + throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); } - return res; -} -function toQuerySerialization(textConfiguration) { - if (textConfiguration === void 0) { - return void 0; + if (blobSASSignatureValues.versionId && version4 < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); } - switch (textConfiguration.kind) { - case "csv": - return { - format: { - type: "delimited", - delimitedTextConfiguration: { - columnSeparator: textConfiguration.columnSeparator || ",", - fieldQuote: textConfiguration.fieldQuote || "", - recordSeparator: textConfiguration.recordSeparator, - escapeChar: textConfiguration.escapeCharacter || "", - headersPresent: textConfiguration.hasHeaders || false - } - } - }; - case "json": - return { - format: { - type: "json", - jsonTextConfiguration: { - recordSeparator: textConfiguration.recordSeparator - } - } - }; - case "arrow": - return { - format: { - type: "arrow", - arrowConfiguration: { - schema: textConfiguration.schema - } - } - }; - case "parquet": - return { - format: { - type: "parquet" - } - }; - default: - throw Error("Invalid BlobQueryTextConfiguration."); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { + throw RangeError("Must provide 'blobName' when providing 'versionId'."); } -} -function parseObjectReplicationRecord(objectReplicationRecord) { - if (!objectReplicationRecord) { - return void 0; + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version4 < "2020-08-04") { + throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); } - if ("policy-id" in objectReplicationRecord) { - return void 0; + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version4 < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); } - const orProperties = []; - for (const key in objectReplicationRecord) { - const ids = key.split("_"); - const policyPrefix = "or-"; - if (ids[0].startsWith(policyPrefix)) { - ids[0] = ids[0].substring(policyPrefix.length); - } - const rule = { - ruleId: ids[1], - replicationStatus: objectReplicationRecord[key] - }; - const policyIndex = orProperties.findIndex((policy) => policy.policyId === ids[0]); - if (policyIndex > -1) { - orProperties[policyIndex].rules.push(rule); - } else { - orProperties.push({ - policyId: ids[0], - rules: [rule] - }); - } + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version4 < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); } - return orProperties; -} -function attachCredential(thing, credential) { - thing.credential = credential; - return thing; -} -function httpAuthorizationToString(httpAuthorization) { - return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : void 0; -} -function BlobNameToString(name2) { - if (name2.encoded) { - return decodeURIComponent(name2.content); - } else { - return name2.content; + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version4 < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); } -} -function ConvertInternalResponseOfListBlobFlat(internalResponse) { - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); -} -function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { - var _a2; - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobPrefixes: (_a2 = internalResponse.segment.blobPrefixes) === null || _a2 === void 0 ? void 0 : _a2.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }), - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); -} -function* ExtractPageRangeInfoItems(getPageRangesSegment) { - let pageRange = []; - let clearRange = []; - if (getPageRangesSegment.pageRange) - pageRange = getPageRangesSegment.pageRange; - if (getPageRangesSegment.clearRange) - clearRange = getPageRangesSegment.clearRange; - let pageRangeIndex = 0; - let clearRangeIndex = 0; - while (pageRangeIndex < pageRange.length && clearRangeIndex < clearRange.length) { - if (pageRange[pageRangeIndex].start < clearRange[clearRangeIndex].start) { - yield { - start: pageRange[pageRangeIndex].start, - end: pageRange[pageRangeIndex].end, - isClear: false - }; - ++pageRangeIndex; - } else { - yield { - start: clearRange[clearRangeIndex].start, - end: clearRange[clearRangeIndex].end, - isClear: true - }; - ++clearRangeIndex; - } + if (version4 < "2020-02-10" && blobSASSignatureValues.permissions && (blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) { + throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission."); } - for (; pageRangeIndex < pageRange.length; ++pageRangeIndex) { - yield { - start: pageRange[pageRangeIndex].start, - end: pageRange[pageRangeIndex].end, - isClear: false - }; + if (version4 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { + throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); } - for (; clearRangeIndex < clearRange.length; ++clearRangeIndex) { - yield { - start: clearRange[clearRangeIndex].start, - end: clearRange[clearRangeIndex].end, - isClear: true - }; + if (version4 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { + throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); } -} -function EscapePath(blobName) { - const split = blobName.split("/"); - for (let i2 = 0; i2 < split.length; i2++) { - split[i2] = encodeURIComponent(split[i2]); + if (blobSASSignatureValues.encryptionScope && version4 < "2020-12-06") { + throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); } - return split.join("/"); + blobSASSignatureValues.version = version4; + return blobSASSignatureValues; } -var init_utils_common = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/utils.common.js"() { - init_src5(); +var init_BlobSASSignatureValues = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js"() { + init_BlobSASPermissions(); + init_ContainerSASPermissions(); + init_StorageSharedKeyCredential(); + init_UserDelegationKeyCredential(); + init_SasIPRange(); + init_SASQueryParameters(); init_constants2(); + init_utils_common(); } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js -var StorageBrowserPolicy; -var init_StorageBrowserPolicy = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js"() { +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/models/index.js +var init_models = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/models/index.js"() { + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/index.js +var init_src6 = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/index.js"() { + init_models(); + init_storageClientContext(); + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobLeaseClient.js +var BlobLeaseClient; +var init_BlobLeaseClient = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobLeaseClient.js"() { init_src5(); + init_src6(); + init_src4(); + init_operations(); init_constants2(); - init_utils_common(); - StorageBrowserPolicy = class extends BaseRequestPolicy { + init_tracing(); + BlobLeaseClient = class { /** - * Creates an instance of StorageBrowserPolicy. - * @param nextPolicy - - * @param options - + * Creates an instance of BlobLeaseClient. + * @param client - The client to make the lease operation requests. + * @param leaseId - Initial proposed lease id. */ - // The base class has a protected constructor. Adding a public one to enable constructing of this class. - /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/ - constructor(nextPolicy, options) { - super(nextPolicy, options); + constructor(client, leaseId2) { + const clientContext = new StorageClientContext(client.url, client.pipeline.toServiceClientOptions()); + this._url = client.url; + if (client.name === void 0) { + this._isContainer = true; + this._containerOrBlobOperation = new Container(clientContext); + } else { + this._isContainer = false; + this._containerOrBlobOperation = new Blob3(clientContext); + } + if (!leaseId2) { + leaseId2 = generateUuid(); + } + this._leaseId = leaseId2; } /** - * Sends out request. + * Gets the lease Id. * - * @param request - + * @readonly */ - async sendRequest(request) { - if (isNode) { - return this._nextPolicy.sendRequest(request); + get leaseId() { + return this._leaseId; + } + /** + * Gets the url. + * + * @readonly + */ + get url() { + return this._url; + } + /** + * Establishes and manages a lock on a container for delete operations, or on a blob + * for write and delete operations. + * The lock duration can be 15 to 60 seconds, or can be infinite. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container + * and + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * + * @param duration - Must be between 15 to 60 seconds, or infinite (-1) + * @param options - option to configure lease management operations. + * @returns Response data for acquire lease operation. + */ + async acquireLease(duration2, options = {}) { + var _a2, _b2, _c2, _d2, _e2, _f; + const { span, updatedOptions } = createSpan2("BlobLeaseClient-acquireLease", options); + if (this._isContainer && (((_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.ifMatch) && ((_b2 = options.conditions) === null || _b2 === void 0 ? void 0 : _b2.ifMatch) !== ETagNone || ((_c2 = options.conditions) === null || _c2 === void 0 ? void 0 : _c2.ifNoneMatch) && ((_d2 = options.conditions) === null || _d2 === void 0 ? void 0 : _d2.ifNoneMatch) !== ETagNone || ((_e2 = options.conditions) === null || _e2 === void 0 ? void 0 : _e2.tagConditions))) { + throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); } - if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + try { + return await this._containerOrBlobOperation.acquireLease(Object.assign({ abortSignal: options.abortSignal, duration: duration2, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }), proposedLeaseId: this._leaseId }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } + } + /** + * To change the ID of the lease. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container + * and + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * + * @param proposedLeaseId - the proposed new lease Id. + * @param options - option to configure lease management operations. + * @returns Response data for change lease operation. + */ + async changeLease(proposedLeaseId2, options = {}) { + var _a2, _b2, _c2, _d2, _e2, _f; + const { span, updatedOptions } = createSpan2("BlobLeaseClient-changeLease", options); + if (this._isContainer && (((_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.ifMatch) && ((_b2 = options.conditions) === null || _b2 === void 0 ? void 0 : _b2.ifMatch) !== ETagNone || ((_c2 = options.conditions) === null || _c2 === void 0 ? void 0 : _c2.ifNoneMatch) && ((_d2 = options.conditions) === null || _d2 === void 0 ? void 0 : _d2.ifNoneMatch) !== ETagNone || ((_e2 = options.conditions) === null || _e2 === void 0 ? void 0 : _e2.tagConditions))) { + throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + } + try { + const response = await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId2, Object.assign({ abortSignal: options.abortSignal, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); + this._leaseId = proposedLeaseId2; + return response; + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } + } + /** + * To free the lease if it is no longer needed so that another client may + * immediately acquire a lease against the container or the blob. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container + * and + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * + * @param options - option to configure lease management operations. + * @returns Response data for release lease operation. + */ + async releaseLease(options = {}) { + var _a2, _b2, _c2, _d2, _e2, _f; + const { span, updatedOptions } = createSpan2("BlobLeaseClient-releaseLease", options); + if (this._isContainer && (((_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.ifMatch) && ((_b2 = options.conditions) === null || _b2 === void 0 ? void 0 : _b2.ifMatch) !== ETagNone || ((_c2 = options.conditions) === null || _c2 === void 0 ? void 0 : _c2.ifNoneMatch) && ((_d2 = options.conditions) === null || _d2 === void 0 ? void 0 : _d2.ifNoneMatch) !== ETagNone || ((_e2 = options.conditions) === null || _e2 === void 0 ? void 0 : _e2.tagConditions))) { + throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + } + try { + return await this._containerOrBlobOperation.releaseLease(this._leaseId, Object.assign({ abortSignal: options.abortSignal, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } + } + /** + * To renew the lease. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container + * and + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * + * @param options - Optional option to configure lease management operations. + * @returns Response data for renew lease operation. + */ + async renewLease(options = {}) { + var _a2, _b2, _c2, _d2, _e2, _f; + const { span, updatedOptions } = createSpan2("BlobLeaseClient-renewLease", options); + if (this._isContainer && (((_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.ifMatch) && ((_b2 = options.conditions) === null || _b2 === void 0 ? void 0 : _b2.ifMatch) !== ETagNone || ((_c2 = options.conditions) === null || _c2 === void 0 ? void 0 : _c2.ifNoneMatch) && ((_d2 = options.conditions) === null || _d2 === void 0 ? void 0 : _d2.ifNoneMatch) !== ETagNone || ((_e2 = options.conditions) === null || _e2 === void 0 ? void 0 : _e2.tagConditions))) { + throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + } + try { + return await this._containerOrBlobOperation.renewLease(this._leaseId, Object.assign({ abortSignal: options.abortSignal, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } + } + /** + * To end the lease but ensure that another client cannot acquire a new lease + * until the current lease period has expired. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container + * and + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * + * @param breakPeriod - Break period + * @param options - Optional options to configure lease management operations. + * @returns Response data for break lease operation. + */ + async breakLease(breakPeriod2, options = {}) { + var _a2, _b2, _c2, _d2, _e2, _f; + const { span, updatedOptions } = createSpan2("BlobLeaseClient-breakLease", options); + if (this._isContainer && (((_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.ifMatch) && ((_b2 = options.conditions) === null || _b2 === void 0 ? void 0 : _b2.ifMatch) !== ETagNone || ((_c2 = options.conditions) === null || _c2 === void 0 ? void 0 : _c2.ifNoneMatch) && ((_d2 = options.conditions) === null || _d2 === void 0 ? void 0 : _d2.ifNoneMatch) !== ETagNone || ((_e2 = options.conditions) === null || _e2 === void 0 ? void 0 : _e2.tagConditions))) { + throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + } + try { + const operationOptions = Object.assign({ abortSignal: options.abortSignal, breakPeriod: breakPeriod2, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)); + return await this._containerOrBlobOperation.breakLease(operationOptions); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } - request.headers.remove(HeaderConstants.COOKIE); - request.headers.remove(HeaderConstants.CONTENT_LENGTH); - return this._nextPolicy.sendRequest(request); } }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/StorageBrowserPolicyFactory.js -var StorageBrowserPolicyFactory; -var init_StorageBrowserPolicyFactory = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/StorageBrowserPolicyFactory.js"() { - init_StorageBrowserPolicy(); - StorageBrowserPolicyFactory = class { +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/RetriableReadableStream.js +import { Readable as Readable2 } from "stream"; +var RetriableReadableStream; +var init_RetriableReadableStream = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/RetriableReadableStream.js"() { + RetriableReadableStream = class extends Readable2 { /** - * Creates a StorageBrowserPolicyFactory object. + * Creates an instance of RetriableReadableStream. * - * @param nextPolicy - + * @param source - The current ReadableStream returned from getter + * @param getter - A method calling downloading request returning + * a new ReadableStream from specified offset + * @param offset - Offset position in original data source to read + * @param count - How much data in original data source to read * @param options - */ - create(nextPolicy, options) { - return new StorageBrowserPolicy(nextPolicy, options); + constructor(source, getter, offset, count, options = {}) { + super({ highWaterMark: options.highWaterMark }); + this.retries = 0; + this.sourceDataHandler = (data) => { + if (this.options.doInjectErrorOnce) { + this.options.doInjectErrorOnce = void 0; + this.source.pause(); + this.source.removeAllListeners("data"); + this.source.emit("end"); + return; + } + this.offset += data.length; + if (this.onProgress) { + this.onProgress({ loadedBytes: this.offset - this.start }); + } + if (!this.push(data)) { + this.source.pause(); + } + }; + this.sourceErrorOrEndHandler = (err) => { + if (err && err.name === "AbortError") { + this.destroy(err); + return; + } + this.removeSourceEventHandlers(); + if (this.offset - 1 === this.end) { + this.push(null); + } else if (this.offset <= this.end) { + if (this.retries < this.maxRetryRequests) { + this.retries += 1; + this.getter(this.offset).then((newSource) => { + this.source = newSource; + this.setSourceEventHandlers(); + return; + }).catch((error) => { + this.destroy(error); + }); + } else { + this.destroy(new Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this.offset - 1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`)); + } + } else { + this.destroy(new Error(`Data corruption failure: Received more data than original request, data needed offset is ${this.end}, received offset: ${this.offset - 1}`)); + } + }; + this.getter = getter; + this.source = source; + this.start = offset; + this.offset = offset; + this.end = offset + count - 1; + this.maxRetryRequests = options.maxRetryRequests && options.maxRetryRequests >= 0 ? options.maxRetryRequests : 0; + this.onProgress = options.onProgress; + this.options = options; + this.setSourceEventHandlers(); + } + _read() { + this.source.resume(); + } + setSourceEventHandlers() { + this.source.on("data", this.sourceDataHandler); + this.source.on("end", this.sourceErrorOrEndHandler); + this.source.on("error", this.sourceErrorOrEndHandler); + } + removeSourceEventHandlers() { + this.source.removeListener("data", this.sourceDataHandler); + this.source.removeListener("end", this.sourceErrorOrEndHandler); + this.source.removeListener("error", this.sourceErrorOrEndHandler); + } + _destroy(error, callback) { + this.removeSourceEventHandlers(); + this.source.destroy(); + callback(error === null ? void 0 : error); } }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js -var StorageRetryPolicyType, DEFAULT_RETRY_OPTIONS, RETRY_ABORT_ERROR, StorageRetryPolicy; -var init_StorageRetryPolicy = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js"() { - init_abort_controller(); - init_src5(); - init_constants2(); - init_utils_common(); - init_log3(); - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(StorageRetryPolicyType || (StorageRetryPolicyType = {})); - DEFAULT_RETRY_OPTIONS = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: void 0 - // Use server side default timeout strategy - }; - RETRY_ABORT_ERROR = new AbortError("The operation was aborted."); - StorageRetryPolicy = class extends BaseRequestPolicy { + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobDownloadResponse.js +var BlobDownloadResponse; +var init_BlobDownloadResponse = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobDownloadResponse.js"() { + init_src5(); + init_RetriableReadableStream(); + BlobDownloadResponse = class { /** - * Creates an instance of RetryPolicy. + * Creates an instance of BlobDownloadResponse. * - * @param nextPolicy - + * @param originalResponse - + * @param getter - + * @param offset - + * @param count - * @param options - - * @param retryOptions - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS) { - super(nextPolicy, options); - this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS.secondaryHost - }; + constructor(originalResponse, getter, offset, count, options = {}) { + this.originalResponse = originalResponse; + this.blobDownloadStream = new RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); } /** - * Sends request. + * Indicates that the service supports + * requests for partial file content. * - * @param request - + * @readonly */ - async sendRequest(request) { - return this.attemptSendRequest(request, false, 1); + get acceptRanges() { + return this.originalResponse.acceptRanges; } /** - * Decide and perform next retry. Won't mutate request parameter. + * Returns if it was previously specified + * for the file. * - * @param request - - * @param secondaryHas404 - If attempt was against the secondary & it returned a StatusNotFound (404), then - * the resource was not found. This may be due to replication delay. So, in this - * case, we'll never try the secondary again for this operation. - * @param attempt - How many retries has been attempted to performed, starting from 1, which includes - * the attempt will be performed by this method call. + * @readonly */ - async attemptSendRequest(request, secondaryHas404, attempt) { - const newRequest = request.clone(); - const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; - if (!isPrimaryRetry) { - newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost); - } - if (this.retryOptions.tryTimeoutInMs) { - newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); - } - let response; - try { - logger2.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await this._nextPolicy.sendRequest(newRequest); - if (!this.shouldRetry(isPrimaryRetry, attempt, response)) { - return response; - } - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; - } catch (err) { - logger2.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); - if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) { - throw err; - } - } - await this.delay(isPrimaryRetry, attempt, request.abortSignal); - return this.attemptSendRequest(request, secondaryHas404, ++attempt); + get cacheControl() { + return this.originalResponse.cacheControl; } /** - * Decide whether to retry according to last HTTP response and retry counters. + * Returns the value that was specified + * for the 'x-ms-content-disposition' header and specifies how to process the + * response. * - * @param isPrimaryRetry - - * @param attempt - - * @param response - - * @param err - + * @readonly */ - shouldRetry(isPrimaryRetry, attempt, response, err) { - if (attempt >= this.retryOptions.maxTries) { - logger2.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); - return false; - } - const retriableErrors = [ - "ETIMEDOUT", - "ESOCKETTIMEDOUT", - "ECONNREFUSED", - "ECONNRESET", - "ENOENT", - "ENOTFOUND", - "TIMEOUT", - "EPIPE", - "REQUEST_SEND_ERROR" - // For default xhr based http client provided in ms-rest-js - ]; - if (err) { - for (const retriableError of retriableErrors) { - if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { - logger2.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; - } - } - } - if (response || err) { - const statusCode = response ? response.status : err ? err.statusCode : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger2.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - logger2.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; - } - } - if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger2.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; - } - return false; + get contentDisposition() { + return this.originalResponse.contentDisposition; } /** - * Delay a calculated time between retries. + * Returns the value that was specified + * for the Content-Encoding request header. * - * @param isPrimaryRetry - - * @param attempt - - * @param abortSignal - - */ - async delay(isPrimaryRetry, attempt, abortSignal) { - let delayTimeInMs = 0; - if (isPrimaryRetry) { - switch (this.retryOptions.retryPolicyType) { - case StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); - break; - case StorageRetryPolicyType.FIXED: - delayTimeInMs = this.retryOptions.retryDelayInMs; - break; - } - } else { - delayTimeInMs = Math.random() * 1e3; - } - logger2.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delay2(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR); - } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/StorageRetryPolicyFactory.js -var StorageRetryPolicyFactory; -var init_StorageRetryPolicyFactory = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/StorageRetryPolicyFactory.js"() { - init_StorageRetryPolicy(); - StorageRetryPolicyFactory = class { - /** - * Creates an instance of StorageRetryPolicyFactory. - * @param retryOptions - + * @readonly */ - constructor(retryOptions) { - this.retryOptions = retryOptions; + get contentEncoding() { + return this.originalResponse.contentEncoding; } /** - * Creates a StorageRetryPolicy object. + * Returns the value that was specified + * for the Content-Language request header. * - * @param nextPolicy - - * @param options - + * @readonly */ - create(nextPolicy, options) { - return new StorageRetryPolicy(nextPolicy, options, this.retryOptions); + get contentLanguage() { + return this.originalResponse.contentLanguage; } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/CredentialPolicy.js -var CredentialPolicy; -var init_CredentialPolicy = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/CredentialPolicy.js"() { - init_src5(); - CredentialPolicy = class extends BaseRequestPolicy { /** - * Sends out request. + * The current sequence number for a + * page blob. This header is not returned for block blobs or append blobs. * - * @param request - + * @readonly */ - sendRequest(request) { - return this._nextPolicy.sendRequest(this.signRequest(request)); + get blobSequenceNumber() { + return this.originalResponse.blobSequenceNumber; } /** - * Child classes must implement this method with request signing. This method - * will be executed in {@link sendRequest}. + * The blob's type. Possible values include: + * 'BlockBlob', 'PageBlob', 'AppendBlob'. * - * @param request - + * @readonly */ - signRequest(request) { - return request; + get blobType() { + return this.originalResponse.blobType; } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/AnonymousCredentialPolicy.js -var AnonymousCredentialPolicy; -var init_AnonymousCredentialPolicy = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/AnonymousCredentialPolicy.js"() { - init_CredentialPolicy(); - AnonymousCredentialPolicy = class extends CredentialPolicy { /** - * Creates an instance of AnonymousCredentialPolicy. - * @param nextPolicy - - * @param options - + * The number of bytes present in the + * response body. + * + * @readonly */ - // The base class has a protected constructor. Adding a public one to enable constructing of this class. - /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/ - constructor(nextPolicy, options) { - super(nextPolicy, options); + get contentLength() { + return this.originalResponse.contentLength; } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/credentials/Credential.js -var Credential; -var init_Credential = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/credentials/Credential.js"() { - Credential = class { /** - * Creates a RequestPolicy object. + * If the file has an MD5 hash and the + * request is to read the full file, this response header is returned so that + * the client can check for message content integrity. If the request is to + * read a specified range and the 'x-ms-range-get-content-md5' is set to + * true, then the request returns an MD5 hash for the range, as long as the + * range size is less than or equal to 4 MB. If neither of these sets of + * conditions is true, then no value is returned for the 'Content-MD5' + * header. * - * @param _nextPolicy - - * @param _options - + * @readonly */ - create(_nextPolicy, _options) { - throw new Error("Method should be implemented in children classes."); + get contentMD5() { + return this.originalResponse.contentMD5; } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/credentials/AnonymousCredential.js -var AnonymousCredential; -var init_AnonymousCredential = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/credentials/AnonymousCredential.js"() { - init_AnonymousCredentialPolicy(); - init_Credential(); - AnonymousCredential = class extends Credential { /** - * Creates an {@link AnonymousCredentialPolicy} object. + * Indicates the range of bytes returned if + * the client requested a subset of the file by setting the Range request + * header. * - * @param nextPolicy - - * @param options - + * @readonly */ - create(nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); + get contentRange() { + return this.originalResponse.contentRange; } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/TelemetryPolicy.js -var TelemetryPolicy; -var init_TelemetryPolicy = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/TelemetryPolicy.js"() { - init_src5(); - init_constants2(); - TelemetryPolicy = class extends BaseRequestPolicy { /** - * Creates an instance of TelemetryPolicy. - * @param nextPolicy - - * @param options - - * @param telemetry - + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly */ - constructor(nextPolicy, options, telemetry) { - super(nextPolicy, options); - this.telemetry = telemetry; + get contentType() { + return this.originalResponse.contentType; } /** - * Sends out request. + * Conclusion time of the last attempted + * Copy File operation where this file was the destination file. This value + * can specify the time of a completed, aborted, or failed copy attempt. * - * @param request - + * @readonly */ - async sendRequest(request) { - if (isNode) { - if (!request.headers) { - request.headers = new HttpHeaders(); - } - if (!request.headers.get(HeaderConstants.USER_AGENT)) { - request.headers.set(HeaderConstants.USER_AGENT, this.telemetry); - } - } - return this._nextPolicy.sendRequest(request); + get copyCompletedOn() { + return this.originalResponse.copyCompletedOn; } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/TelemetryPolicyFactory.js -import * as os2 from "os"; -var TelemetryPolicyFactory; -var init_TelemetryPolicyFactory = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/TelemetryPolicyFactory.js"() { - init_src5(); - init_TelemetryPolicy(); - init_constants2(); - TelemetryPolicyFactory = class { /** - * Creates an instance of TelemetryPolicyFactory. - * @param telemetry - + * String identifier for the last attempted Copy + * File operation where this file was the destination file. + * + * @readonly */ - constructor(telemetry) { - const userAgentInfo = []; - if (isNode) { - if (telemetry) { - const telemetryString = telemetry.userAgentPrefix || ""; - if (telemetryString.length > 0 && userAgentInfo.indexOf(telemetryString) === -1) { - userAgentInfo.push(telemetryString); - } - } - const libInfo = `azsdk-js-storageblob/${SDK_VERSION}`; - if (userAgentInfo.indexOf(libInfo) === -1) { - userAgentInfo.push(libInfo); - } - let runtimeInfo = `(NODE-VERSION ${process.version})`; - if (os2) { - runtimeInfo = `(NODE-VERSION ${process.version}; ${os2.type()} ${os2.release()})`; - } - if (userAgentInfo.indexOf(runtimeInfo) === -1) { - userAgentInfo.push(runtimeInfo); - } - } - this.telemetryString = userAgentInfo.join(" "); + get copyId() { + return this.originalResponse.copyId; } /** - * Creates a TelemetryPolicy object. + * Contains the number of bytes copied and + * the total bytes in the source in the last attempted Copy File operation + * where this file was the destination file. Can show between 0 and + * Content-Length bytes copied. * - * @param nextPolicy - - * @param options - + * @readonly */ - create(nextPolicy, options) { - return new TelemetryPolicy(nextPolicy, options, this.telemetryString); - } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/cache.js -function getCachedDefaultHttpClient2() { - return _defaultHttpClient; -} -var _defaultHttpClient; -var init_cache = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/cache.js"() { - init_src5(); - _defaultHttpClient = new NodeFetchHttpClient(); - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/StorageBearerTokenChallengeAuthenticationPolicy.js -async function beginRefresh2(getAccessToken, retryIntervalInMs, timeoutInMs) { - async function tryGetAccessToken() { - if (Date.now() < timeoutInMs) { - try { - return await getAccessToken(); - } catch (_a2) { - return null; - } - } else { - const finalToken = await getAccessToken(); - if (finalToken === null) { - throw new Error("Failed to refresh access token."); + get copyProgress() { + return this.originalResponse.copyProgress; } - return finalToken; - } - } - let token = await tryGetAccessToken(); - while (token === null) { - await delay(retryIntervalInMs); - token = await tryGetAccessToken(); - } - return token; -} -function createTokenCycler2(credential, scopes, tokenCyclerOptions) { - let refreshWorker = null; - let token = null; - const options = Object.assign(Object.assign({}, DEFAULT_CYCLER_OPTIONS2), tokenCyclerOptions); - const cycler = { - /** - * Produces true if a refresh job is currently in progress. - */ - get isRefreshing() { - return refreshWorker !== null; - }, - /** - * Produces true if the cycler SHOULD refresh (we are within the refresh - * window and not already refreshing) - */ - get shouldRefresh() { - var _a2; - return !cycler.isRefreshing && ((_a2 = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a2 !== void 0 ? _a2 : 0) - options.refreshWindowInMs < Date.now(); - }, - /** - * Produces true if the cycler MUST refresh (null or nearly-expired - * token). - */ - get mustRefresh() { - return token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now(); - } - }; - function refresh(getTokenOptions) { - var _a2; - if (!cycler.isRefreshing) { - const tryGetAccessToken = () => credential.getToken(scopes, getTokenOptions); - refreshWorker = beginRefresh2( - tryGetAccessToken, - options.retryIntervalInMs, - // If we don't have a token, then we should timeout immediately - (_a2 = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a2 !== void 0 ? _a2 : Date.now() - ).then((_token) => { - refreshWorker = null; - token = _token; - return token; - }).catch((reason) => { - refreshWorker = null; - token = null; - throw reason; - }); - } - return refreshWorker; - } - return async (tokenOptions) => { - if (cycler.mustRefresh) - return refresh(tokenOptions); - if (cycler.shouldRefresh) { - refresh(tokenOptions); - } - return token; - }; -} -function getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; -} -function parseChallenge(challenge) { - const bearerChallenge = challenge.slice("Bearer ".length); - const challengeParts = `${bearerChallenge.trim()} `.split(" ").filter((x2) => x2); - const keyValuePairs = challengeParts.map((keyValue) => (([key, value]) => ({ [key]: value }))(keyValue.trim().split("="))); - return keyValuePairs.reduce((a2, b2) => Object.assign(Object.assign({}, a2), b2), {}); -} -function storageBearerTokenChallengeAuthenticationPolicy(credential, scopes) { - let getToken = createTokenCycler2(credential, scopes); - class StorageBearerTokenChallengeAuthenticationPolicy extends BaseRequestPolicy { - constructor(nextPolicy, options) { - super(nextPolicy, options); - } - async sendRequest(webResource) { - if (!webResource.url.toLowerCase().startsWith("https://")) { - throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs."); + /** + * URL up to 2KB in length that specifies the + * source file used in the last attempted Copy File operation where this file + * was the destination file. + * + * @readonly + */ + get copySource() { + return this.originalResponse.copySource; } - const getTokenInternal = getToken; - const token = (await getTokenInternal({ - abortSignal: webResource.abortSignal, - tracingOptions: { - tracingContext: webResource.tracingContext - } - })).token; - webResource.headers.set(Constants2.HeaderConstants.AUTHORIZATION, `Bearer ${token}`); - const response = await this._nextPolicy.sendRequest(webResource); - if ((response === null || response === void 0 ? void 0 : response.status) === 401) { - const challenge = getChallenge(response); - if (challenge) { - const challengeInfo = parseChallenge(challenge); - const challengeScopes = challengeInfo.resource_id + Constants2.DefaultScope; - const parsedAuthUri = URLBuilder.parse(challengeInfo.authorization_uri); - const pathSegments = parsedAuthUri.getPath().split("/"); - const tenantId = pathSegments[1]; - const getTokenForChallenge = createTokenCycler2(credential, challengeScopes); - const tokenForChallenge = (await getTokenForChallenge({ - abortSignal: webResource.abortSignal, - tracingOptions: { - tracingContext: webResource.tracingContext - }, - tenantId - })).token; - getToken = getTokenForChallenge; - webResource.headers.set(Constants2.HeaderConstants.AUTHORIZATION, `Bearer ${tokenForChallenge}`); - return this._nextPolicy.sendRequest(webResource); - } + /** + * State of the copy operation + * identified by 'x-ms-copy-id'. Possible values include: 'pending', + * 'success', 'aborted', 'failed' + * + * @readonly + */ + get copyStatus() { + return this.originalResponse.copyStatus; } - return response; - } - } - return { - create: (nextPolicy, options) => { - return new StorageBearerTokenChallengeAuthenticationPolicy(nextPolicy, options); - } - }; -} -var Constants2, DEFAULT_CYCLER_OPTIONS2; -var init_StorageBearerTokenChallengeAuthenticationPolicy = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/StorageBearerTokenChallengeAuthenticationPolicy.js"() { - init_src5(); - init_src5(); - init_src5(); - Constants2 = { - DefaultScope: "/.default", /** - * Defines constants for use with HTTP headers. + * Only appears when + * x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + * + * @readonly */ - HeaderConstants: { - /** - * The Authorization header. - */ - AUTHORIZATION: "authorization" + get copyStatusDescription() { + return this.originalResponse.copyStatusDescription; } - }; - DEFAULT_CYCLER_OPTIONS2 = { - forcedRefreshWindowInMs: 1e3, - retryIntervalInMs: 3e3, - refreshWindowInMs: 1e3 * 60 * 2 - // Start refreshing 2m before expiry - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/Pipeline.js -function isPipelineLike(pipeline) { - if (!pipeline || typeof pipeline !== "object") { - return false; - } - const castPipeline = pipeline; - return Array.isArray(castPipeline.factories) && typeof castPipeline.options === "object" && typeof castPipeline.toServiceClientOptions === "function"; -} -function newPipeline(credential, pipelineOptions = {}) { - var _a2; - if (credential === void 0) { - credential = new AnonymousCredential(); - } - const telemetryPolicy = new TelemetryPolicyFactory(pipelineOptions.userAgentOptions); - const factories = [ - tracingPolicy({ userAgent: telemetryPolicy.telemetryString }), - keepAlivePolicy(pipelineOptions.keepAliveOptions), - telemetryPolicy, - generateClientRequestIdPolicy(), - new StorageBrowserPolicyFactory(), - new StorageRetryPolicyFactory(pipelineOptions.retryOptions), - // Default deserializationPolicy is provided by protocol layer - // Use customized XML char key of "#" so we could deserialize metadata - // with "_" key - deserializationPolicy(void 0, { xmlCharKey: "#" }), - logPolicy({ - logger: logger2.info, - allowedHeaderNames: StorageBlobLoggingAllowedHeaderNames, - allowedQueryParameters: StorageBlobLoggingAllowedQueryParameters - }) - ]; - if (isNode) { - factories.push(proxyPolicy(pipelineOptions.proxyOptions)); - factories.push(disableResponseDecompressionPolicy()); - } - factories.push(isTokenCredential(credential) ? attachCredential(storageBearerTokenChallengeAuthenticationPolicy(credential, (_a2 = pipelineOptions.audience) !== null && _a2 !== void 0 ? _a2 : StorageOAuthScopes), credential) : credential); - return new Pipeline(factories, pipelineOptions); -} -var Pipeline; -var init_Pipeline = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/Pipeline.js"() { - init_src5(); - init_log3(); - init_StorageBrowserPolicyFactory(); - init_StorageRetryPolicyFactory(); - init_AnonymousCredential(); - init_constants2(); - init_TelemetryPolicyFactory(); - init_cache(); - init_utils_common(); - init_StorageBearerTokenChallengeAuthenticationPolicy(); - Pipeline = class { /** - * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface. + * When a blob is leased, + * specifies whether the lease is of infinite or fixed duration. Possible + * values include: 'infinite', 'fixed'. * - * @param factories - - * @param options - + * @readonly */ - constructor(factories, options = {}) { - this.factories = factories; - this.options = Object.assign(Object.assign({}, options), { httpClient: options.httpClient || getCachedDefaultHttpClient2() }); + get leaseDuration() { + return this.originalResponse.leaseDuration; } /** - * Transfer Pipeline object to ServiceClientOptions object which is required by - * ServiceClient constructor. + * Lease state of the blob. Possible + * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. * - * @returns The ServiceClientOptions object from this Pipeline. + * @readonly */ - toServiceClientOptions() { - return { - httpClient: this.options.httpClient, - requestPolicyFactories: this.factories - }; + get leaseState() { + return this.originalResponse.leaseState; } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js -var StorageSharedKeyCredentialPolicy; -var init_StorageSharedKeyCredentialPolicy = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js"() { - init_constants2(); - init_utils_common(); - init_CredentialPolicy(); - StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { /** - * Creates an instance of StorageSharedKeyCredentialPolicy. - * @param nextPolicy - - * @param options - - * @param factory - + * The current lease status of the + * blob. Possible values include: 'locked', 'unlocked'. + * + * @readonly */ - constructor(nextPolicy, options, factory) { - super(nextPolicy, options); - this.factory = factory; + get leaseStatus() { + return this.originalResponse.leaseStatus; } /** - * Signs request. + * A UTC date/time value generated by the service that + * indicates the time at which the response was initiated. * - * @param request - + * @readonly */ - signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } - const stringToSign = [ - request.method.toUpperCase(), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request, HeaderConstants.DATE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); - const signature = this.factory.computeHMACSHA256(stringToSign); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); - return request; + get date() { + return this.originalResponse.date; } /** - * Retrieve header value according to shared key sign rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key + * The number of committed blocks + * present in the blob. This header is returned only for append blobs. * - * @param request - - * @param headerName - + * @readonly */ - getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; - } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; - } - return value; + get blobCommittedBlockCount() { + return this.originalResponse.blobCommittedBlockCount; } /** - * To construct the CanonicalizedHeaders portion of the signature string, follow these steps: - * 1. Retrieve all headers for the resource that begin with x-ms-, including the x-ms-date header. - * 2. Convert each HTTP header name to lowercase. - * 3. Sort the headers lexicographically by header name, in ascending order. - * Each header may appear only once in the string. - * 4. Replace any linear whitespace in the header value with a single space. - * 5. Trim any whitespace around the colon in the header. - * 6. Finally, append a new-line character to each canonicalized header in the resulting list. - * Construct the CanonicalizedHeaders string by concatenating all headers in this list into a single string. + * The ETag contains a value that you can use to + * perform operations conditionally, in quotes. * - * @param request - + * @readonly */ - getCanonicalizedHeadersString(request) { - let headersArray = request.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); - }); - headersArray.sort((a2, b2) => { - return a2.name.toLowerCase().localeCompare(b2.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; - } - return true; - }); - let canonicalizedHeadersStringToSign = ""; - headersArray.forEach((header) => { - canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} -`; - }); - return canonicalizedHeadersStringToSign; + get etag() { + return this.originalResponse.etag; } /** - * Retrieves the webResource canonicalized resource string. + * The number of tags associated with the blob * - * @param request - + * @readonly */ - getCanonicalizedResourceString(request) { - const path15 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path15}`; - const queries = getURLQueries(request.url); - const lowercaseQueries = {}; - if (queries) { - const queryKeys = []; - for (const key in queries) { - if (Object.prototype.hasOwnProperty.call(queries, key)) { - const lowercaseKey = key.toLowerCase(); - lowercaseQueries[lowercaseKey] = queries[key]; - queryKeys.push(lowercaseKey); - } - } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } - } - return canonicalizedResourceString; + get tagCount() { + return this.originalResponse.tagCount; } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.js -import { createHmac } from "crypto"; -var StorageSharedKeyCredential; -var init_StorageSharedKeyCredential = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.js"() { - init_StorageSharedKeyCredentialPolicy(); - init_Credential(); - StorageSharedKeyCredential = class extends Credential { /** - * Creates an instance of StorageSharedKeyCredential. - * @param accountName - - * @param accountKey - + * The error code. + * + * @readonly */ - constructor(accountName, accountKey) { - super(); - this.accountName = accountName; - this.accountKey = Buffer.from(accountKey, "base64"); + get errorCode() { + return this.originalResponse.errorCode; } /** - * Creates a StorageSharedKeyCredentialPolicy object. + * The value of this header is set to + * true if the file data and application metadata are completely encrypted + * using the specified algorithm. Otherwise, the value is set to false (when + * the file is unencrypted, or if only parts of the file/application metadata + * are encrypted). * - * @param nextPolicy - - * @param options - + * @readonly */ - create(nextPolicy, options) { - return new StorageSharedKeyCredentialPolicy(nextPolicy, options, this); + get isServerEncrypted() { + return this.originalResponse.isServerEncrypted; } /** - * Generates a hash signature for an HTTP request or for a SAS. + * If the blob has a MD5 hash, and if + * request contains range header (Range or x-ms-range), this response header + * is returned with the value of the whole blob's MD5 value. This value may + * or may not be equal to the value returned in Content-MD5 header, with the + * latter calculated from the requested range. * - * @param stringToSign - + * @readonly */ - computeHMACSHA256(stringToSign) { - return createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); + get blobContentMD5() { + return this.originalResponse.blobContentMD5; } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/storageClientContext.js -var packageName, packageVersion, StorageClientContext; -var init_storageClientContext = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/storageClientContext.js"() { - init_src5(); - packageName = "azure-storage-blob"; - packageVersion = "12.15.0"; - StorageClientContext = class extends ServiceClient { /** - * Initializes a new instance of the StorageClientContext class. - * @param url The URL of the service account, container, or blob that is the target of the desired - * operation. - * @param options The parameter options + * Returns the date and time the file was last + * modified. Any operation that modifies the file or its properties updates + * the last modified time. + * + * @readonly */ - constructor(url2, options) { - if (url2 === void 0) { - throw new Error("'url' cannot be null"); - } - if (!options) { - options = {}; - } - if (!options.userAgent) { - const defaultUserAgent = getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - super(void 0, options); - this.requestContentType = "application/json; charset=utf-8"; - this.baseUri = options.endpoint || "{url}"; - this.url = url2; - this.version = options.version || "2023-01-03"; + get lastModified() { + return this.originalResponse.lastModified; } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/StorageClient.js -var StorageClient; -var init_StorageClient = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/StorageClient.js"() { - init_storageClientContext(); - init_utils_common(); - init_AnonymousCredential(); - init_StorageSharedKeyCredential(); - init_src5(); - StorageClient = class { /** - * Creates an instance of StorageClient. - * @param url - url to resource - * @param pipeline - request policy pipeline. + * Returns the UTC date and time generated by the service that indicates the time at which the blob was + * last read or written to. + * + * @readonly */ - constructor(url2, pipeline) { - this.url = escapeURLPath(url2); - this.accountName = getAccountNameFromUrl(url2); - this.pipeline = pipeline; - this.storageClientContext = new StorageClientContext(this.url, pipeline.toServiceClientOptions()); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = new AnonymousCredential(); - for (const factory of this.pipeline.factories) { - if (isNode && factory instanceof StorageSharedKeyCredential || factory instanceof AnonymousCredential) { - this.credential = factory; - } else if (isTokenCredential(factory.credential)) { - this.credential = factory.credential; - } - } - const storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = void 0; + get lastAccessed() { + return this.originalResponse.lastAccessed; } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/tracing.js -function convertTracingToRequestOptionsBase(options) { - var _a2, _b; - return { - // By passing spanOptions if they exist at runtime, we're backwards compatible with @azure/core-tracing@preview.13 and earlier. - spanOptions: (_a2 = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _a2 === void 0 ? void 0 : _a2.spanOptions, - tracingContext: (_b = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _b === void 0 ? void 0 : _b.tracingContext - }; -} -var createSpan2; -var init_tracing = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/tracing.js"() { - init_src4(); - createSpan2 = createSpanFunction({ - packagePrefix: "Azure.Storage.Blob", - namespace: "Microsoft.Storage" - }); - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/BlobSASPermissions.js -var BlobSASPermissions; -var init_BlobSASPermissions = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/BlobSASPermissions.js"() { - BlobSASPermissions = class _BlobSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; + /** + * Returns the date and time the blob was created. + * + * @readonly + */ + get createdOn() { + return this.originalResponse.createdOn; } /** - * Creates a {@link BlobSASPermissions} from the specified permissions string. This method will throw an - * Error if it encounters a character that does not correspond to a valid permission. + * A name-value pair + * to associate with a file storage object. * - * @param permissions - + * @readonly */ - static parse(permissions) { - const blobSASPermissions = new _BlobSASPermissions(); - for (const char of permissions) { - switch (char) { - case "r": - blobSASPermissions.read = true; - break; - case "a": - blobSASPermissions.add = true; - break; - case "c": - blobSASPermissions.create = true; - break; - case "w": - blobSASPermissions.write = true; - break; - case "d": - blobSASPermissions.delete = true; - break; - case "x": - blobSASPermissions.deleteVersion = true; - break; - case "t": - blobSASPermissions.tag = true; - break; - case "m": - blobSASPermissions.move = true; - break; - case "e": - blobSASPermissions.execute = true; - break; - case "i": - blobSASPermissions.setImmutabilityPolicy = true; - break; - case "y": - blobSASPermissions.permanentDelete = true; - break; - default: - throw new RangeError(`Invalid permission: ${char}`); - } - } - return blobSASPermissions; + get metadata() { + return this.originalResponse.metadata; } /** - * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. * - * @param permissionLike - + * @readonly */ - static from(permissionLike) { - const blobSASPermissions = new _BlobSASPermissions(); - if (permissionLike.read) { - blobSASPermissions.read = true; - } - if (permissionLike.add) { - blobSASPermissions.add = true; - } - if (permissionLike.create) { - blobSASPermissions.create = true; - } - if (permissionLike.write) { - blobSASPermissions.write = true; - } - if (permissionLike.delete) { - blobSASPermissions.delete = true; - } - if (permissionLike.deleteVersion) { - blobSASPermissions.deleteVersion = true; - } - if (permissionLike.tag) { - blobSASPermissions.tag = true; - } - if (permissionLike.move) { - blobSASPermissions.move = true; - } - if (permissionLike.execute) { - blobSASPermissions.execute = true; - } - if (permissionLike.setImmutabilityPolicy) { - blobSASPermissions.setImmutabilityPolicy = true; - } - if (permissionLike.permanentDelete) { - blobSASPermissions.permanentDelete = true; - } - return blobSASPermissions; + get requestId() { + return this.originalResponse.requestId; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * If a client request id header is sent in the request, this header will be present in the + * response with the same value. * - * @returns A string which represents the BlobSASPermissions + * @readonly */ - toString() { - const permissions = []; - if (this.read) { - permissions.push("r"); - } - if (this.add) { - permissions.push("a"); - } - if (this.create) { - permissions.push("c"); - } - if (this.write) { - permissions.push("w"); - } - if (this.delete) { - permissions.push("d"); - } - if (this.deleteVersion) { - permissions.push("x"); - } - if (this.tag) { - permissions.push("t"); - } - if (this.move) { - permissions.push("m"); - } - if (this.execute) { - permissions.push("e"); - } - if (this.setImmutabilityPolicy) { - permissions.push("i"); - } - if (this.permanentDelete) { - permissions.push("y"); - } - return permissions.join(""); - } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js -var ContainerSASPermissions; -var init_ContainerSASPermissions = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js"() { - ContainerSASPermissions = class _ContainerSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - this.filterByTags = false; + get clientRequestId() { + return this.originalResponse.clientRequestId; } /** - * Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an - * Error if it encounters a character that does not correspond to a valid permission. + * Indicates the version of the Blob service used + * to execute the request. * - * @param permissions - + * @readonly */ - static parse(permissions) { - const containerSASPermissions = new _ContainerSASPermissions(); - for (const char of permissions) { - switch (char) { - case "r": - containerSASPermissions.read = true; - break; - case "a": - containerSASPermissions.add = true; - break; - case "c": - containerSASPermissions.create = true; - break; - case "w": - containerSASPermissions.write = true; - break; - case "d": - containerSASPermissions.delete = true; - break; - case "l": - containerSASPermissions.list = true; - break; - case "t": - containerSASPermissions.tag = true; - break; - case "x": - containerSASPermissions.deleteVersion = true; - break; - case "m": - containerSASPermissions.move = true; - break; - case "e": - containerSASPermissions.execute = true; - break; - case "i": - containerSASPermissions.setImmutabilityPolicy = true; - break; - case "y": - containerSASPermissions.permanentDelete = true; - break; - case "f": - containerSASPermissions.filterByTags = true; - break; - default: - throw new RangeError(`Invalid permission ${char}`); - } - } - return containerSASPermissions; + get version() { + return this.originalResponse.version; } /** - * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * Indicates the versionId of the downloaded blob version. * - * @param permissionLike - + * @readonly */ - static from(permissionLike) { - const containerSASPermissions = new _ContainerSASPermissions(); - if (permissionLike.read) { - containerSASPermissions.read = true; - } - if (permissionLike.add) { - containerSASPermissions.add = true; - } - if (permissionLike.create) { - containerSASPermissions.create = true; - } - if (permissionLike.write) { - containerSASPermissions.write = true; - } - if (permissionLike.delete) { - containerSASPermissions.delete = true; - } - if (permissionLike.list) { - containerSASPermissions.list = true; - } - if (permissionLike.deleteVersion) { - containerSASPermissions.deleteVersion = true; - } - if (permissionLike.tag) { - containerSASPermissions.tag = true; - } - if (permissionLike.move) { - containerSASPermissions.move = true; - } - if (permissionLike.execute) { - containerSASPermissions.execute = true; - } - if (permissionLike.setImmutabilityPolicy) { - containerSASPermissions.setImmutabilityPolicy = true; - } - if (permissionLike.permanentDelete) { - containerSASPermissions.permanentDelete = true; - } - if (permissionLike.filterByTags) { - containerSASPermissions.filterByTags = true; - } - return containerSASPermissions; + get versionId() { + return this.originalResponse.versionId; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * Indicates whether version of this blob is a current version. * - * The order of the characters should be as specified here to ensure correctness. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @readonly + */ + get isCurrentVersion() { + return this.originalResponse.isCurrentVersion; + } + /** + * The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned + * when the blob was encrypted with a customer-provided key. * + * @readonly */ - toString() { - const permissions = []; - if (this.read) { - permissions.push("r"); - } - if (this.add) { - permissions.push("a"); - } - if (this.create) { - permissions.push("c"); - } - if (this.write) { - permissions.push("w"); - } - if (this.delete) { - permissions.push("d"); - } - if (this.deleteVersion) { - permissions.push("x"); - } - if (this.list) { - permissions.push("l"); - } - if (this.tag) { - permissions.push("t"); - } - if (this.move) { - permissions.push("m"); - } - if (this.execute) { - permissions.push("e"); - } - if (this.setImmutabilityPolicy) { - permissions.push("i"); - } - if (this.permanentDelete) { - permissions.push("y"); - } - if (this.filterByTags) { - permissions.push("f"); - } - return permissions.join(""); + get encryptionKeySha256() { + return this.originalResponse.encryptionKeySha256; } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.js -import { createHmac as createHmac2 } from "crypto"; -var UserDelegationKeyCredential; -var init_UserDelegationKeyCredential = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.js"() { - UserDelegationKeyCredential = class { /** - * Creates an instance of UserDelegationKeyCredential. - * @param accountName - - * @param userDelegationKey - + * If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to + * true, then the request returns a crc64 for the range, as long as the range size is less than + * or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is + * specified in the same request, it will fail with 400(Bad Request) */ - constructor(accountName, userDelegationKey) { - this.accountName = accountName; - this.userDelegationKey = userDelegationKey; - this.key = Buffer.from(userDelegationKey.value, "base64"); + get contentCrc64() { + return this.originalResponse.contentCrc64; } /** - * Generates a hash signature for an HTTP request or for a SAS. + * Object Replication Policy Id of the destination blob. * - * @param stringToSign - + * @readonly */ - computeHMACSHA256(stringToSign) { - return createHmac2("sha256", this.key).update(stringToSign, "utf8").digest("base64"); - } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/SasIPRange.js -function ipRangeToString(ipRange) { - return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; -} -var init_SasIPRange = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/SasIPRange.js"() { - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/SASQueryParameters.js -var SASProtocol, SASQueryParameters; -var init_SASQueryParameters = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/SASQueryParameters.js"() { - init_SasIPRange(); - init_utils_common(); - (function(SASProtocol2) { - SASProtocol2["Https"] = "https"; - SASProtocol2["HttpsAndHttp"] = "https,http"; - })(SASProtocol || (SASProtocol = {})); - SASQueryParameters = class { - constructor(version4, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { - this.version = version4; - this.signature = signature; - if (permissionsOrOptions !== void 0 && typeof permissionsOrOptions !== "string") { - this.permissions = permissionsOrOptions.permissions; - this.services = permissionsOrOptions.services; - this.resourceTypes = permissionsOrOptions.resourceTypes; - this.protocol = permissionsOrOptions.protocol; - this.startsOn = permissionsOrOptions.startsOn; - this.expiresOn = permissionsOrOptions.expiresOn; - this.ipRangeInner = permissionsOrOptions.ipRange; - this.identifier = permissionsOrOptions.identifier; - this.encryptionScope = permissionsOrOptions.encryptionScope; - this.resource = permissionsOrOptions.resource; - this.cacheControl = permissionsOrOptions.cacheControl; - this.contentDisposition = permissionsOrOptions.contentDisposition; - this.contentEncoding = permissionsOrOptions.contentEncoding; - this.contentLanguage = permissionsOrOptions.contentLanguage; - this.contentType = permissionsOrOptions.contentType; - if (permissionsOrOptions.userDelegationKey) { - this.signedOid = permissionsOrOptions.userDelegationKey.signedObjectId; - this.signedTenantId = permissionsOrOptions.userDelegationKey.signedTenantId; - this.signedStartsOn = permissionsOrOptions.userDelegationKey.signedStartsOn; - this.signedExpiresOn = permissionsOrOptions.userDelegationKey.signedExpiresOn; - this.signedService = permissionsOrOptions.userDelegationKey.signedService; - this.signedVersion = permissionsOrOptions.userDelegationKey.signedVersion; - this.preauthorizedAgentObjectId = permissionsOrOptions.preauthorizedAgentObjectId; - this.correlationId = permissionsOrOptions.correlationId; - } - } else { - this.services = services; - this.resourceTypes = resourceTypes; - this.expiresOn = expiresOn2; - this.permissions = permissionsOrOptions; - this.protocol = protocol; - this.startsOn = startsOn; - this.ipRangeInner = ipRange; - this.encryptionScope = encryptionScope2; - this.identifier = identifier; - this.resource = resource; - this.cacheControl = cacheControl; - this.contentDisposition = contentDisposition; - this.contentEncoding = contentEncoding; - this.contentLanguage = contentLanguage; - this.contentType = contentType2; - if (userDelegationKey) { - this.signedOid = userDelegationKey.signedObjectId; - this.signedTenantId = userDelegationKey.signedTenantId; - this.signedStartsOn = userDelegationKey.signedStartsOn; - this.signedExpiresOn = userDelegationKey.signedExpiresOn; - this.signedService = userDelegationKey.signedService; - this.signedVersion = userDelegationKey.signedVersion; - this.preauthorizedAgentObjectId = preauthorizedAgentObjectId; - this.correlationId = correlationId; - } - } + get objectReplicationDestinationPolicyId() { + return this.originalResponse.objectReplicationDestinationPolicyId; } /** - * Optional. IP range allowed for this SAS. + * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. * * @readonly */ - get ipRange() { - if (this.ipRangeInner) { - return { - end: this.ipRangeInner.end, - start: this.ipRangeInner.start - }; - } - return void 0; + get objectReplicationSourceProperties() { + return this.originalResponse.objectReplicationSourceProperties; } /** - * Encodes all SAS query parameters into a string that can be appended to a URL. + * If this blob has been sealed. * - */ - toString() { - const params = [ - "sv", - "ss", - "srt", - "spr", - "st", - "se", - "sip", - "si", - "ses", - "skoid", - "sktid", - "skt", - "ske", - "sks", - "skv", - "sr", - "sp", - "sig", - "rscc", - "rscd", - "rsce", - "rscl", - "rsct", - "saoid", - "scid" - ]; - const queries = []; - for (const param of params) { - switch (param) { - case "sv": - this.tryAppendQueryParameter(queries, param, this.version); - break; - case "ss": - this.tryAppendQueryParameter(queries, param, this.services); - break; - case "srt": - this.tryAppendQueryParameter(queries, param, this.resourceTypes); - break; - case "spr": - this.tryAppendQueryParameter(queries, param, this.protocol); - break; - case "st": - this.tryAppendQueryParameter(queries, param, this.startsOn ? truncatedISO8061Date(this.startsOn, false) : void 0); - break; - case "se": - this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : void 0); - break; - case "sip": - this.tryAppendQueryParameter(queries, param, this.ipRange ? ipRangeToString(this.ipRange) : void 0); - break; - case "si": - this.tryAppendQueryParameter(queries, param, this.identifier); - break; - case "ses": - this.tryAppendQueryParameter(queries, param, this.encryptionScope); - break; - case "skoid": - this.tryAppendQueryParameter(queries, param, this.signedOid); - break; - case "sktid": - this.tryAppendQueryParameter(queries, param, this.signedTenantId); - break; - case "skt": - this.tryAppendQueryParameter(queries, param, this.signedStartsOn ? truncatedISO8061Date(this.signedStartsOn, false) : void 0); - break; - case "ske": - this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? truncatedISO8061Date(this.signedExpiresOn, false) : void 0); - break; - case "sks": - this.tryAppendQueryParameter(queries, param, this.signedService); - break; - case "skv": - this.tryAppendQueryParameter(queries, param, this.signedVersion); - break; - case "sr": - this.tryAppendQueryParameter(queries, param, this.resource); - break; - case "sp": - this.tryAppendQueryParameter(queries, param, this.permissions); - break; - case "sig": - this.tryAppendQueryParameter(queries, param, this.signature); - break; - case "rscc": - this.tryAppendQueryParameter(queries, param, this.cacheControl); - break; - case "rscd": - this.tryAppendQueryParameter(queries, param, this.contentDisposition); - break; - case "rsce": - this.tryAppendQueryParameter(queries, param, this.contentEncoding); - break; - case "rscl": - this.tryAppendQueryParameter(queries, param, this.contentLanguage); - break; - case "rsct": - this.tryAppendQueryParameter(queries, param, this.contentType); - break; - case "saoid": - this.tryAppendQueryParameter(queries, param, this.preauthorizedAgentObjectId); - break; - case "scid": - this.tryAppendQueryParameter(queries, param, this.correlationId); - break; - } - } - return queries.join("&"); + * @readonly + */ + get isSealed() { + return this.originalResponse.isSealed; } /** - * A private helper method used to filter and append query key/value pairs into an array. + * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. * - * @param queries - - * @param key - - * @param value - + * @readonly */ - tryAppendQueryParameter(queries, key, value) { - if (!value) { - return; - } - key = encodeURIComponent(key); - value = encodeURIComponent(value); - if (key.length > 0 && value.length > 0) { - queries.push(`${key}=${value}`); - } + get immutabilityPolicyExpiresOn() { + return this.originalResponse.immutabilityPolicyExpiresOn; + } + /** + * Indicates immutability policy mode. + * + * @readonly + */ + get immutabilityPolicyMode() { + return this.originalResponse.immutabilityPolicyMode; + } + /** + * Indicates if a legal hold is present on the blob. + * + * @readonly + */ + get legalHold() { + return this.originalResponse.legalHold; + } + /** + * The response body as a browser Blob. + * Always undefined in node.js. + * + * @readonly + */ + get contentAsBlob() { + return this.originalResponse.blobBody; + } + /** + * The response body as a node.js Readable stream. + * Always undefined in the browser. + * + * It will automatically retry when internal read stream unexpected ends. + * + * @readonly + */ + get readableStreamBody() { + return isNode ? this.blobDownloadStream : void 0; + } + /** + * The HTTP response. + */ + get _response() { + return this.originalResponse._response; } }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js -function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version4 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; - let userDelegationKeyCredential; - if (sharedKeyCredential === void 0 && accountName !== void 0) { - userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); - } - if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { - throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); - } - if (version4 >= "2020-12-06") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); - } - } - if (version4 >= "2018-11-09") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); - } else { - if (version4 >= "2020-02-10") { - return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); - } - } - } - if (version4 >= "2015-04-05") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential); - } else { - throw new RangeError("'version' must be >= '2018-11-09' when generating user delegation SAS using user delegation key."); - } - } - throw new RangeError("'version' must be >= '2015-04-05'."); -} -function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - if (!blobSASSignatureValues.identifier && !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); - } - let resource = "c"; - if (blobSASSignatureValues.blobName) { - resource = "b"; - } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "", - blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "", - blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "", - blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "", - blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "" - ].join("\n"); - const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); - return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType); -} -function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - if (!blobSASSignatureValues.identifier && !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); - } - let resource = "c"; - let timestamp = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp = blobSASSignatureValues.versionId; - } - } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp, - blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "", - blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "", - blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "", - blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "", - blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "" - ].join("\n"); - const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); - return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType); -} -function generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - if (!blobSASSignatureValues.identifier && !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); - } - let resource = "c"; - let timestamp = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp = blobSASSignatureValues.versionId; - } - } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "", - blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "", - blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "", - blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "", - blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "" - ].join("\n"); - const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); - return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, void 0, void 0, void 0, blobSASSignatureValues.encryptionScope); -} -function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS."); - } - let resource = "c"; - let timestamp = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp = blobSASSignatureValues.versionId; - } - } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey); -} -function generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS."); - } - let resource = "c"; - let timestamp = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp = blobSASSignatureValues.versionId; - } - } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId); -} -function generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS."); - } - let resource = "c"; - let timestamp = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp = blobSASSignatureValues.versionId; - } - } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, void 0, void 0, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId, blobSASSignatureValues.encryptionScope); -} -function getCanonicalName(accountName, containerName, blobName) { - const elements = [`/blob/${accountName}/${containerName}`]; - if (blobName) { - elements.push(`/${blobName}`); - } - return elements.join(""); -} -function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) { - const version4 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version4 < "2018-11-09") { - throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'."); - } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { - throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); - } - if (blobSASSignatureValues.versionId && version4 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); - } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { - throw RangeError("Must provide 'blobName' when providing 'versionId'."); - } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version4 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); - } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version4 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); - } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version4 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); - } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version4 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); - } - if (version4 < "2020-02-10" && blobSASSignatureValues.permissions && (blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) { - throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission."); - } - if (version4 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { - throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); - } - if (version4 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { - throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); - } - if (blobSASSignatureValues.encryptionScope && version4 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); +// node_modules/@azure/core-paging/dist-esm/src/models.js +var init_models2 = __esm({ + "node_modules/@azure/core-paging/dist-esm/src/models.js"() { } - blobSASSignatureValues.version = version4; - return blobSASSignatureValues; -} -var init_BlobSASSignatureValues = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js"() { - init_BlobSASPermissions(); - init_ContainerSASPermissions(); - init_StorageSharedKeyCredential(); - init_UserDelegationKeyCredential(); - init_SasIPRange(); - init_SASQueryParameters(); - init_constants2(); - init_utils_common(); +}); + +// node_modules/@azure/core-paging/dist-esm/src/getPagedAsyncIterator.js +var init_getPagedAsyncIterator = __esm({ + "node_modules/@azure/core-paging/dist-esm/src/getPagedAsyncIterator.js"() { } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/models/index.js -var init_models = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/models/index.js"() { +// node_modules/@azure/core-paging/dist-esm/src/index.js +var init_src7 = __esm({ + "node_modules/@azure/core-paging/dist-esm/src/index.js"() { + init_models2(); + init_getPagedAsyncIterator(); } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/index.js -var init_src6 = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/index.js"() { - init_models(); - init_storageClientContext(); +// node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroConstants.js +var AVRO_SYNC_MARKER_SIZE, AVRO_INIT_BYTES, AVRO_CODEC_KEY, AVRO_SCHEMA_KEY; +var init_AvroConstants = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroConstants.js"() { + AVRO_SYNC_MARKER_SIZE = 16; + AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); + AVRO_CODEC_KEY = "avro.codec"; + AVRO_SCHEMA_KEY = "avro.schema"; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobLeaseClient.js -var BlobLeaseClient; -var init_BlobLeaseClient = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobLeaseClient.js"() { - init_src5(); - init_src6(); - init_src4(); - init_operations(); - init_constants2(); - init_tracing(); - BlobLeaseClient = class { +// node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroParser.js +var AvroParser, AvroComplex, AvroPrimitive, AvroType, AvroPrimitiveType, AvroEnumType, AvroUnionType, AvroMapType, AvroRecordType; +var init_AvroParser = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroParser.js"() { + AvroParser = class _AvroParser { /** - * Creates an instance of BlobLeaseClient. - * @param client - The client to make the lease operation requests. - * @param leaseId - Initial proposed lease id. + * Reads a fixed number of bytes from the stream. + * + * @param stream - + * @param length - + * @param options - */ - constructor(client, leaseId2) { - const clientContext = new StorageClientContext(client.url, client.pipeline.toServiceClientOptions()); - this._url = client.url; - if (client.name === void 0) { - this._isContainer = true; - this._containerOrBlobOperation = new Container(clientContext); + static async readFixedBytes(stream, length, options = {}) { + const bytes = await stream.read(length, { abortSignal: options.abortSignal }); + if (bytes.length !== length) { + throw new Error("Hit stream end."); + } + return bytes; + } + /** + * Reads a single byte from the stream. + * + * @param stream - + * @param options - + */ + static async readByte(stream, options = {}) { + const buf = await _AvroParser.readFixedBytes(stream, 1, options); + return buf[0]; + } + // int and long are stored in variable-length zig-zag coding. + // variable-length: https://lucene.apache.org/core/3_5_0/fileformats.html#VInt + // zig-zag: https://developers.google.com/protocol-buffers/docs/encoding?csw=1#types + static async readZigZagLong(stream, options = {}) { + let zigZagEncoded = 0; + let significanceInBit = 0; + let byte, haveMoreByte, significanceInFloat; + do { + byte = await _AvroParser.readByte(stream, options); + haveMoreByte = byte & 128; + zigZagEncoded |= (byte & 127) << significanceInBit; + significanceInBit += 7; + } while (haveMoreByte && significanceInBit < 28); + if (haveMoreByte) { + zigZagEncoded = zigZagEncoded; + significanceInFloat = 268435456; + do { + byte = await _AvroParser.readByte(stream, options); + zigZagEncoded += (byte & 127) * significanceInFloat; + significanceInFloat *= 128; + } while (byte & 128); + const res = (zigZagEncoded % 2 ? -(zigZagEncoded + 1) : zigZagEncoded) / 2; + if (res < Number.MIN_SAFE_INTEGER || res > Number.MAX_SAFE_INTEGER) { + throw new Error("Integer overflow."); + } + return res; + } + return zigZagEncoded >> 1 ^ -(zigZagEncoded & 1); + } + static async readLong(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); + } + static async readInt(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); + } + static async readNull() { + return null; + } + static async readBoolean(stream, options = {}) { + const b2 = await _AvroParser.readByte(stream, options); + if (b2 === 1) { + return true; + } else if (b2 === 0) { + return false; } else { - this._isContainer = false; - this._containerOrBlobOperation = new Blob3(clientContext); + throw new Error("Byte was not a boolean."); } - if (!leaseId2) { - leaseId2 = generateUuid(); + } + static async readFloat(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 4, options); + const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return view.getFloat32(0, true); + } + static async readDouble(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 8, options); + const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return view.getFloat64(0, true); + } + static async readBytes(stream, options = {}) { + const size = await _AvroParser.readLong(stream, options); + if (size < 0) { + throw new Error("Bytes size was negative."); } - this._leaseId = leaseId2; + return stream.read(size, { abortSignal: options.abortSignal }); } - /** - * Gets the lease Id. - * - * @readonly - */ - get leaseId() { - return this._leaseId; + static async readString(stream, options = {}) { + const u8arr = await _AvroParser.readBytes(stream, options); + const utf8decoder = new TextDecoder(); + return utf8decoder.decode(u8arr); } - /** - * Gets the url. - * - * @readonly - */ - get url() { - return this._url; + static async readMapPair(stream, readItemMethod, options = {}) { + const key = await _AvroParser.readString(stream, options); + const value = await readItemMethod(stream, options); + return { key, value }; } - /** - * Establishes and manages a lock on a container for delete operations, or on a blob - * for write and delete operations. - * The lock duration can be 15 to 60 seconds, or can be infinite. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param duration - Must be between 15 to 60 seconds, or infinite (-1) - * @param options - option to configure lease management operations. - * @returns Response data for acquire lease operation. - */ - async acquireLease(duration2, options = {}) { - var _a2, _b, _c, _d, _e2, _f; - const { span, updatedOptions } = createSpan2("BlobLeaseClient-acquireLease", options); - if (this._isContainer && (((_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e2 = options.conditions) === null || _e2 === void 0 ? void 0 : _e2.tagConditions))) { - throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + static async readMap(stream, readItemMethod, options = {}) { + const readPairMethod = (s2, opts = {}) => { + return _AvroParser.readMapPair(s2, readItemMethod, opts); + }; + const pairs = await _AvroParser.readArray(stream, readPairMethod, options); + const dict = {}; + for (const pair of pairs) { + dict[pair.key] = pair.value; } - try { - return await this._containerOrBlobOperation.acquireLease(Object.assign({ abortSignal: options.abortSignal, duration: duration2, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }), proposedLeaseId: this._leaseId }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + return dict; + } + static async readArray(stream, readItemMethod, options = {}) { + const items = []; + for (let count = await _AvroParser.readLong(stream, options); count !== 0; count = await _AvroParser.readLong(stream, options)) { + if (count < 0) { + await _AvroParser.readLong(stream, options); + count = -count; + } + while (count--) { + const item = await readItemMethod(stream, options); + items.push(item); + } } + return items; } + }; + (function(AvroComplex2) { + AvroComplex2["RECORD"] = "record"; + AvroComplex2["ENUM"] = "enum"; + AvroComplex2["ARRAY"] = "array"; + AvroComplex2["MAP"] = "map"; + AvroComplex2["UNION"] = "union"; + AvroComplex2["FIXED"] = "fixed"; + })(AvroComplex || (AvroComplex = {})); + (function(AvroPrimitive2) { + AvroPrimitive2["NULL"] = "null"; + AvroPrimitive2["BOOLEAN"] = "boolean"; + AvroPrimitive2["INT"] = "int"; + AvroPrimitive2["LONG"] = "long"; + AvroPrimitive2["FLOAT"] = "float"; + AvroPrimitive2["DOUBLE"] = "double"; + AvroPrimitive2["BYTES"] = "bytes"; + AvroPrimitive2["STRING"] = "string"; + })(AvroPrimitive || (AvroPrimitive = {})); + AvroType = class _AvroType { /** - * To change the ID of the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param proposedLeaseId - the proposed new lease Id. - * @param options - option to configure lease management operations. - * @returns Response data for change lease operation. + * Determines the AvroType from the Avro Schema. */ - async changeLease(proposedLeaseId2, options = {}) { - var _a2, _b, _c, _d, _e2, _f; - const { span, updatedOptions } = createSpan2("BlobLeaseClient-changeLease", options); - if (this._isContainer && (((_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e2 = options.conditions) === null || _e2 === void 0 ? void 0 : _e2.tagConditions))) { - throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + static fromSchema(schema) { + if (typeof schema === "string") { + return _AvroType.fromStringSchema(schema); + } else if (Array.isArray(schema)) { + return _AvroType.fromArraySchema(schema); + } else { + return _AvroType.fromObjectSchema(schema); + } + } + static fromStringSchema(schema) { + switch (schema) { + case AvroPrimitive.NULL: + case AvroPrimitive.BOOLEAN: + case AvroPrimitive.INT: + case AvroPrimitive.LONG: + case AvroPrimitive.FLOAT: + case AvroPrimitive.DOUBLE: + case AvroPrimitive.BYTES: + case AvroPrimitive.STRING: + return new AvroPrimitiveType(schema); + default: + throw new Error(`Unexpected Avro type ${schema}`); } + } + static fromArraySchema(schema) { + return new AvroUnionType(schema.map(_AvroType.fromSchema)); + } + static fromObjectSchema(schema) { + const type3 = schema.type; try { - const response = await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId2, Object.assign({ abortSignal: options.abortSignal, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - this._leaseId = proposedLeaseId2; - return response; - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + return _AvroType.fromStringSchema(type3); + } catch (err) { + } + switch (type3) { + case AvroComplex.RECORD: + if (schema.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema}`); + } + if (!schema.name) { + throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema}`); + } + const fields = {}; + if (!schema.fields) { + throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema}`); + } + for (const field of schema.fields) { + fields[field.name] = _AvroType.fromSchema(field.type); + } + return new AvroRecordType(fields, schema.name); + case AvroComplex.ENUM: + if (schema.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema}`); + } + if (!schema.symbols) { + throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema}`); + } + return new AvroEnumType(schema.symbols); + case AvroComplex.MAP: + if (!schema.values) { + throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema}`); + } + return new AvroMapType(_AvroType.fromSchema(schema.values)); + case AvroComplex.ARRAY: + case AvroComplex.FIXED: + default: + throw new Error(`Unexpected Avro type ${type3} in ${schema}`); } } - /** - * To free the lease if it is no longer needed so that another client may - * immediately acquire a lease against the container or the blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - option to configure lease management operations. - * @returns Response data for release lease operation. - */ - async releaseLease(options = {}) { - var _a2, _b, _c, _d, _e2, _f; - const { span, updatedOptions } = createSpan2("BlobLeaseClient-releaseLease", options); - if (this._isContainer && (((_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e2 = options.conditions) === null || _e2 === void 0 ? void 0 : _e2.tagConditions))) { - throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + }; + AvroPrimitiveType = class extends AvroType { + constructor(primitive) { + super(); + this._primitive = primitive; + } + read(stream, options = {}) { + switch (this._primitive) { + case AvroPrimitive.NULL: + return AvroParser.readNull(); + case AvroPrimitive.BOOLEAN: + return AvroParser.readBoolean(stream, options); + case AvroPrimitive.INT: + return AvroParser.readInt(stream, options); + case AvroPrimitive.LONG: + return AvroParser.readLong(stream, options); + case AvroPrimitive.FLOAT: + return AvroParser.readFloat(stream, options); + case AvroPrimitive.DOUBLE: + return AvroParser.readDouble(stream, options); + case AvroPrimitive.BYTES: + return AvroParser.readBytes(stream, options); + case AvroPrimitive.STRING: + return AvroParser.readString(stream, options); + default: + throw new Error("Unknown Avro Primitive"); } - try { - return await this._containerOrBlobOperation.releaseLease(this._leaseId, Object.assign({ abortSignal: options.abortSignal, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + } + }; + AvroEnumType = class extends AvroType { + constructor(symbols) { + super(); + this._symbols = symbols; + } + async read(stream, options = {}) { + const value = await AvroParser.readInt(stream, options); + return this._symbols[value]; + } + }; + AvroUnionType = class extends AvroType { + constructor(types) { + super(); + this._types = types; + } + async read(stream, options = {}) { + const typeIndex = await AvroParser.readInt(stream, options); + return this._types[typeIndex].read(stream, options); + } + }; + AvroMapType = class extends AvroType { + constructor(itemType) { + super(); + this._itemType = itemType; + } + read(stream, options = {}) { + const readItemMethod = (s2, opts) => { + return this._itemType.read(s2, opts); + }; + return AvroParser.readMap(stream, readItemMethod, options); + } + }; + AvroRecordType = class extends AvroType { + constructor(fields, name2) { + super(); + this._fields = fields; + this._name = name2; + } + async read(stream, options = {}) { + const record = {}; + record["$schema"] = this._name; + for (const key in this._fields) { + if (Object.prototype.hasOwnProperty.call(this._fields, key)) { + record[key] = await this._fields[key].read(stream, options); + } } + return record; } - /** - * To renew the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - Optional option to configure lease management operations. - * @returns Response data for renew lease operation. - */ - async renewLease(options = {}) { - var _a2, _b, _c, _d, _e2, _f; - const { span, updatedOptions } = createSpan2("BlobLeaseClient-renewLease", options); - if (this._isContainer && (((_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e2 = options.conditions) === null || _e2 === void 0 ? void 0 : _e2.tagConditions))) { - throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/utils/utils.common.js +function arraysEqual(a2, b2) { + if (a2 === b2) + return true; + if (a2 == null || b2 == null) + return false; + if (a2.length !== b2.length) + return false; + for (let i2 = 0; i2 < a2.length; ++i2) { + if (a2[i2] !== b2[i2]) + return false; + } + return true; +} +var init_utils_common2 = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/utils/utils.common.js"() { + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroReader.js +var AvroReader; +var init_AvroReader = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroReader.js"() { + init_tslib_es6(); + init_src7(); + init_AvroConstants(); + init_AvroParser(); + init_utils_common2(); + AvroReader = class { + constructor(dataStream, headerStream, currentBlockOffset, indexWithinCurrentBlock) { + this._dataStream = dataStream; + this._headerStream = headerStream || dataStream; + this._initialized = false; + this._blockOffset = currentBlockOffset || 0; + this._objectIndex = indexWithinCurrentBlock || 0; + this._initialBlockOffset = currentBlockOffset || 0; + } + get blockOffset() { + return this._blockOffset; + } + get objectIndex() { + return this._objectIndex; + } + async initialize(options = {}) { + const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { + abortSignal: options.abortSignal + }); + if (!arraysEqual(header, AVRO_INIT_BYTES)) { + throw new Error("Stream is not an Avro file."); + } + this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, { + abortSignal: options.abortSignal + }); + const codec = this._metadata[AVRO_CODEC_KEY]; + if (!(codec === void 0 || codec === null || codec === "null")) { + throw new Error("Codecs are not supported"); + } + this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal + }); + const schema = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); + this._itemType = AvroType.fromSchema(schema); + if (this._blockOffset === 0) { + this._blockOffset = this._initialBlockOffset + this._dataStream.position; + } + this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, { + abortSignal: options.abortSignal + }); + await AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal }); + this._initialized = true; + if (this._objectIndex && this._objectIndex > 0) { + for (let i2 = 0; i2 < this._objectIndex; i2++) { + await this._itemType.read(this._dataStream, { abortSignal: options.abortSignal }); + this._itemsRemainingInBlock--; + } + } + } + hasNext() { + return !this._initialized || this._itemsRemainingInBlock > 0; + } + parseObjects(options = {}) { + return __asyncGenerator(this, arguments, function* parseObjects_1() { + if (!this._initialized) { + yield __await(this.initialize(options)); + } + while (this.hasNext()) { + const result = yield __await(this._itemType.read(this._dataStream, { + abortSignal: options.abortSignal + })); + this._itemsRemainingInBlock--; + this._objectIndex++; + if (this._itemsRemainingInBlock === 0) { + const marker2 = yield __await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal + })); + this._blockOffset = this._initialBlockOffset + this._dataStream.position; + this._objectIndex = 0; + if (!arraysEqual(this._syncMarker, marker2)) { + throw new Error("Stream is not a valid Avro file."); + } + try { + this._itemsRemainingInBlock = yield __await(AvroParser.readLong(this._dataStream, { + abortSignal: options.abortSignal + })); + } catch (err) { + this._itemsRemainingInBlock = 0; + } + if (this._itemsRemainingInBlock > 0) { + yield __await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })); + } + } + yield yield __await(result); + } + }); + } + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroReadable.js +var AvroReadable; +var init_AvroReadable = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroReadable.js"() { + AvroReadable = class { + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroReadableFromStream.js +var ABORT_ERROR, AvroReadableFromStream; +var init_AvroReadableFromStream = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroReadableFromStream.js"() { + init_AvroReadable(); + init_abort_controller(); + ABORT_ERROR = new AbortError("Reading from the avro stream was aborted."); + AvroReadableFromStream = class extends AvroReadable { + constructor(readable) { + super(); + this._readable = readable; + this._position = 0; + } + toUint8Array(data) { + if (typeof data === "string") { + return Buffer.from(data); + } + return data; + } + get position() { + return this._position; + } + async read(size, options = {}) { + var _a2; + if ((_a2 = options.abortSignal) === null || _a2 === void 0 ? void 0 : _a2.aborted) { + throw ABORT_ERROR; + } + if (size < 0) { + throw new Error(`size parameter should be positive: ${size}`); } - try { - return await this._containerOrBlobOperation.renewLease(this._leaseId, Object.assign({ abortSignal: options.abortSignal, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + if (size === 0) { + return new Uint8Array(); } - } - /** - * To end the lease but ensure that another client cannot acquire a new lease - * until the current lease period has expired. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param breakPeriod - Break period - * @param options - Optional options to configure lease management operations. - * @returns Response data for break lease operation. - */ - async breakLease(breakPeriod2, options = {}) { - var _a2, _b, _c, _d, _e2, _f; - const { span, updatedOptions } = createSpan2("BlobLeaseClient-breakLease", options); - if (this._isContainer && (((_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e2 = options.conditions) === null || _e2 === void 0 ? void 0 : _e2.tagConditions))) { - throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); + if (!this._readable.readable) { + throw new Error("Stream no longer readable."); } - try { - const operationOptions = Object.assign({ abortSignal: options.abortSignal, breakPeriod: breakPeriod2, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)); - return await this._containerOrBlobOperation.breakLease(operationOptions); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message + const chunk = this._readable.read(size); + if (chunk) { + this._position += chunk.length; + return this.toUint8Array(chunk); + } else { + return new Promise((resolve2, reject) => { + const cleanUp = () => { + this._readable.removeListener("readable", readableCallback); + this._readable.removeListener("error", rejectCallback); + this._readable.removeListener("end", rejectCallback); + this._readable.removeListener("close", rejectCallback); + if (options.abortSignal) { + options.abortSignal.removeEventListener("abort", abortHandler); + } + }; + const readableCallback = () => { + const callbackChunk = this._readable.read(size); + if (callbackChunk) { + this._position += callbackChunk.length; + cleanUp(); + resolve2(this.toUint8Array(callbackChunk)); + } + }; + const rejectCallback = () => { + cleanUp(); + reject(); + }; + const abortHandler = () => { + cleanUp(); + reject(ABORT_ERROR); + }; + this._readable.on("readable", readableCallback); + this._readable.once("error", rejectCallback); + this._readable.once("end", rejectCallback); + this._readable.once("close", rejectCallback); + if (options.abortSignal) { + options.abortSignal.addEventListener("abort", abortHandler); + } }); - throw e2; - } finally { - span.end(); } } }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/RetriableReadableStream.js -import { Readable as Readable2 } from "stream"; -var RetriableReadableStream; -var init_RetriableReadableStream = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/RetriableReadableStream.js"() { - RetriableReadableStream = class extends Readable2 { +// node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/index.js +var init_src8 = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/index.js"() { + init_AvroReader(); + init_AvroReadableFromStream(); + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js +import { Readable as Readable3 } from "stream"; +var BlobQuickQueryStream; +var init_BlobQuickQueryStream = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js"() { + init_src8(); + BlobQuickQueryStream = class extends Readable3 { /** - * Creates an instance of RetriableReadableStream. + * Creates an instance of BlobQuickQueryStream. * * @param source - The current ReadableStream returned from getter - * @param getter - A method calling downloading request returning - * a new ReadableStream from specified offset - * @param offset - Offset position in original data source to read - * @param count - How much data in original data source to read * @param options - */ - constructor(source, getter, offset, count, options = {}) { - super({ highWaterMark: options.highWaterMark }); - this.retries = 0; - this.sourceDataHandler = (data) => { - if (this.options.doInjectErrorOnce) { - this.options.doInjectErrorOnce = void 0; - this.source.pause(); - this.source.removeAllListeners("data"); - this.source.emit("end"); - return; - } - this.offset += data.length; - if (this.onProgress) { - this.onProgress({ loadedBytes: this.offset - this.start }); - } - if (!this.push(data)) { - this.source.pause(); - } - }; - this.sourceErrorOrEndHandler = (err) => { - if (err && err.name === "AbortError") { - this.destroy(err); - return; - } - this.removeSourceEventHandlers(); - if (this.offset - 1 === this.end) { - this.push(null); - } else if (this.offset <= this.end) { - if (this.retries < this.maxRetryRequests) { - this.retries += 1; - this.getter(this.offset).then((newSource) => { - this.source = newSource; - this.setSourceEventHandlers(); - return; - }).catch((error) => { - this.destroy(error); - }); - } else { - this.destroy(new Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this.offset - 1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`)); - } - } else { - this.destroy(new Error(`Data corruption failure: Received more data than original request, data needed offset is ${this.end}, received offset: ${this.offset - 1}`)); - } - }; - this.getter = getter; + constructor(source, options = {}) { + super(); + this.avroPaused = true; this.source = source; - this.start = offset; - this.offset = offset; - this.end = offset + count - 1; - this.maxRetryRequests = options.maxRetryRequests && options.maxRetryRequests >= 0 ? options.maxRetryRequests : 0; this.onProgress = options.onProgress; - this.options = options; - this.setSourceEventHandlers(); + this.onError = options.onError; + this.avroReader = new AvroReader(new AvroReadableFromStream(this.source)); + this.avroIter = this.avroReader.parseObjects({ abortSignal: options.abortSignal }); } _read() { - this.source.resume(); - } - setSourceEventHandlers() { - this.source.on("data", this.sourceDataHandler); - this.source.on("end", this.sourceErrorOrEndHandler); - this.source.on("error", this.sourceErrorOrEndHandler); - } - removeSourceEventHandlers() { - this.source.removeListener("data", this.sourceDataHandler); - this.source.removeListener("end", this.sourceErrorOrEndHandler); - this.source.removeListener("error", this.sourceErrorOrEndHandler); + if (this.avroPaused) { + this.readInternal().catch((err) => { + this.emit("error", err); + }); + } } - _destroy(error, callback) { - this.removeSourceEventHandlers(); - this.source.destroy(); - callback(error === null ? void 0 : error); + async readInternal() { + this.avroPaused = false; + let avroNext; + do { + avroNext = await this.avroIter.next(); + if (avroNext.done) { + break; + } + const obj = avroNext.value; + const schema = obj.$schema; + if (typeof schema !== "string") { + throw Error("Missing schema in avro record."); + } + switch (schema) { + case "com.microsoft.azure.storage.queryBlobContents.resultData": + { + const data = obj.data; + if (data instanceof Uint8Array === false) { + throw Error("Invalid data in avro result record."); + } + if (!this.push(Buffer.from(data))) { + this.avroPaused = true; + } + } + break; + case "com.microsoft.azure.storage.queryBlobContents.progress": + { + const bytesScanned = obj.bytesScanned; + if (typeof bytesScanned !== "number") { + throw Error("Invalid bytesScanned in avro progress record."); + } + if (this.onProgress) { + this.onProgress({ loadedBytes: bytesScanned }); + } + } + break; + case "com.microsoft.azure.storage.queryBlobContents.end": + if (this.onProgress) { + const totalBytes = obj.totalBytes; + if (typeof totalBytes !== "number") { + throw Error("Invalid totalBytes in avro end record."); + } + this.onProgress({ loadedBytes: totalBytes }); + } + this.push(null); + break; + case "com.microsoft.azure.storage.queryBlobContents.error": + if (this.onError) { + const fatal2 = obj.fatal; + if (typeof fatal2 !== "boolean") { + throw Error("Invalid fatal in avro error record."); + } + const name2 = obj.name; + if (typeof name2 !== "string") { + throw Error("Invalid name in avro error record."); + } + const description = obj.description; + if (typeof description !== "string") { + throw Error("Invalid description in avro error record."); + } + const position = obj.position; + if (typeof position !== "number") { + throw Error("Invalid position in avro error record."); + } + this.onError({ + position, + name: name2, + isFatal: fatal2, + description + }); + } + break; + default: + throw Error(`Unknown schema ${schema} in avro progress record.`); + } + } while (!avroNext.done && !this.avroPaused); } }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobDownloadResponse.js -var BlobDownloadResponse; -var init_BlobDownloadResponse = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobDownloadResponse.js"() { +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobQueryResponse.js +var BlobQueryResponse; +var init_BlobQueryResponse = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobQueryResponse.js"() { init_src5(); - init_RetriableReadableStream(); - BlobDownloadResponse = class { + init_BlobQuickQueryStream(); + BlobQueryResponse = class { /** - * Creates an instance of BlobDownloadResponse. + * Creates an instance of BlobQueryResponse. * * @param originalResponse - - * @param getter - - * @param offset - - * @param count - * @param options - */ - constructor(originalResponse, getter, offset, count, options = {}) { + constructor(originalResponse, options = {}) { this.originalResponse = originalResponse; - this.blobDownloadStream = new RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); + this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); } /** * Indicates that the service supports @@ -48454,7 +64098,7 @@ var init_BlobDownloadResponse = __esm({ * @readonly */ get copyCompletedOn() { - return this.originalResponse.copyCompletedOn; + return void 0; } /** * String identifier for the last attempted Copy @@ -48561,14 +64205,6 @@ var init_BlobDownloadResponse = __esm({ get etag() { return this.originalResponse.etag; } - /** - * The number of tags associated with the blob - * - * @readonly - */ - get tagCount() { - return this.originalResponse.tagCount; - } /** * The error code. * @@ -48611,23 +64247,6 @@ var init_BlobDownloadResponse = __esm({ get lastModified() { return this.originalResponse.lastModified; } - /** - * Returns the UTC date and time generated by the service that indicates the time at which the blob was - * last read or written to. - * - * @readonly - */ - get lastAccessed() { - return this.originalResponse.lastAccessed; - } - /** - * Returns the date and time the blob was created. - * - * @readonly - */ - get createdOn() { - return this.originalResponse.createdOn; - } /** * A name-value pair * to associate with a file storage object. @@ -48650,2237 +64269,2896 @@ var init_BlobDownloadResponse = __esm({ * If a client request id header is sent in the request, this header will be present in the * response with the same value. * - * @readonly + * @readonly + */ + get clientRequestId() { + return this.originalResponse.clientRequestId; + } + /** + * Indicates the version of the File service used + * to execute the request. + * + * @readonly + */ + get version() { + return this.originalResponse.version; + } + /** + * The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned + * when the blob was encrypted with a customer-provided key. + * + * @readonly + */ + get encryptionKeySha256() { + return this.originalResponse.encryptionKeySha256; + } + /** + * If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to + * true, then the request returns a crc64 for the range, as long as the range size is less than + * or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is + * specified in the same request, it will fail with 400(Bad Request) + */ + get contentCrc64() { + return this.originalResponse.contentCrc64; + } + /** + * The response body as a browser Blob. + * Always undefined in node.js. + * + * @readonly + */ + get blobBody() { + return void 0; + } + /** + * The response body as a node.js Readable stream. + * Always undefined in the browser. + * + * It will parse avor data returned by blob query. + * + * @readonly + */ + get readableStreamBody() { + return isNode ? this.blobDownloadStream : void 0; + } + /** + * The HTTP response. + */ + get _response() { + return this.originalResponse._response; + } + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/models.js +function toAccessTier(tier2) { + if (tier2 === void 0) { + return void 0; + } + return tier2; +} +function ensureCpkIfSpecified(cpk, isHttps) { + if (cpk && !isHttps) { + throw new RangeError("Customer-provided encryption key must be used over HTTPS."); + } + if (cpk && !cpk.encryptionAlgorithm) { + cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; + } +} +var BlockBlobTier, PremiumPageBlobTier, StorageBlobAudience; +var init_models3 = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/models.js"() { + init_constants2(); + (function(BlockBlobTier2) { + BlockBlobTier2["Hot"] = "Hot"; + BlockBlobTier2["Cool"] = "Cool"; + BlockBlobTier2["Cold"] = "Cold"; + BlockBlobTier2["Archive"] = "Archive"; + })(BlockBlobTier || (BlockBlobTier = {})); + (function(PremiumPageBlobTier2) { + PremiumPageBlobTier2["P4"] = "P4"; + PremiumPageBlobTier2["P6"] = "P6"; + PremiumPageBlobTier2["P10"] = "P10"; + PremiumPageBlobTier2["P15"] = "P15"; + PremiumPageBlobTier2["P20"] = "P20"; + PremiumPageBlobTier2["P30"] = "P30"; + PremiumPageBlobTier2["P40"] = "P40"; + PremiumPageBlobTier2["P50"] = "P50"; + PremiumPageBlobTier2["P60"] = "P60"; + PremiumPageBlobTier2["P70"] = "P70"; + PremiumPageBlobTier2["P80"] = "P80"; + })(PremiumPageBlobTier || (PremiumPageBlobTier = {})); + (function(StorageBlobAudience2) { + StorageBlobAudience2["StorageOAuthScopes"] = "https://storage.azure.com/.default"; + StorageBlobAudience2["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; + })(StorageBlobAudience || (StorageBlobAudience = {})); + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/PageBlobRangeResponse.js +function rangeResponseFromModel(response) { + const pageRange = (response._response.parsedBody.pageRange || []).map((x2) => ({ + offset: x2.start, + count: x2.end - x2.start + })); + const clearRange = (response._response.parsedBody.clearRange || []).map((x2) => ({ + offset: x2.start, + count: x2.end - x2.start + })); + return Object.assign(Object.assign({}, response), { + pageRange, + clearRange, + _response: Object.assign(Object.assign({}, response._response), { parsedBody: { + pageRange, + clearRange + } }) + }); +} +var init_PageBlobRangeResponse = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/PageBlobRangeResponse.js"() { + } +}); + +// node_modules/@azure/core-lro/dist-esm/src/legacy/poller.js +var PollerStoppedError, PollerCancelledError, Poller; +var init_poller = __esm({ + "node_modules/@azure/core-lro/dist-esm/src/legacy/poller.js"() { + PollerStoppedError = class _PollerStoppedError extends Error { + constructor(message) { + super(message); + this.name = "PollerStoppedError"; + Object.setPrototypeOf(this, _PollerStoppedError.prototype); + } + }; + PollerCancelledError = class _PollerCancelledError extends Error { + constructor(message) { + super(message); + this.name = "PollerCancelledError"; + Object.setPrototypeOf(this, _PollerCancelledError.prototype); + } + }; + Poller = class { + /** + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. + * + * When writing an implementation of a Poller, this implementation needs to deal with the initialization + * of any custom state beyond the basic definition of the poller. The basic poller assumes that the poller's + * operation has already been defined, at least its basic properties. The code below shows how to approach + * the definition of the constructor of a new custom poller. + * + * ```ts + * export class MyPoller extends Poller { + * constructor({ + * // Anything you might need outside of the basics + * }) { + * let state: MyOperationState = { + * privateProperty: private, + * publicProperty: public, + * }; + * + * const operation = { + * state, + * update, + * cancel, + * toString + * } + * + * // Sending the operation to the parent's constructor. + * super(operation); + * + * // You can assign more local properties here. + * } + * } + * ``` + * + * Inside of this constructor, a new promise is created. This will be used to + * tell the user when the poller finishes (see `pollUntilDone()`). The promise's + * resolve and reject methods are also used internally to control when to resolve + * or reject anyone waiting for the poller to finish. + * + * The constructor of a custom implementation of a poller is where any serialized version of + * a previous poller's operation should be deserialized into the operation sent to the + * base constructor. For example: + * + * ```ts + * export class MyPoller extends Poller { + * constructor( + * baseOperation: string | undefined + * ) { + * let state: MyOperationState = {}; + * if (baseOperation) { + * state = { + * ...JSON.parse(baseOperation).state, + * ...state + * }; + * } + * const operation = { + * state, + * // ... + * } + * super(operation); + * } + * } + * ``` + * + * @param operation - Must contain the basic properties of `PollOperation`. */ - get clientRequestId() { - return this.originalResponse.clientRequestId; + constructor(operation) { + this.resolveOnUnsuccessful = false; + this.stopped = true; + this.pollProgressCallbacks = []; + this.operation = operation; + this.promise = new Promise((resolve2, reject) => { + this.resolve = resolve2; + this.reject = reject; + }); + this.promise.catch(() => { + }); } /** - * Indicates the version of the Blob service used - * to execute the request. - * - * @readonly + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. */ - get version() { - return this.originalResponse.version; + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } } /** - * Indicates the versionId of the downloaded blob version. + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. * - * @readonly - */ - get versionId() { - return this.originalResponse.versionId; - } - /** - * Indicates whether version of this blob is a current version. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get isCurrentVersion() { - return this.originalResponse.isCurrentVersion; + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this) + }); + } + this.processUpdatedState(); } /** - * The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned - * when the blob was encrypted with a customer-provided key. + * fireProgress calls the functions passed in via onProgress the method of the poller. * - * @readonly + * It loops over all of the callbacks received from onProgress, and executes them, sending them + * the current operation state. + * + * @param state - The current operation state. */ - get encryptionKeySha256() { - return this.originalResponse.encryptionKeySha256; + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } } /** - * If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to - * true, then the request returns a crc64 for the range, as long as the range size is less than - * or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is - * specified in the same request, it will fail with 400(Bad Request) + * Invokes the underlying operation's cancel method. */ - get contentCrc64() { - return this.originalResponse.contentCrc64; + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); } /** - * Object Replication Policy Id of the destination blob. + * Returns a promise that will resolve once a single polling request finishes. + * It does this by calling the update method of the Poller's operation. * - * @readonly - */ - get objectReplicationDestinationPolicyId() { - return this.originalResponse.objectReplicationDestinationPolicyId; - } - /** - * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get objectReplicationSourceProperties() { - return this.originalResponse.objectReplicationSourceProperties; + poll(options = {}) { + if (!this.pollOncePromise) { + this.pollOncePromise = this.pollOnce(options); + const clearPollOncePromise = () => { + this.pollOncePromise = void 0; + }; + this.pollOncePromise.then(clearPollOncePromise, clearPollOncePromise).catch(this.reject); + } + return this.pollOncePromise; + } + processUpdatedState() { + if (this.operation.state.error) { + this.stopped = true; + if (!this.resolveOnUnsuccessful) { + this.reject(this.operation.state.error); + throw this.operation.state.error; + } + } + if (this.operation.state.isCancelled) { + this.stopped = true; + if (!this.resolveOnUnsuccessful) { + const error = new PollerCancelledError("Operation was canceled"); + this.reject(error); + throw error; + } + } + if (this.isDone() && this.resolve) { + this.resolve(this.getResult()); + } } /** - * If this blob has been sealed. - * - * @readonly + * Returns a promise that will resolve once the underlying operation is completed. */ - get isSealed() { - return this.originalResponse.isSealed; + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + this.processUpdatedState(); + return this.promise; } /** - * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. * - * @readonly + * It returns a method that can be used to stop receiving updates on the given callback function. */ - get immutabilityPolicyExpiresOn() { - return this.originalResponse.immutabilityPolicyExpiresOn; + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c2) => c2 !== callback); + }; } /** - * Indicates immutability policy mode. - * - * @readonly + * Returns true if the poller has finished polling. */ - get immutabilityPolicyMode() { - return this.originalResponse.immutabilityPolicyMode; + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); } /** - * Indicates if a legal hold is present on the blob. - * - * @readonly + * Stops the poller from continuing to poll. */ - get legalHold() { - return this.originalResponse.legalHold; + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } } /** - * The response body as a browser Blob. - * Always undefined in node.js. - * - * @readonly + * Returns true if the poller is stopped. */ - get contentAsBlob() { - return this.originalResponse.blobBody; + isStopped() { + return this.stopped; } /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. + * Attempts to cancel the underlying operation. * - * It will automatically retry when internal read stream unexpected ends. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly - */ - get readableStreamBody() { - return isNode ? this.blobDownloadStream : void 0; - } - /** - * The HTTP response. - */ - get _response() { - return this.originalResponse._response; - } - }; - } -}); - -// node_modules/@azure/core-paging/dist-esm/src/models.js -var init_models2 = __esm({ - "node_modules/@azure/core-paging/dist-esm/src/models.js"() { - } -}); - -// node_modules/@azure/core-paging/dist-esm/src/getPagedAsyncIterator.js -var init_getPagedAsyncIterator = __esm({ - "node_modules/@azure/core-paging/dist-esm/src/getPagedAsyncIterator.js"() { - } -}); - -// node_modules/@azure/core-paging/dist-esm/src/index.js -var init_src7 = __esm({ - "node_modules/@azure/core-paging/dist-esm/src/index.js"() { - init_models2(); - init_getPagedAsyncIterator(); - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroConstants.js -var AVRO_SYNC_MARKER_SIZE, AVRO_INIT_BYTES, AVRO_CODEC_KEY, AVRO_SCHEMA_KEY; -var init_AvroConstants = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroConstants.js"() { - AVRO_SYNC_MARKER_SIZE = 16; - AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); - AVRO_CODEC_KEY = "avro.codec"; - AVRO_SCHEMA_KEY = "avro.schema"; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroParser.js -var AvroParser, AvroComplex, AvroPrimitive, AvroType, AvroPrimitiveType, AvroEnumType, AvroUnionType, AvroMapType, AvroRecordType; -var init_AvroParser = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroParser.js"() { - AvroParser = class _AvroParser { - /** - * Reads a fixed number of bytes from the stream. + * If it's called again before it finishes, it will throw an error. * - * @param stream - - * @param length - - * @param options - + * @param options - Optional properties passed to the operation's update method. */ - static async readFixedBytes(stream, length, options = {}) { - const bytes = await stream.read(length, { abortSignal: options.abortSignal }); - if (bytes.length !== length) { - throw new Error("Hit stream end."); + cancelOperation(options = {}) { + if (!this.cancelPromise) { + this.cancelPromise = this.cancelOnce(options); + } else if (options.abortSignal) { + throw new Error("A cancel request is currently pending"); } - return bytes; + return this.cancelPromise; } /** - * Reads a single byte from the stream. + * Returns the state of the operation. * - * @param stream - - * @param options - - */ - static async readByte(stream, options = {}) { - const buf = await _AvroParser.readFixedBytes(stream, 1, options); - return buf[0]; - } - // int and long are stored in variable-length zig-zag coding. - // variable-length: https://lucene.apache.org/core/3_5_0/fileformats.html#VInt - // zig-zag: https://developers.google.com/protocol-buffers/docs/encoding?csw=1#types - static async readZigZagLong(stream, options = {}) { - let zigZagEncoded = 0; - let significanceInBit = 0; - let byte, haveMoreByte, significanceInFloat; - do { - byte = await _AvroParser.readByte(stream, options); - haveMoreByte = byte & 128; - zigZagEncoded |= (byte & 127) << significanceInBit; - significanceInBit += 7; - } while (haveMoreByte && significanceInBit < 28); - if (haveMoreByte) { - zigZagEncoded = zigZagEncoded; - significanceInFloat = 268435456; - do { - byte = await _AvroParser.readByte(stream, options); - zigZagEncoded += (byte & 127) * significanceInFloat; - significanceInFloat *= 128; - } while (byte & 128); - const res = (zigZagEncoded % 2 ? -(zigZagEncoded + 1) : zigZagEncoded) / 2; - if (res < Number.MIN_SAFE_INTEGER || res > Number.MAX_SAFE_INTEGER) { - throw new Error("Integer overflow."); - } - return res; - } - return zigZagEncoded >> 1 ^ -(zigZagEncoded & 1); - } - static async readLong(stream, options = {}) { - return _AvroParser.readZigZagLong(stream, options); - } - static async readInt(stream, options = {}) { - return _AvroParser.readZigZagLong(stream, options); - } - static async readNull() { - return null; - } - static async readBoolean(stream, options = {}) { - const b2 = await _AvroParser.readByte(stream, options); - if (b2 === 1) { - return true; - } else if (b2 === 0) { - return false; - } else { - throw new Error("Byte was not a boolean."); - } - } - static async readFloat(stream, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream, 4, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat32(0, true); - } - static async readDouble(stream, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream, 8, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat64(0, true); - } - static async readBytes(stream, options = {}) { - const size = await _AvroParser.readLong(stream, options); - if (size < 0) { - throw new Error("Bytes size was negative."); - } - return stream.read(size, { abortSignal: options.abortSignal }); - } - static async readString(stream, options = {}) { - const u8arr = await _AvroParser.readBytes(stream, options); - const utf8decoder = new TextDecoder(); - return utf8decoder.decode(u8arr); - } - static async readMapPair(stream, readItemMethod, options = {}) { - const key = await _AvroParser.readString(stream, options); - const value = await readItemMethod(stream, options); - return { key, value }; - } - static async readMap(stream, readItemMethod, options = {}) { - const readPairMethod = (s2, opts = {}) => { - return _AvroParser.readMapPair(s2, readItemMethod, opts); - }; - const pairs = await _AvroParser.readArray(stream, readPairMethod, options); - const dict = {}; - for (const pair of pairs) { - dict[pair.key] = pair.value; - } - return dict; - } - static async readArray(stream, readItemMethod, options = {}) { - const items = []; - for (let count = await _AvroParser.readLong(stream, options); count !== 0; count = await _AvroParser.readLong(stream, options)) { - if (count < 0) { - await _AvroParser.readLong(stream, options); - count = -count; - } - while (count--) { - const item = await readItemMethod(stream, options); - items.push(item); - } - } - return items; - } - }; - (function(AvroComplex2) { - AvroComplex2["RECORD"] = "record"; - AvroComplex2["ENUM"] = "enum"; - AvroComplex2["ARRAY"] = "array"; - AvroComplex2["MAP"] = "map"; - AvroComplex2["UNION"] = "union"; - AvroComplex2["FIXED"] = "fixed"; - })(AvroComplex || (AvroComplex = {})); - (function(AvroPrimitive2) { - AvroPrimitive2["NULL"] = "null"; - AvroPrimitive2["BOOLEAN"] = "boolean"; - AvroPrimitive2["INT"] = "int"; - AvroPrimitive2["LONG"] = "long"; - AvroPrimitive2["FLOAT"] = "float"; - AvroPrimitive2["DOUBLE"] = "double"; - AvroPrimitive2["BYTES"] = "bytes"; - AvroPrimitive2["STRING"] = "string"; - })(AvroPrimitive || (AvroPrimitive = {})); - AvroType = class _AvroType { - /** - * Determines the AvroType from the Avro Schema. - */ - static fromSchema(schema) { - if (typeof schema === "string") { - return _AvroType.fromStringSchema(schema); - } else if (Array.isArray(schema)) { - return _AvroType.fromArraySchema(schema); - } else { - return _AvroType.fromObjectSchema(schema); - } - } - static fromStringSchema(schema) { - switch (schema) { - case AvroPrimitive.NULL: - case AvroPrimitive.BOOLEAN: - case AvroPrimitive.INT: - case AvroPrimitive.LONG: - case AvroPrimitive.FLOAT: - case AvroPrimitive.DOUBLE: - case AvroPrimitive.BYTES: - case AvroPrimitive.STRING: - return new AvroPrimitiveType(schema); - default: - throw new Error(`Unexpected Avro type ${schema}`); - } - } - static fromArraySchema(schema) { - return new AvroUnionType(schema.map(_AvroType.fromSchema)); - } - static fromObjectSchema(schema) { - const type3 = schema.type; - try { - return _AvroType.fromStringSchema(type3); - } catch (err) { - } - switch (type3) { - case AvroComplex.RECORD: - if (schema.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema}`); - } - if (!schema.name) { - throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema}`); - } - const fields = {}; - if (!schema.fields) { - throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema}`); - } - for (const field of schema.fields) { - fields[field.name] = _AvroType.fromSchema(field.type); - } - return new AvroRecordType(fields, schema.name); - case AvroComplex.ENUM: - if (schema.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema}`); - } - if (!schema.symbols) { - throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema}`); - } - return new AvroEnumType(schema.symbols); - case AvroComplex.MAP: - if (!schema.values) { - throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema}`); - } - return new AvroMapType(_AvroType.fromSchema(schema.values)); - case AvroComplex.ARRAY: - case AvroComplex.FIXED: - default: - throw new Error(`Unexpected Avro type ${type3} in ${schema}`); - } - } - }; - AvroPrimitiveType = class extends AvroType { - constructor(primitive) { - super(); - this._primitive = primitive; - } - read(stream, options = {}) { - switch (this._primitive) { - case AvroPrimitive.NULL: - return AvroParser.readNull(); - case AvroPrimitive.BOOLEAN: - return AvroParser.readBoolean(stream, options); - case AvroPrimitive.INT: - return AvroParser.readInt(stream, options); - case AvroPrimitive.LONG: - return AvroParser.readLong(stream, options); - case AvroPrimitive.FLOAT: - return AvroParser.readFloat(stream, options); - case AvroPrimitive.DOUBLE: - return AvroParser.readDouble(stream, options); - case AvroPrimitive.BYTES: - return AvroParser.readBytes(stream, options); - case AvroPrimitive.STRING: - return AvroParser.readString(stream, options); - default: - throw new Error("Unknown Avro Primitive"); - } + * Even though TState will be the same type inside any of the methods of any extension of the Poller class, + * implementations of the pollers can customize what's shared with the public by writing their own + * version of the `getOperationState` method, and by defining two types, one representing the internal state of the poller + * and a public type representing a safe to share subset of the properties of the internal state. + * Their definition of getOperationState can then return their public type. + * + * Example: + * + * ```ts + * // Let's say we have our poller's operation state defined as: + * interface MyOperationState extends PollOperationState { + * privateProperty?: string; + * publicProperty?: string; + * } + * + * // To allow us to have a true separation of public and private state, we have to define another interface: + * interface PublicState extends PollOperationState { + * publicProperty?: string; + * } + * + * // Then, we define our Poller as follows: + * export class MyPoller extends Poller { + * // ... More content is needed here ... + * + * public getOperationState(): PublicState { + * const state: PublicState = this.operation.state; + * return { + * // Properties from PollOperationState + * isStarted: state.isStarted, + * isCompleted: state.isCompleted, + * isCancelled: state.isCancelled, + * error: state.error, + * result: state.result, + * + * // The only other property needed by PublicState. + * publicProperty: state.publicProperty + * } + * } + * } + * ``` + * + * You can see this in the tests of this repository, go to the file: + * `../test/utils/testPoller.ts` + * and look for the getOperationState implementation. + */ + getOperationState() { + return this.operation.state; } - }; - AvroEnumType = class extends AvroType { - constructor(symbols) { - super(); - this._symbols = symbols; + /** + * Returns the result value of the operation, + * regardless of the state of the poller. + * It can return undefined or an incomplete form of the final TResult value + * depending on the implementation. + */ + getResult() { + const state = this.operation.state; + return state.result; } - async read(stream, options = {}) { - const value = await AvroParser.readInt(stream, options); - return this._symbols[value]; + /** + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. + */ + toString() { + return this.operation.toString(); } }; - AvroUnionType = class extends AvroType { - constructor(types) { - super(); - this._types = types; + } +}); + +// node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/index.js +var init_lroEngine = __esm({ + "node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/index.js"() { + } +}); + +// node_modules/@azure/core-lro/dist-esm/src/legacy/pollOperation.js +var init_pollOperation = __esm({ + "node_modules/@azure/core-lro/dist-esm/src/legacy/pollOperation.js"() { + } +}); + +// node_modules/@azure/core-lro/dist-esm/src/index.js +var init_src9 = __esm({ + "node_modules/@azure/core-lro/dist-esm/src/index.js"() { + init_lroEngine(); + init_poller(); + init_pollOperation(); + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js +function makeBlobBeginCopyFromURLPollOperation(state) { + return { + state: Object.assign({}, state), + cancel, + toString, + update + }; +} +var BlobBeginCopyFromUrlPoller, cancel, update, toString; +var init_BlobStartCopyFromUrlPoller = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js"() { + init_src5(); + init_src9(); + BlobBeginCopyFromUrlPoller = class extends Poller { + constructor(options) { + const { blobClient, copySource: copySource2, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; + let state; + if (resumeFrom) { + state = JSON.parse(resumeFrom).state; + } + const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { + blobClient, + copySource: copySource2, + startCopyFromURLOptions + })); + super(operation); + if (typeof onProgress === "function") { + this.onProgress(onProgress); + } + this.intervalInMs = intervalInMs; } - async read(stream, options = {}) { - const typeIndex = await AvroParser.readInt(stream, options); - return this._types[typeIndex].read(stream, options); + delay() { + return delay(this.intervalInMs); } }; - AvroMapType = class extends AvroType { - constructor(itemType) { - super(); - this._itemType = itemType; + cancel = async function cancel2(options = {}) { + const state = this.state; + const { copyId: copyId2 } = state; + if (state.isCompleted) { + return makeBlobBeginCopyFromURLPollOperation(state); } - read(stream, options = {}) { - const readItemMethod = (s2, opts) => { - return this._itemType.read(s2, opts); - }; - return AvroParser.readMap(stream, readItemMethod, options); + if (!copyId2) { + state.isCancelled = true; + return makeBlobBeginCopyFromURLPollOperation(state); } + await state.blobClient.abortCopyFromURL(copyId2, { + abortSignal: options.abortSignal + }); + state.isCancelled = true; + return makeBlobBeginCopyFromURLPollOperation(state); }; - AvroRecordType = class extends AvroType { - constructor(fields, name2) { - super(); - this._fields = fields; - this._name = name2; - } - async read(stream, options = {}) { - const record = {}; - record["$schema"] = this._name; - for (const key in this._fields) { - if (Object.prototype.hasOwnProperty.call(this._fields, key)) { - record[key] = await this._fields[key].read(stream, options); + update = async function update2(options = {}) { + const state = this.state; + const { blobClient, copySource: copySource2, startCopyFromURLOptions } = state; + if (!state.isStarted) { + state.isStarted = true; + const result = await blobClient.startCopyFromURL(copySource2, startCopyFromURLOptions); + state.copyId = result.copyId; + if (result.copyStatus === "success") { + state.result = result; + state.isCompleted = true; + } + } else if (!state.isCompleted) { + try { + const result = await state.blobClient.getProperties({ abortSignal: options.abortSignal }); + const { copyStatus, copyProgress } = result; + const prevCopyProgress = state.copyProgress; + if (copyProgress) { + state.copyProgress = copyProgress; + } + if (copyStatus === "pending" && copyProgress !== prevCopyProgress && typeof options.fireProgress === "function") { + options.fireProgress(state); + } else if (copyStatus === "success") { + state.result = result; + state.isCompleted = true; + } else if (copyStatus === "failed") { + state.error = new Error(`Blob copy failed with reason: "${result.copyStatusDescription || "unknown"}"`); + state.isCompleted = true; } + } catch (err) { + state.error = err; + state.isCompleted = true; } - return record; } + return makeBlobBeginCopyFromURLPollOperation(state); + }; + toString = function toString2() { + return JSON.stringify({ state: this.state }, (key, value) => { + if (key === "blobClient") { + return void 0; + } + return value; + }); }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/utils/utils.common.js -function arraysEqual(a2, b2) { - if (a2 === b2) - return true; - if (a2 == null || b2 == null) - return false; - if (a2.length !== b2.length) - return false; - for (let i2 = 0; i2 < a2.length; ++i2) { - if (a2[i2] !== b2[i2]) - return false; +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/Range.js +function rangeToString(iRange) { + if (iRange.offset < 0) { + throw new RangeError(`Range.offset cannot be smaller than 0.`); } - return true; + if (iRange.count && iRange.count <= 0) { + throw new RangeError(`Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.`); + } + return iRange.count ? `bytes=${iRange.offset}-${iRange.offset + iRange.count - 1}` : `bytes=${iRange.offset}-`; } -var init_utils_common2 = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/utils/utils.common.js"() { +var init_Range = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/Range.js"() { } }); -// node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroReader.js -var AvroReader; -var init_AvroReader = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroReader.js"() { - init_tslib_es6(); - init_src7(); - init_AvroConstants(); - init_AvroParser(); - init_utils_common2(); - AvroReader = class { - constructor(dataStream, headerStream, currentBlockOffset, indexWithinCurrentBlock) { - this._dataStream = dataStream; - this._headerStream = headerStream || dataStream; - this._initialized = false; - this._blockOffset = currentBlockOffset || 0; - this._objectIndex = indexWithinCurrentBlock || 0; - this._initialBlockOffset = currentBlockOffset || 0; - } - get blockOffset() { - return this._blockOffset; - } - get objectIndex() { - return this._objectIndex; +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/Batch.js +import { EventEmitter } from "events"; +var BatchStates, Batch; +var init_Batch = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/Batch.js"() { + (function(BatchStates2) { + BatchStates2[BatchStates2["Good"] = 0] = "Good"; + BatchStates2[BatchStates2["Error"] = 1] = "Error"; + })(BatchStates || (BatchStates = {})); + Batch = class { + /** + * Creates an instance of Batch. + * @param concurrency - + */ + constructor(concurrency = 5) { + this.actives = 0; + this.completed = 0; + this.offset = 0; + this.operations = []; + this.state = BatchStates.Good; + if (concurrency < 1) { + throw new RangeError("concurrency must be larger than 0"); + } + this.concurrency = concurrency; + this.emitter = new EventEmitter(); } - async initialize(options = {}) { - const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { - abortSignal: options.abortSignal + /** + * Add a operation into queue. + * + * @param operation - + */ + addOperation(operation) { + this.operations.push(async () => { + try { + this.actives++; + await operation(); + this.actives--; + this.completed++; + this.parallelExecute(); + } catch (error) { + this.emitter.emit("error", error); + } }); - if (!arraysEqual(header, AVRO_INIT_BYTES)) { - throw new Error("Stream is not an Avro file."); + } + /** + * Start execute operations in the queue. + * + */ + async do() { + if (this.operations.length === 0) { + return Promise.resolve(); } - this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, { - abortSignal: options.abortSignal + this.parallelExecute(); + return new Promise((resolve2, reject) => { + this.emitter.on("finish", resolve2); + this.emitter.on("error", (error) => { + this.state = BatchStates.Error; + reject(error); + }); }); - const codec = this._metadata[AVRO_CODEC_KEY]; - if (!(codec === void 0 || codec === null || codec === "null")) { - throw new Error("Codecs are not supported"); + } + /** + * Get next operation to be executed. Return null when reaching ends. + * + */ + nextOperation() { + if (this.offset < this.operations.length) { + return this.operations[this.offset++]; } - this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - }); - const schema = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); - this._itemType = AvroType.fromSchema(schema); - if (this._blockOffset === 0) { - this._blockOffset = this._initialBlockOffset + this._dataStream.position; + return null; + } + /** + * Start execute operations. One one the most important difference between + * this method with do() is that do() wraps as an sync method. + * + */ + parallelExecute() { + if (this.state === BatchStates.Error) { + return; } - this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - }); - await AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal }); - this._initialized = true; - if (this._objectIndex && this._objectIndex > 0) { - for (let i2 = 0; i2 < this._objectIndex; i2++) { - await this._itemType.read(this._dataStream, { abortSignal: options.abortSignal }); - this._itemsRemainingInBlock--; + if (this.completed >= this.operations.length) { + this.emitter.emit("finish"); + return; + } + while (this.actives < this.concurrency) { + const operation = this.nextOperation(); + if (operation) { + operation(); + } else { + return; } } } - hasNext() { - return !this._initialized || this._itemsRemainingInBlock > 0; + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-common/src/BuffersStream.js +import { Readable as Readable4 } from "stream"; +var BuffersStream; +var init_BuffersStream = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-common/src/BuffersStream.js"() { + BuffersStream = class extends Readable4 { + /** + * Creates an instance of BuffersStream that will emit the data + * contained in the array of buffers. + * + * @param buffers - Array of buffers containing the data + * @param byteLength - The total length of data contained in the buffers + */ + constructor(buffers, byteLength, options) { + super(options); + this.buffers = buffers; + this.byteLength = byteLength; + this.byteOffsetInCurrentBuffer = 0; + this.bufferIndex = 0; + this.pushedBytesLength = 0; + let buffersLength = 0; + for (const buf of this.buffers) { + buffersLength += buf.byteLength; + } + if (buffersLength < this.byteLength) { + throw new Error("Data size shouldn't be larger than the total length of buffers."); + } } - parseObjects(options = {}) { - return __asyncGenerator(this, arguments, function* parseObjects_1() { - if (!this._initialized) { - yield __await(this.initialize(options)); - } - while (this.hasNext()) { - const result = yield __await(this._itemType.read(this._dataStream, { - abortSignal: options.abortSignal - })); - this._itemsRemainingInBlock--; - this._objectIndex++; - if (this._itemsRemainingInBlock === 0) { - const marker2 = yield __await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - })); - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - this._objectIndex = 0; - if (!arraysEqual(this._syncMarker, marker2)) { - throw new Error("Stream is not a valid Avro file."); - } - try { - this._itemsRemainingInBlock = yield __await(AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - })); - } catch (err) { - this._itemsRemainingInBlock = 0; - } - if (this._itemsRemainingInBlock > 0) { - yield __await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })); - } + /** + * Internal _read() that will be called when the stream wants to pull more data in. + * + * @param size - Optional. The size of data to be read + */ + _read(size) { + if (this.pushedBytesLength >= this.byteLength) { + this.push(null); + } + if (!size) { + size = this.readableHighWaterMark; + } + const outBuffers = []; + let i2 = 0; + while (i2 < size && this.pushedBytesLength < this.byteLength) { + const remainingDataInAllBuffers = this.byteLength - this.pushedBytesLength; + const remainingCapacityInThisBuffer = this.buffers[this.bufferIndex].byteLength - this.byteOffsetInCurrentBuffer; + const remaining = Math.min(remainingCapacityInThisBuffer, remainingDataInAllBuffers); + if (remaining > size - i2) { + const end = this.byteOffsetInCurrentBuffer + size - i2; + outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end)); + this.pushedBytesLength += size - i2; + this.byteOffsetInCurrentBuffer = end; + i2 = size; + break; + } else { + const end = this.byteOffsetInCurrentBuffer + remaining; + outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end)); + if (remaining === remainingCapacityInThisBuffer) { + this.byteOffsetInCurrentBuffer = 0; + this.bufferIndex++; + } else { + this.byteOffsetInCurrentBuffer = end; } - yield yield __await(result); + this.pushedBytesLength += remaining; + i2 += remaining; } - }); + } + if (outBuffers.length > 1) { + this.push(Buffer.concat(outBuffers)); + } else if (outBuffers.length === 1) { + this.push(outBuffers[0]); + } } }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroReadable.js -var AvroReadable; -var init_AvroReadable = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroReadable.js"() { - AvroReadable = class { +// node_modules/@azure/storage-blob/dist-esm/storage-common/src/PooledBuffer.js +var maxBufferLength, PooledBuffer; +var init_PooledBuffer = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-common/src/PooledBuffer.js"() { + init_BuffersStream(); + maxBufferLength = __require("buffer").constants.MAX_LENGTH; + PooledBuffer = class { + constructor(capacity, buffers, totalLength) { + this.buffers = []; + this.capacity = capacity; + this._size = 0; + const bufferNum = Math.ceil(capacity / maxBufferLength); + for (let i2 = 0; i2 < bufferNum; i2++) { + let len = i2 === bufferNum - 1 ? capacity % maxBufferLength : maxBufferLength; + if (len === 0) { + len = maxBufferLength; + } + this.buffers.push(Buffer.allocUnsafe(len)); + } + if (buffers) { + this.fill(buffers, totalLength); + } + } + /** + * The size of the data contained in the pooled buffers. + */ + get size() { + return this._size; + } + /** + * Fill the internal buffers with data in the input buffers serially + * with respect to the total length and the total capacity of the internal buffers. + * Data copied will be shift out of the input buffers. + * + * @param buffers - Input buffers containing the data to be filled in the pooled buffer + * @param totalLength - Total length of the data to be filled in. + * + */ + fill(buffers, totalLength) { + this._size = Math.min(this.capacity, totalLength); + let i2 = 0, j2 = 0, targetOffset = 0, sourceOffset = 0, totalCopiedNum = 0; + while (totalCopiedNum < this._size) { + const source = buffers[i2]; + const target = this.buffers[j2]; + const copiedNum = source.copy(target, targetOffset, sourceOffset); + totalCopiedNum += copiedNum; + sourceOffset += copiedNum; + targetOffset += copiedNum; + if (sourceOffset === source.length) { + i2++; + sourceOffset = 0; + } + if (targetOffset === target.length) { + j2++; + targetOffset = 0; + } + } + buffers.splice(0, i2); + if (buffers.length > 0) { + buffers[0] = buffers[0].slice(sourceOffset); + } + } + /** + * Get the readable stream assembled from all the data in the internal buffers. + * + */ + getReadableStream() { + return new BuffersStream(this.buffers, this.size); + } }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroReadableFromStream.js -var ABORT_ERROR, AvroReadableFromStream; -var init_AvroReadableFromStream = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/AvroReadableFromStream.js"() { - init_AvroReadable(); - init_abort_controller(); - ABORT_ERROR = new AbortError("Reading from the avro stream was aborted."); - AvroReadableFromStream = class extends AvroReadable { - constructor(readable) { - super(); - this._readable = readable; - this._position = 0; - } - toUint8Array(data) { - if (typeof data === "string") { - return Buffer.from(data); - } - return data; - } - get position() { - return this._position; - } - async read(size, options = {}) { - var _a2; - if ((_a2 = options.abortSignal) === null || _a2 === void 0 ? void 0 : _a2.aborted) { - throw ABORT_ERROR; - } - if (size < 0) { - throw new Error(`size parameter should be positive: ${size}`); +// node_modules/@azure/storage-blob/dist-esm/storage-common/src/BufferScheduler.js +import { EventEmitter as EventEmitter2 } from "events"; +var BufferScheduler; +var init_BufferScheduler = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-common/src/BufferScheduler.js"() { + init_PooledBuffer(); + BufferScheduler = class { + /** + * Creates an instance of BufferScheduler. + * + * @param readable - A Node.js Readable stream + * @param bufferSize - Buffer size of every maintained buffer + * @param maxBuffers - How many buffers can be allocated + * @param outgoingHandler - An async function scheduled to be + * triggered when a buffer fully filled + * with stream data + * @param concurrency - Concurrency of executing outgoingHandlers (>0) + * @param encoding - [Optional] Encoding of Readable stream when it's a string stream + */ + constructor(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) { + this.emitter = new EventEmitter2(); + this.offset = 0; + this.isStreamEnd = false; + this.isError = false; + this.executingOutgoingHandlers = 0; + this.numBuffers = 0; + this.unresolvedDataArray = []; + this.unresolvedLength = 0; + this.incoming = []; + this.outgoing = []; + if (bufferSize <= 0) { + throw new RangeError(`bufferSize must be larger than 0, current is ${bufferSize}`); } - if (size === 0) { - return new Uint8Array(); + if (maxBuffers <= 0) { + throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`); } - if (!this._readable.readable) { - throw new Error("Stream no longer readable."); + if (concurrency <= 0) { + throw new RangeError(`concurrency must be larger than 0, current is ${concurrency}`); } - const chunk = this._readable.read(size); - if (chunk) { - this._position += chunk.length; - return this.toUint8Array(chunk); - } else { - return new Promise((resolve2, reject) => { - const cleanUp = () => { - this._readable.removeListener("readable", readableCallback); - this._readable.removeListener("error", rejectCallback); - this._readable.removeListener("end", rejectCallback); - this._readable.removeListener("close", rejectCallback); - if (options.abortSignal) { - options.abortSignal.removeEventListener("abort", abortHandler); - } - }; - const readableCallback = () => { - const callbackChunk = this._readable.read(size); - if (callbackChunk) { - this._position += callbackChunk.length; - cleanUp(); - resolve2(this.toUint8Array(callbackChunk)); + this.bufferSize = bufferSize; + this.maxBuffers = maxBuffers; + this.readable = readable; + this.outgoingHandler = outgoingHandler; + this.concurrency = concurrency; + this.encoding = encoding; + } + /** + * Start the scheduler, will return error when stream of any of the outgoingHandlers + * returns error. + * + */ + async do() { + return new Promise((resolve2, reject) => { + this.readable.on("data", (data) => { + data = typeof data === "string" ? Buffer.from(data, this.encoding) : data; + this.appendUnresolvedData(data); + if (!this.resolveData()) { + this.readable.pause(); + } + }); + this.readable.on("error", (err) => { + this.emitter.emit("error", err); + }); + this.readable.on("end", () => { + this.isStreamEnd = true; + this.emitter.emit("checkEnd"); + }); + this.emitter.on("error", (err) => { + this.isError = true; + this.readable.pause(); + reject(err); + }); + this.emitter.on("checkEnd", () => { + if (this.outgoing.length > 0) { + this.triggerOutgoingHandlers(); + return; + } + if (this.isStreamEnd && this.executingOutgoingHandlers === 0) { + if (this.unresolvedLength > 0 && this.unresolvedLength < this.bufferSize) { + const buffer = this.shiftBufferFromUnresolvedDataArray(); + this.outgoingHandler(() => buffer.getReadableStream(), buffer.size, this.offset).then(resolve2).catch(reject); + } else if (this.unresolvedLength >= this.bufferSize) { + return; + } else { + resolve2(); } - }; - const rejectCallback = () => { - cleanUp(); - reject(); - }; - const abortHandler = () => { - cleanUp(); - reject(ABORT_ERROR); - }; - this._readable.on("readable", readableCallback); - this._readable.once("error", rejectCallback); - this._readable.once("end", rejectCallback); - this._readable.once("close", rejectCallback); - if (options.abortSignal) { - options.abortSignal.addEventListener("abort", abortHandler); } }); - } + }); } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/index.js -var init_src8 = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-internal-avro/src/index.js"() { - init_AvroReader(); - init_AvroReadableFromStream(); - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js -import { Readable as Readable3 } from "stream"; -var BlobQuickQueryStream; -var init_BlobQuickQueryStream = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js"() { - init_src8(); - BlobQuickQueryStream = class extends Readable3 { /** - * Creates an instance of BlobQuickQueryStream. + * Insert a new data into unresolved array. * - * @param source - The current ReadableStream returned from getter - * @param options - + * @param data - */ - constructor(source, options = {}) { - super(); - this.avroPaused = true; - this.source = source; - this.onProgress = options.onProgress; - this.onError = options.onError; - this.avroReader = new AvroReader(new AvroReadableFromStream(this.source)); - this.avroIter = this.avroReader.parseObjects({ abortSignal: options.abortSignal }); + appendUnresolvedData(data) { + this.unresolvedDataArray.push(data); + this.unresolvedLength += data.length; } - _read() { - if (this.avroPaused) { - this.readInternal().catch((err) => { - this.emit("error", err); - }); + /** + * Try to shift a buffer with size in blockSize. The buffer returned may be less + * than blockSize when data in unresolvedDataArray is less than bufferSize. + * + */ + shiftBufferFromUnresolvedDataArray(buffer) { + if (!buffer) { + buffer = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); + } else { + buffer.fill(this.unresolvedDataArray, this.unresolvedLength); } + this.unresolvedLength -= buffer.size; + return buffer; } - async readInternal() { - this.avroPaused = false; - let avroNext; - do { - avroNext = await this.avroIter.next(); - if (avroNext.done) { - break; - } - const obj = avroNext.value; - const schema = obj.$schema; - if (typeof schema !== "string") { - throw Error("Missing schema in avro record."); - } - switch (schema) { - case "com.microsoft.azure.storage.queryBlobContents.resultData": - { - const data = obj.data; - if (data instanceof Uint8Array === false) { - throw Error("Invalid data in avro result record."); - } - if (!this.push(Buffer.from(data))) { - this.avroPaused = true; - } - } - break; - case "com.microsoft.azure.storage.queryBlobContents.progress": - { - const bytesScanned = obj.bytesScanned; - if (typeof bytesScanned !== "number") { - throw Error("Invalid bytesScanned in avro progress record."); - } - if (this.onProgress) { - this.onProgress({ loadedBytes: bytesScanned }); - } - } - break; - case "com.microsoft.azure.storage.queryBlobContents.end": - if (this.onProgress) { - const totalBytes = obj.totalBytes; - if (typeof totalBytes !== "number") { - throw Error("Invalid totalBytes in avro end record."); - } - this.onProgress({ loadedBytes: totalBytes }); - } - this.push(null); - break; - case "com.microsoft.azure.storage.queryBlobContents.error": - if (this.onError) { - const fatal2 = obj.fatal; - if (typeof fatal2 !== "boolean") { - throw Error("Invalid fatal in avro error record."); - } - const name2 = obj.name; - if (typeof name2 !== "string") { - throw Error("Invalid name in avro error record."); - } - const description = obj.description; - if (typeof description !== "string") { - throw Error("Invalid description in avro error record."); - } - const position = obj.position; - if (typeof position !== "number") { - throw Error("Invalid position in avro error record."); - } - this.onError({ - position, - name: name2, - isFatal: fatal2, - description - }); - } - break; - default: - throw Error(`Unknown schema ${schema} in avro progress record.`); + /** + * Resolve data in unresolvedDataArray. For every buffer with size in blockSize + * shifted, it will try to get (or allocate a buffer) from incoming, and fill it, + * then push it into outgoing to be handled by outgoing handler. + * + * Return false when available buffers in incoming are not enough, else true. + * + * @returns Return false when buffers in incoming are not enough, else true. + */ + resolveData() { + while (this.unresolvedLength >= this.bufferSize) { + let buffer; + if (this.incoming.length > 0) { + buffer = this.incoming.shift(); + this.shiftBufferFromUnresolvedDataArray(buffer); + } else { + if (this.numBuffers < this.maxBuffers) { + buffer = this.shiftBufferFromUnresolvedDataArray(); + this.numBuffers++; + } else { + return false; + } } - } while (!avroNext.done && !this.avroPaused); + this.outgoing.push(buffer); + this.triggerOutgoingHandlers(); + } + return true; } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobQueryResponse.js -var BlobQueryResponse; -var init_BlobQueryResponse = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobQueryResponse.js"() { - init_src5(); - init_BlobQuickQueryStream(); - BlobQueryResponse = class { /** - * Creates an instance of BlobQueryResponse. - * - * @param originalResponse - - * @param options - + * Try to trigger a outgoing handler for every buffer in outgoing. Stop when + * concurrency reaches. */ - constructor(originalResponse, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); + async triggerOutgoingHandlers() { + let buffer; + do { + if (this.executingOutgoingHandlers >= this.concurrency) { + return; + } + buffer = this.outgoing.shift(); + if (buffer) { + this.triggerOutgoingHandler(buffer); + } + } while (buffer); } /** - * Indicates that the service supports - * requests for partial file content. + * Trigger a outgoing handler for a buffer shifted from outgoing. * - * @readonly + * @param buffer - */ - get acceptRanges() { - return this.originalResponse.acceptRanges; + async triggerOutgoingHandler(buffer) { + const bufferLength = buffer.size; + this.executingOutgoingHandlers++; + this.offset += bufferLength; + try { + await this.outgoingHandler(() => buffer.getReadableStream(), bufferLength, this.offset - bufferLength); + } catch (err) { + this.emitter.emit("error", err); + return; + } + this.executingOutgoingHandlers--; + this.reuseBuffer(buffer); + this.emitter.emit("checkEnd"); } /** - * Returns if it was previously specified - * for the file. + * Return buffer used by outgoing handler into incoming. * - * @readonly + * @param buffer - */ - get cacheControl() { - return this.originalResponse.cacheControl; + reuseBuffer(buffer) { + this.incoming.push(buffer); + if (!this.isError && this.resolveData() && !this.isStreamEnd) { + this.readable.resume(); + } + } + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-common/src/index.js +var init_src10 = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-common/src/index.js"() { + init_BufferScheduler(); + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/utils.node.js +import * as fs from "fs"; +import * as util2 from "util"; +async function streamToBuffer(stream, buffer, offset, end, encoding) { + let pos = 0; + const count = end - offset; + return new Promise((resolve2, reject) => { + const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); + stream.on("readable", () => { + if (pos >= count) { + clearTimeout(timeout); + resolve2(); + return; + } + let chunk = stream.read(); + if (!chunk) { + return; + } + if (typeof chunk === "string") { + chunk = Buffer.from(chunk, encoding); + } + const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; + buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); + pos += chunkLength; + }); + stream.on("end", () => { + clearTimeout(timeout); + if (pos < count) { + reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); + } + resolve2(); + }); + stream.on("error", (msg) => { + clearTimeout(timeout); + reject(msg); + }); + }); +} +async function streamToBuffer2(stream, buffer, encoding) { + let pos = 0; + const bufferSize = buffer.length; + return new Promise((resolve2, reject) => { + stream.on("readable", () => { + let chunk = stream.read(); + if (!chunk) { + return; + } + if (typeof chunk === "string") { + chunk = Buffer.from(chunk, encoding); + } + if (pos + chunk.length > bufferSize) { + reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`)); + return; + } + buffer.fill(chunk, pos, pos + chunk.length); + pos += chunk.length; + }); + stream.on("end", () => { + resolve2(pos); + }); + stream.on("error", reject); + }); +} +async function readStreamToLocalFile(rs, file) { + return new Promise((resolve2, reject) => { + const ws = fs.createWriteStream(file); + rs.on("error", (err) => { + reject(err); + }); + ws.on("error", (err) => { + reject(err); + }); + ws.on("close", resolve2); + rs.pipe(ws); + }); +} +var fsStat, fsCreateReadStream; +var init_utils_node = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/utils.node.js"() { + init_constants2(); + fsStat = util2.promisify(fs.stat); + fsCreateReadStream = fs.createReadStream; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/Clients.js +var BlobClient, AppendBlobClient, BlockBlobClient, PageBlobClient; +var init_Clients = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/Clients.js"() { + init_tslib_es6(); + init_src5(); + init_src4(); + init_BlobDownloadResponse(); + init_BlobQueryResponse(); + init_AnonymousCredential(); + init_StorageSharedKeyCredential(); + init_operations(); + init_models3(); + init_PageBlobRangeResponse(); + init_Pipeline(); + init_BlobStartCopyFromUrlPoller(); + init_Range(); + init_StorageClient(); + init_Batch(); + init_src10(); + init_constants2(); + init_tracing(); + init_utils_common(); + init_utils_node(); + init_BlobSASSignatureValues(); + init_BlobLeaseClient(); + BlobClient = class _BlobClient extends StorageClient { + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { + options = options || {}; + let pipeline; + let url2; + if (isPipelineLike(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; + pipeline = credentialOrPipelineOrContainerName; + } else if (isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || isTokenCredential(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; + options = blobNameOrOptions; + pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { + url2 = urlOrConnectionString; + if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { + options = blobNameOrOptions; + } + pipeline = newPipeline(new AnonymousCredential(), options); + } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { + const containerName = credentialOrPipelineOrContainerName; + const blobName = blobNameOrOptions; + const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + if (extractedCreds.kind === "AccountConnString") { + if (isNode) { + const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (!options.proxyOptions) { + options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + } + pipeline = newPipeline(sharedKeyCredential, options); + } else { + throw new Error("Account connection string is only supported in Node.js environment"); + } + } else if (extractedCreds.kind === "SASConnString") { + url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = newPipeline(new AnonymousCredential(), options); + } else { + throw new Error("Connection string must be either an Account connection string or a SAS connection string"); + } + } else { + throw new Error("Expecting non-empty strings for containerName and blobName parameters"); + } + super(url2, pipeline); + ({ blobName: this._name, containerName: this._containerName } = this.getBlobAndContainerNamesFromUrl()); + this.blobContext = new Blob3(this.storageClientContext); + this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT); + this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID); } /** - * Returns the value that was specified - * for the 'x-ms-content-disposition' header and specifies how to process the - * response. - * - * @readonly + * The name of the blob. */ - get contentDisposition() { - return this.originalResponse.contentDisposition; + get name() { + return this._name; } /** - * Returns the value that was specified - * for the Content-Encoding request header. - * - * @readonly + * The name of the storage container the blob is associated with. */ - get contentEncoding() { - return this.originalResponse.contentEncoding; + get containerName() { + return this._containerName; } /** - * Returns the value that was specified - * for the Content-Language request header. + * Creates a new BlobClient object identical to the source but with the specified snapshot timestamp. + * Provide "" will remove the snapshot and return a Client to the base blob. * - * @readonly + * @param snapshot - The snapshot timestamp. + * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp */ - get contentLanguage() { - return this.originalResponse.contentLanguage; + withSnapshot(snapshot2) { + return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); } /** - * The current sequence number for a - * page blob. This header is not returned for block blobs or append blobs. + * Creates a new BlobClient object pointing to a version of this blob. + * Provide "" will remove the versionId and return a Client to the base blob. * - * @readonly + * @param versionId - The versionId. + * @returns A new BlobClient object pointing to the version of this blob. */ - get blobSequenceNumber() { - return this.originalResponse.blobSequenceNumber; + withVersion(versionId2) { + return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId2.length === 0 ? void 0 : versionId2), this.pipeline); } /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * Creates a AppendBlobClient object. * - * @readonly */ - get blobType() { - return this.originalResponse.blobType; + getAppendBlobClient() { + return new AppendBlobClient(this.url, this.pipeline); } /** - * The number of bytes present in the - * response body. + * Creates a BlockBlobClient object. * - * @readonly */ - get contentLength() { - return this.originalResponse.contentLength; + getBlockBlobClient() { + return new BlockBlobClient(this.url, this.pipeline); } /** - * If the file has an MD5 hash and the - * request is to read the full file, this response header is returned so that - * the client can check for message content integrity. If the request is to - * read a specified range and the 'x-ms-range-get-content-md5' is set to - * true, then the request returns an MD5 hash for the range, as long as the - * range size is less than or equal to 4 MB. If neither of these sets of - * conditions is true, then no value is returned for the 'Content-MD5' - * header. + * Creates a PageBlobClient object. * - * @readonly */ - get contentMD5() { - return this.originalResponse.contentMD5; + getPageBlobClient() { + return new PageBlobClient(this.url, this.pipeline); } /** - * Indicates the range of bytes returned if - * the client requested a subset of the file by setting the Range request - * header. + * Reads or downloads a blob from the system, including its metadata and properties. + * You can also call Get Blob to read a snapshot. * - * @readonly - */ - get contentRange() { - return this.originalResponse.contentRange; - } - /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' + * * In Node.js, data returns in a Readable stream readableStreamBody + * * In browsers, data returns in a promise blobBody * - * @readonly - */ - get contentType() { - return this.originalResponse.contentType; - } - /** - * Conclusion time of the last attempted - * Copy File operation where this file was the destination file. This value - * can specify the time of a completed, aborted, or failed copy attempt. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob * - * @readonly - */ - get copyCompletedOn() { - return void 0; - } - /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. + * @param offset - From which position of the blob to download, greater than or equal to 0 + * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined + * @param options - Optional options to Blob Download operation. * - * @readonly - */ - get copyId() { - return this.originalResponse.copyId; - } - /** - * Contains the number of bytes copied and - * the total bytes in the source in the last attempted Copy File operation - * where this file was the destination file. Can show between 0 and - * Content-Length bytes copied. * - * @readonly - */ - get copyProgress() { - return this.originalResponse.copyProgress; - } - /** - * URL up to 2KB in length that specifies the - * source file used in the last attempted Copy File operation where this file - * was the destination file. + * Example usage (Node.js): * - * @readonly - */ - get copySource() { - return this.originalResponse.copySource; - } - /** - * State of the copy operation - * identified by 'x-ms-copy-id'. Possible values include: 'pending', - * 'success', 'aborted', 'failed' + * ```js + * // Download and convert a blob to a string + * const downloadBlockBlobResponse = await blobClient.download(); + * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); + * console.log("Downloaded blob content:", downloaded.toString()); * - * @readonly - */ - get copyStatus() { - return this.originalResponse.copyStatus; - } - /** - * Only appears when - * x-ms-copy-status is failed or pending. Describes cause of fatal or - * non-fatal copy operation failure. + * async function streamToBuffer(readableStream) { + * return new Promise((resolve, reject) => { + * const chunks = []; + * readableStream.on("data", (data) => { + * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); + * }); + * readableStream.on("end", () => { + * resolve(Buffer.concat(chunks)); + * }); + * readableStream.on("error", reject); + * }); + * } + * ``` * - * @readonly - */ - get copyStatusDescription() { - return this.originalResponse.copyStatusDescription; - } - /** - * When a blob is leased, - * specifies whether the lease is of infinite or fixed duration. Possible - * values include: 'infinite', 'fixed'. + * Example usage (browser): * - * @readonly - */ - get leaseDuration() { - return this.originalResponse.leaseDuration; - } - /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * ```js + * // Download and convert a blob to a string + * const downloadBlockBlobResponse = await blobClient.download(); + * const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody); + * console.log( + * "Downloaded blob content", + * downloaded + * ); * - * @readonly + * async function blobToString(blob: Blob): Promise { + * const fileReader = new FileReader(); + * return new Promise((resolve, reject) => { + * fileReader.onloadend = (ev: any) => { + * resolve(ev.target!.result); + * }; + * fileReader.onerror = reject; + * fileReader.readAsText(blob); + * }); + * } + * ``` */ - get leaseState() { - return this.originalResponse.leaseState; + async download(offset = 0, count, options = {}) { + var _a2; + options.conditions = options.conditions || {}; + options.conditions = options.conditions || {}; + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + const { span, updatedOptions } = createSpan2("BlobClient-download", options); + try { + const res = await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), requestOptions: { + onDownloadProgress: isNode ? void 0 : options.onProgress + // for Node.js, progress is reported by RetriableReadableStream + }, range: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), rangeGetContentMD5: options.rangeGetContentMD5, rangeGetContentCRC64: options.rangeGetContentCrc64, snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions))); + const wrappedRes = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); + if (!isNode) { + return wrappedRes; + } + if (options.maxRetryRequests === void 0 || options.maxRetryRequests < 0) { + options.maxRetryRequests = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; + } + if (res.contentLength === void 0) { + throw new RangeError(`File download response doesn't contain valid content length header`); + } + if (!res.etag) { + throw new RangeError(`File download response doesn't contain valid etag header`); + } + return new BlobDownloadResponse(wrappedRes, async (start) => { + var _a3; + const updatedDownloadOptions = { + leaseAccessConditions: options.conditions, + modifiedAccessConditions: { + ifMatch: options.conditions.ifMatch || res.etag, + ifModifiedSince: options.conditions.ifModifiedSince, + ifNoneMatch: options.conditions.ifNoneMatch, + ifUnmodifiedSince: options.conditions.ifUnmodifiedSince, + ifTags: (_a3 = options.conditions) === null || _a3 === void 0 ? void 0 : _a3.tagConditions + }, + range: rangeToString({ + count: offset + res.contentLength - start, + offset: start + }), + rangeGetContentMD5: options.rangeGetContentMD5, + rangeGetContentCRC64: options.rangeGetContentCrc64, + snapshot: options.snapshot, + cpkInfo: options.customerProvidedKey + }; + return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody; + }, offset, res.contentLength, { + maxRetryRequests: options.maxRetryRequests, + onProgress: options.onProgress + }); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } } /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. + * Returns true if the Azure blob resource represented by this client exists; false otherwise. * - * @readonly - */ - get leaseStatus() { - return this.originalResponse.leaseStatus; - } - /** - * A UTC date/time value generated by the service that - * indicates the time at which the response was initiated. + * NOTE: use this function with care since an existing blob might be deleted by other clients or + * applications. Vice versa new blobs might be added by other clients or applications after this + * function completes. * - * @readonly + * @param options - options to Exists operation. */ - get date() { - return this.originalResponse.date; + async exists(options = {}) { + const { span, updatedOptions } = createSpan2("BlobClient-exists", options); + try { + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + await this.getProperties({ + abortSignal: options.abortSignal, + customerProvidedKey: options.customerProvidedKey, + conditions: options.conditions, + tracingOptions: updatedOptions.tracingOptions + }); + return true; + } catch (e2) { + if (e2.statusCode === 404) { + return false; + } else if (e2.statusCode === 409 && (e2.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg || e2.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) { + return true; + } + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } } /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. + * Returns all user-defined metadata, standard HTTP properties, and system properties + * for the blob. It does not return the content of the blob. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties * - * @readonly - */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; - } - /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. + * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if + * they originally contained uppercase characters. This differs from the metadata keys returned by + * the methods of {@link ContainerClient} that list blobs using the `includeMetadata` option, which + * will retain their original casing. * - * @readonly + * @param options - Optional options to Get Properties operation. */ - get etag() { - return this.originalResponse.etag; + async getProperties(options = {}) { + var _a2; + const { span, updatedOptions } = createSpan2("BlobClient-getProperties", options); + try { + options.conditions = options.conditions || {}; + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + const res = await this.blobContext.getProperties(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions))); + return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } } /** - * The error code. + * Marks the specified blob or snapshot for deletion. The blob is later deleted + * during garbage collection. Note that in order to delete a blob, you must delete + * all of its snapshots. You can delete both at the same time with the Delete + * Blob operation. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob * - * @readonly + * @param options - Optional options to Blob Delete operation. */ - get errorCode() { - return this.originalResponse.errorCode; + async delete(options = {}) { + var _a2; + const { span, updatedOptions } = createSpan2("BlobClient-delete", options); + options.conditions = options.conditions || {}; + try { + return await this.blobContext.delete(Object.assign({ abortSignal: options.abortSignal, deleteSnapshots: options.deleteSnapshots, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } } /** - * The value of this header is set to - * true if the file data and application metadata are completely encrypted - * using the specified algorithm. Otherwise, the value is set to false (when - * the file is unencrypted, or if only parts of the file/application metadata - * are encrypted). + * Marks the specified blob or snapshot for deletion if it exists. The blob is later deleted + * during garbage collection. Note that in order to delete a blob, you must delete + * all of its snapshots. You can delete both at the same time with the Delete + * Blob operation. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob * - * @readonly + * @param options - Optional options to Blob Delete operation. */ - get isServerEncrypted() { - return this.originalResponse.isServerEncrypted; + async deleteIfExists(options = {}) { + var _a2, _b2; + const { span, updatedOptions } = createSpan2("BlobClient-deleteIfExists", options); + try { + const res = await this.delete(updatedOptions); + return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + } catch (e2) { + if (((_a2 = e2.details) === null || _a2 === void 0 ? void 0 : _a2.errorCode) === "BlobNotFound") { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: "Expected exception when deleting a blob or snapshot only if it exists." + }); + return Object.assign(Object.assign({ succeeded: false }, (_b2 = e2.response) === null || _b2 === void 0 ? void 0 : _b2.parsedHeaders), { _response: e2.response }); + } + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } } /** - * If the blob has a MD5 hash, and if - * request contains range header (Range or x-ms-range), this response header - * is returned with the value of the whole blob's MD5 value. This value may - * or may not be equal to the value returned in Content-MD5 header, with the - * latter calculated from the requested range. + * Restores the contents and metadata of soft deleted blob and any associated + * soft deleted snapshots. Undelete Blob is supported only on version 2017-07-29 + * or later. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob * - * @readonly + * @param options - Optional options to Blob Undelete operation. */ - get blobContentMD5() { - return this.originalResponse.blobContentMD5; + async undelete(options = {}) { + const { span, updatedOptions } = createSpan2("BlobClient-undelete", options); + try { + return await this.blobContext.undelete(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } } /** - * Returns the date and time the file was last - * modified. Any operation that modifies the file or its properties updates - * the last modified time. + * Sets system properties on the blob. * - * @readonly - */ - get lastModified() { - return this.originalResponse.lastModified; - } - /** - * A name-value pair - * to associate with a file storage object. + * If no value provided, or no value provided for the specified blob HTTP headers, + * these blob HTTP headers without a value will be cleared. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties * - * @readonly + * @param blobHTTPHeaders - If no value provided, or no value provided for + * the specified blob HTTP headers, these blob HTTP + * headers without a value will be cleared. + * A common header to set is `blobContentType` + * enabling the browser to provide functionality + * based on file type. + * @param options - Optional options to Blob Set HTTP Headers operation. */ - get metadata() { - return this.originalResponse.metadata; + async setHTTPHeaders(blobHTTPHeaders, options = {}) { + var _a2; + const { span, updatedOptions } = createSpan2("BlobClient-setHTTPHeaders", options); + options.conditions = options.conditions || {}; + try { + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + return await this.blobContext.setHttpHeaders(Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } } /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. + * Sets user-defined metadata for the specified blob as one or more name-value pairs. * - * @readonly - */ - get requestId() { - return this.originalResponse.requestId; - } - /** - * If a client request id header is sent in the request, this header will be present in the - * response with the same value. + * If no option provided, or no metadata defined in the parameter, the blob + * metadata will be removed. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata * - * @readonly + * @param metadata - Replace existing metadata with this value. + * If no value provided the existing metadata will be removed. + * @param options - Optional options to Set Metadata operation. */ - get clientRequestId() { - return this.originalResponse.clientRequestId; + async setMetadata(metadata3, options = {}) { + var _a2; + const { span, updatedOptions } = createSpan2("BlobClient-setMetadata", options); + options.conditions = options.conditions || {}; + try { + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + return await this.blobContext.setMetadata(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: metadata3, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } } /** - * Indicates the version of the File service used - * to execute the request. + * Sets tags on the underlying blob. + * A blob can have up to 10 tags. Tag keys must be between 1 and 128 characters. Tag values must be between 0 and 256 characters. + * Valid tag key and value characters include lower and upper case letters, digits (0-9), + * space (' '), plus ('+'), minus ('-'), period ('.'), foward slash ('/'), colon (':'), equals ('='), and underscore ('_'). * - * @readonly + * @param tags - + * @param options - */ - get version() { - return this.originalResponse.version; + async setTags(tags2, options = {}) { + var _a2; + const { span, updatedOptions } = createSpan2("BlobClient-setTags", options); + try { + return await this.blobContext.setTags(Object.assign(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)), { tags: toBlobTags(tags2) })); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } } /** - * The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned - * when the blob was encrypted with a customer-provided key. + * Gets the tags associated with the underlying blob. * - * @readonly + * @param options - */ - get encryptionKeySha256() { - return this.originalResponse.encryptionKeySha256; + async getTags(options = {}) { + var _a2; + const { span, updatedOptions } = createSpan2("BlobClient-getTags", options); + try { + const response = await this.blobContext.getTags(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); + const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); + return wrappedResponse; + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } } /** - * If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to - * true, then the request returns a crc64 for the range, as long as the range size is less than - * or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is - * specified in the same request, it will fail with 400(Bad Request) + * Get a {@link BlobLeaseClient} that manages leases on the blob. + * + * @param proposeLeaseId - Initial proposed lease Id. + * @returns A new BlobLeaseClient object for managing leases on the blob. */ - get contentCrc64() { - return this.originalResponse.contentCrc64; + getBlobLeaseClient(proposeLeaseId) { + return new BlobLeaseClient(this, proposeLeaseId); } /** - * The response body as a browser Blob. - * Always undefined in node.js. + * Creates a read-only snapshot of a blob. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-blob * - * @readonly + * @param options - Optional options to the Blob Create Snapshot operation. */ - get blobBody() { - return void 0; + async createSnapshot(options = {}) { + var _a2; + const { span, updatedOptions } = createSpan2("BlobClient-createSnapshot", options); + options.conditions = options.conditions || {}; + try { + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + return await this.blobContext.createSnapshot(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } } /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. + * Asynchronously copies a blob to a destination within the storage account. + * This method returns a long running operation poller that allows you to wait + * indefinitely until the copy is completed. + * You can also cancel a copy before it is completed by calling `cancelOperation` on the poller. + * Note that the onProgress callback will not be invoked if the operation completes in the first + * request, and attempting to cancel a completed copy will result in an error being thrown. * - * It will parse avor data returned by blob query. + * In version 2012-02-12 and later, the source for a Copy Blob operation can be + * a committed blob in any Azure storage account. + * Beginning with version 2015-02-21, the source for a Copy Blob operation can be + * an Azure file in any Azure storage account. + * Only storage accounts created on or after June 7th, 2012 allow the Copy Blob + * operation to copy from another storage account. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob * - * @readonly - */ - get readableStreamBody() { - return isNode ? this.blobDownloadStream : void 0; - } - /** - * The HTTP response. - */ - get _response() { - return this.originalResponse._response; - } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/models.js -function toAccessTier(tier2) { - if (tier2 === void 0) { - return void 0; - } - return tier2; -} -function ensureCpkIfSpecified(cpk, isHttps) { - if (cpk && !isHttps) { - throw new RangeError("Customer-provided encryption key must be used over HTTPS."); - } - if (cpk && !cpk.encryptionAlgorithm) { - cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; - } -} -var BlockBlobTier, PremiumPageBlobTier, StorageBlobAudience; -var init_models3 = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/models.js"() { - init_constants2(); - (function(BlockBlobTier2) { - BlockBlobTier2["Hot"] = "Hot"; - BlockBlobTier2["Cool"] = "Cool"; - BlockBlobTier2["Cold"] = "Cold"; - BlockBlobTier2["Archive"] = "Archive"; - })(BlockBlobTier || (BlockBlobTier = {})); - (function(PremiumPageBlobTier2) { - PremiumPageBlobTier2["P4"] = "P4"; - PremiumPageBlobTier2["P6"] = "P6"; - PremiumPageBlobTier2["P10"] = "P10"; - PremiumPageBlobTier2["P15"] = "P15"; - PremiumPageBlobTier2["P20"] = "P20"; - PremiumPageBlobTier2["P30"] = "P30"; - PremiumPageBlobTier2["P40"] = "P40"; - PremiumPageBlobTier2["P50"] = "P50"; - PremiumPageBlobTier2["P60"] = "P60"; - PremiumPageBlobTier2["P70"] = "P70"; - PremiumPageBlobTier2["P80"] = "P80"; - })(PremiumPageBlobTier || (PremiumPageBlobTier = {})); - (function(StorageBlobAudience2) { - StorageBlobAudience2["StorageOAuthScopes"] = "https://storage.azure.com/.default"; - StorageBlobAudience2["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; - })(StorageBlobAudience || (StorageBlobAudience = {})); - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/PageBlobRangeResponse.js -function rangeResponseFromModel(response) { - const pageRange = (response._response.parsedBody.pageRange || []).map((x2) => ({ - offset: x2.start, - count: x2.end - x2.start - })); - const clearRange = (response._response.parsedBody.clearRange || []).map((x2) => ({ - offset: x2.start, - count: x2.end - x2.start - })); - return Object.assign(Object.assign({}, response), { - pageRange, - clearRange, - _response: Object.assign(Object.assign({}, response._response), { parsedBody: { - pageRange, - clearRange - } }) - }); -} -var init_PageBlobRangeResponse = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/PageBlobRangeResponse.js"() { - } -}); - -// node_modules/@azure/core-lro/dist-esm/src/legacy/poller.js -var PollerStoppedError, PollerCancelledError, Poller; -var init_poller = __esm({ - "node_modules/@azure/core-lro/dist-esm/src/legacy/poller.js"() { - PollerStoppedError = class _PollerStoppedError extends Error { - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, _PollerStoppedError.prototype); - } - }; - PollerCancelledError = class _PollerCancelledError extends Error { - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, _PollerCancelledError.prototype); - } - }; - Poller = class { - /** - * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. + * Example using automatic polling: * - * When writing an implementation of a Poller, this implementation needs to deal with the initialization - * of any custom state beyond the basic definition of the poller. The basic poller assumes that the poller's - * operation has already been defined, at least its basic properties. The code below shows how to approach - * the definition of the constructor of a new custom poller. + * ```js + * const copyPoller = await blobClient.beginCopyFromURL('url'); + * const result = await copyPoller.pollUntilDone(); + * ``` * - * ```ts - * export class MyPoller extends Poller { - * constructor({ - * // Anything you might need outside of the basics - * }) { - * let state: MyOperationState = { - * privateProperty: private, - * publicProperty: public, - * }; + * Example using manual polling: * - * const operation = { - * state, - * update, - * cancel, - * toString - * } + * ```js + * const copyPoller = await blobClient.beginCopyFromURL('url'); + * while (!poller.isDone()) { + * await poller.poll(); + * } + * const result = copyPoller.getResult(); + * ``` * - * // Sending the operation to the parent's constructor. - * super(operation); + * Example using progress updates: * - * // You can assign more local properties here. + * ```js + * const copyPoller = await blobClient.beginCopyFromURL('url', { + * onProgress(state) { + * console.log(`Progress: ${state.copyProgress}`); * } - * } + * }); + * const result = await copyPoller.pollUntilDone(); * ``` * - * Inside of this constructor, a new promise is created. This will be used to - * tell the user when the poller finishes (see `pollUntilDone()`). The promise's - * resolve and reject methods are also used internally to control when to resolve - * or reject anyone waiting for the poller to finish. + * Example using a changing polling interval (default 15 seconds): * - * The constructor of a custom implementation of a poller is where any serialized version of - * a previous poller's operation should be deserialized into the operation sent to the - * base constructor. For example: + * ```js + * const copyPoller = await blobClient.beginCopyFromURL('url', { + * intervalInMs: 1000 // poll blob every 1 second for copy progress + * }); + * const result = await copyPoller.pollUntilDone(); + * ``` * - * ```ts - * export class MyPoller extends Poller { - * constructor( - * baseOperation: string | undefined - * ) { - * let state: MyOperationState = {}; - * if (baseOperation) { - * state = { - * ...JSON.parse(baseOperation).state, - * ...state - * }; - * } - * const operation = { - * state, - * // ... - * } - * super(operation); + * Example using copy cancellation: + * + * ```js + * const copyPoller = await blobClient.beginCopyFromURL('url'); + * // cancel operation after starting it. + * try { + * await copyPoller.cancelOperation(); + * // calls to get the result now throw PollerCancelledError + * await copyPoller.getResult(); + * } catch (err) { + * if (err.name === 'PollerCancelledError') { + * console.log('The copy was cancelled.'); * } * } * ``` * - * @param operation - Must contain the basic properties of `PollOperation`. + * @param copySource - url to the source Azure Blob/File. + * @param options - Optional options to the Blob Start Copy From URL operation. */ - constructor(operation) { - this.resolveOnUnsuccessful = false; - this.stopped = true; - this.pollProgressCallbacks = []; - this.operation = operation; - this.promise = new Promise((resolve2, reject) => { - this.resolve = resolve2; - this.reject = reject; - }); - this.promise.catch(() => { + async beginCopyFromURL(copySource2, options = {}) { + const client = { + abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), + getProperties: (...args) => this.getProperties(...args), + startCopyFromURL: (...args) => this.startCopyFromURL(...args) + }; + const poller = new BlobBeginCopyFromUrlPoller({ + blobClient: client, + copySource: copySource2, + intervalInMs: options.intervalInMs, + onProgress: options.onProgress, + resumeFrom: options.resumeFrom, + startCopyFromURLOptions: options }); + await poller.poll(); + return poller; } /** - * Starts a loop that will break only if the poller is done - * or if the poller is stopped. + * Aborts a pending asynchronous Copy Blob operation, and leaves a destination blob with zero + * length and full metadata. Version 2012-02-12 and newer. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob + * + * @param copyId - Id of the Copy From URL operation. + * @param options - Optional options to the Blob Abort Copy From URL operation. */ - async startPolling(pollOptions = {}) { - if (this.stopped) { - this.stopped = false; - } - while (!this.isStopped() && !this.isDone()) { - await this.poll(pollOptions); - await this.delay(); + async abortCopyFromURL(copyId2, options = {}) { + const { span, updatedOptions } = createSpan2("BlobClient-abortCopyFromURL", options); + try { + return await this.blobContext.abortCopyFromURL(copyId2, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } } /** - * pollOnce does one polling, by calling to the update method of the underlying - * poll operation to make any relevant change effective. - * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * The synchronous Copy From URL operation copies a blob or an internet resource to a new blob. It will not + * return a response until the copy is complete. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url * - * @param options - Optional properties passed to the operation's update method. + * @param copySource - The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication + * @param options - */ - async pollOnce(options = {}) { - if (!this.isDone()) { - this.operation = await this.operation.update({ - abortSignal: options.abortSignal, - fireProgress: this.fireProgress.bind(this) + async syncCopyFromURL(copySource2, options = {}) { + var _a2, _b2, _c2; + const { span, updatedOptions } = createSpan2("BlobClient-syncCopyFromURL", options); + options.conditions = options.conditions || {}; + options.sourceConditions = options.sourceConditions || {}; + try { + return await this.blobContext.copyFromURL(copySource2, Object.assign({ abortSignal: options.abortSignal, metadata: options.metadata, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), sourceModifiedAccessConditions: { + sourceIfMatch: options.sourceConditions.ifMatch, + sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince + }, sourceContentMD5: options.sourceContentMD5, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), immutabilityPolicyExpiry: (_b2 = options.immutabilityPolicy) === null || _b2 === void 0 ? void 0 : _b2.expiriesOn, immutabilityPolicyMode: (_c2 = options.immutabilityPolicy) === null || _c2 === void 0 ? void 0 : _c2.policyMode, legalHold: options.legalHold, encryptionScope: options.encryptionScope, copySourceTags: options.copySourceTags }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message }); + throw e2; + } finally { + span.end(); } - this.processUpdatedState(); } /** - * fireProgress calls the functions passed in via onProgress the method of the poller. - * - * It loops over all of the callbacks received from onProgress, and executes them, sending them - * the current operation state. + * Sets the tier on a blob. The operation is allowed on a page blob in a premium + * storage account and on a block blob in a blob storage account (locally redundant + * storage only). A premium page blob's tier determines the allowed size, IOPS, + * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive + * storage type. This operation does not update the blob's ETag. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier * - * @param state - The current operation state. + * @param tier - The tier to be set on the blob. Valid values are Hot, Cool, or Archive. + * @param options - Optional options to the Blob Set Tier operation. */ - fireProgress(state) { - for (const callback of this.pollProgressCallbacks) { - callback(state); + async setAccessTier(tier2, options = {}) { + var _a2; + const { span, updatedOptions } = createSpan2("BlobClient-setAccessTier", options); + try { + return await this.blobContext.setTier(toAccessTier(tier2), Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), rehydratePriority: options.rehydratePriority }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } + } + async downloadToBuffer(param1, param2, param3, param4 = {}) { + let buffer; + let offset = 0; + let count = 0; + let options = param4; + if (param1 instanceof Buffer) { + buffer = param1; + offset = param2 || 0; + count = typeof param3 === "number" ? param3 : 0; + } else { + offset = typeof param1 === "number" ? param1 : 0; + count = typeof param2 === "number" ? param2 : 0; + options = param3 || {}; + } + const { span, updatedOptions } = createSpan2("BlobClient-downloadToBuffer", options); + try { + if (!options.blockSize) { + options.blockSize = 0; + } + if (options.blockSize < 0) { + throw new RangeError("blockSize option must be >= 0"); + } + if (options.blockSize === 0) { + options.blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + } + if (offset < 0) { + throw new RangeError("offset option must be >= 0"); + } + if (count && count <= 0) { + throw new RangeError("count option must be greater than 0"); + } + if (!options.conditions) { + options.conditions = {}; + } + if (!count) { + const response = await this.getProperties(Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) })); + count = response.contentLength - offset; + if (count < 0) { + throw new RangeError(`offset ${offset} shouldn't be larger than blob size ${response.contentLength}`); + } + } + if (!buffer) { + try { + buffer = Buffer.alloc(count); + } catch (error) { + throw new Error(`Unable to allocate the buffer of size: ${count}(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile". ${error.message}`); + } + } + if (buffer.length < count) { + throw new RangeError(`The buffer's size should be equal to or larger than the request count of bytes: ${count}`); + } + let transferProgress = 0; + const batch = new Batch(options.concurrency); + for (let off = offset; off < offset + count; off = off + options.blockSize) { + batch.addOperation(async () => { + let chunkEnd = offset + count; + if (off + options.blockSize < chunkEnd) { + chunkEnd = off + options.blockSize; + } + const response = await this.download(off, chunkEnd - off, { + abortSignal: options.abortSignal, + conditions: options.conditions, + maxRetryRequests: options.maxRetryRequestsPerBlock, + customerProvidedKey: options.customerProvidedKey, + tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) + }); + const stream = response.readableStreamBody; + await streamToBuffer(stream, buffer, off - offset, chunkEnd - offset); + transferProgress += chunkEnd - off; + if (options.onProgress) { + options.onProgress({ loadedBytes: transferProgress }); + } + }); + } + await batch.do(); + return buffer; + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } } /** - * Invokes the underlying operation's cancel method. - */ - async cancelOnce(options = {}) { - this.operation = await this.operation.cancel(options); - } - /** - * Returns a promise that will resolve once a single polling request finishes. - * It does this by calling the update method of the Poller's operation. + * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * Downloads an Azure Blob to a local file. + * Fails if the the given file path already exits. + * Offset and count are optional, pass 0 and undefined respectively to download the entire blob. * - * @param options - Optional properties passed to the operation's update method. + * @param filePath - + * @param offset - From which position of the block blob to download. + * @param count - How much data to be downloaded. Will download to the end when passing undefined. + * @param options - Options to Blob download options. + * @returns The response data for blob download operation, + * but with readableStreamBody set to undefined since its + * content is already read and written into a local file + * at the specified path. */ - poll(options = {}) { - if (!this.pollOncePromise) { - this.pollOncePromise = this.pollOnce(options); - const clearPollOncePromise = () => { - this.pollOncePromise = void 0; - }; - this.pollOncePromise.then(clearPollOncePromise, clearPollOncePromise).catch(this.reject); + async downloadToFile(filePath, offset = 0, count, options = {}) { + const { span, updatedOptions } = createSpan2("BlobClient-downloadToFile", options); + try { + const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) })); + if (response.readableStreamBody) { + await readStreamToLocalFile(response.readableStreamBody, filePath); + } + response.blobDownloadStream = void 0; + return response; + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } - return this.pollOncePromise; } - processUpdatedState() { - if (this.operation.state.error) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - this.reject(this.operation.state.error); - throw this.operation.state.error; + getBlobAndContainerNamesFromUrl() { + let containerName; + let blobName; + try { + const parsedUrl = URLBuilder.parse(this.url); + if (parsedUrl.getHost().split(".")[1] === "blob") { + const pathComponents = parsedUrl.getPath().match("/([^/]*)(/(.*))?"); + containerName = pathComponents[1]; + blobName = pathComponents[3]; + } else if (isIpEndpointStyle(parsedUrl)) { + const pathComponents = parsedUrl.getPath().match("/([^/]*)/([^/]*)(/(.*))?"); + containerName = pathComponents[2]; + blobName = pathComponents[4]; + } else { + const pathComponents = parsedUrl.getPath().match("/([^/]*)(/(.*))?"); + containerName = pathComponents[1]; + blobName = pathComponents[3]; } - } - if (this.operation.state.isCancelled) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - const error = new PollerCancelledError("Operation was canceled"); - this.reject(error); - throw error; + containerName = decodeURIComponent(containerName); + blobName = decodeURIComponent(blobName); + blobName = blobName.replace(/\\/g, "/"); + if (!containerName) { + throw new Error("Provided containerName is invalid."); } - } - if (this.isDone() && this.resolve) { - this.resolve(this.getResult()); + return { blobName, containerName }; + } catch (error) { + throw new Error("Unable to extract blobName and containerName with provided information."); } } /** - * Returns a promise that will resolve once the underlying operation is completed. + * Asynchronously copies a blob to a destination within the storage account. + * In version 2012-02-12 and later, the source for a Copy Blob operation can be + * a committed blob in any Azure storage account. + * Beginning with version 2015-02-21, the source for a Copy Blob operation can be + * an Azure file in any Azure storage account. + * Only storage accounts created on or after June 7th, 2012 allow the Copy Blob + * operation to copy from another storage account. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * + * @param copySource - url to the source Azure Blob/File. + * @param options - Optional options to the Blob Start Copy From URL operation. */ - async pollUntilDone(pollOptions = {}) { - if (this.stopped) { - this.startPolling(pollOptions).catch(this.reject); + async startCopyFromURL(copySource2, options = {}) { + var _a2, _b2, _c2; + const { span, updatedOptions } = createSpan2("BlobClient-startCopyFromURL", options); + options.conditions = options.conditions || {}; + options.sourceConditions = options.sourceConditions || {}; + try { + return await this.blobContext.startCopyFromURL(copySource2, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), sourceModifiedAccessConditions: { + sourceIfMatch: options.sourceConditions.ifMatch, + sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, + sourceIfTags: options.sourceConditions.tagConditions + }, immutabilityPolicyExpiry: (_b2 = options.immutabilityPolicy) === null || _b2 === void 0 ? void 0 : _b2.expiriesOn, immutabilityPolicyMode: (_c2 = options.immutabilityPolicy) === null || _c2 === void 0 ? void 0 : _c2.policyMode, legalHold: options.legalHold, rehydratePriority: options.rehydratePriority, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), sealBlob: options.sealBlob }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } - this.processUpdatedState(); - return this.promise; } /** - * Invokes the provided callback after each polling is completed, - * sending the current state of the poller's operation. + * Only available for BlobClient constructed with a shared key credential. * - * It returns a method that can be used to stop receiving updates on the given callback function. + * Generates a Blob Service Shared Access Signature (SAS) URI based on the client properties + * and parameters passed in. The SAS is signed by the shared key credential of the client. + * + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * + * @param options - Optional parameters. + * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. */ - onProgress(callback) { - this.pollProgressCallbacks.push(callback); - return () => { - this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c2) => c2 !== callback); - }; + generateSasUrl(options) { + return new Promise((resolve2) => { + if (!(this.credential instanceof StorageSharedKeyCredential)) { + throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); + } + const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString(); + resolve2(appendToURLQuery(this.url, sas)); + }); } /** - * Returns true if the poller has finished polling. + * Delete the immutablility policy on the blob. + * + * @param options - Optional options to delete immutability policy on the blob. */ - isDone() { - const state = this.operation.state; - return Boolean(state.isCompleted || state.isCancelled || state.error); + async deleteImmutabilityPolicy(options) { + const { span, updatedOptions } = createSpan2("BlobClient-deleteImmutabilityPolicy", options); + try { + return await this.blobContext.deleteImmutabilityPolicy(Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } } /** - * Stops the poller from continuing to poll. + * Set immutablility policy on the blob. + * + * @param options - Optional options to set immutability policy on the blob. */ - stopPolling() { - if (!this.stopped) { - this.stopped = true; - if (this.reject) { - this.reject(new PollerStoppedError("This poller is already stopped")); - } + async setImmutabilityPolicy(immutabilityPolicy, options) { + const { span, updatedOptions } = createSpan2("BlobClient-setImmutabilityPolicy", options); + try { + return await this.blobContext.setImmutabilityPolicy(Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, immutabilityPolicyExpiry: immutabilityPolicy.expiriesOn, immutabilityPolicyMode: immutabilityPolicy.policyMode, modifiedAccessConditions: options === null || options === void 0 ? void 0 : options.modifiedAccessCondition }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } } /** - * Returns true if the poller is stopped. + * Set legal hold on the blob. + * + * @param options - Optional options to set legal hold on the blob. */ - isStopped() { - return this.stopped; + async setLegalHold(legalHoldEnabled, options) { + const { span, updatedOptions } = createSpan2("BlobClient-setLegalHold", options); + try { + return await this.blobContext.setLegalHold(legalHoldEnabled, Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } + } + }; + AppendBlobClient = class _AppendBlobClient extends BlobClient { + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { + let pipeline; + let url2; + options = options || {}; + if (isPipelineLike(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; + pipeline = credentialOrPipelineOrContainerName; + } else if (isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || isTokenCredential(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; + options = blobNameOrOptions; + pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { + url2 = urlOrConnectionString; + pipeline = newPipeline(new AnonymousCredential(), options); + } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { + const containerName = credentialOrPipelineOrContainerName; + const blobName = blobNameOrOptions; + const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + if (extractedCreds.kind === "AccountConnString") { + if (isNode) { + const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (!options.proxyOptions) { + options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + } + pipeline = newPipeline(sharedKeyCredential, options); + } else { + throw new Error("Account connection string is only supported in Node.js environment"); + } + } else if (extractedCreds.kind === "SASConnString") { + url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = newPipeline(new AnonymousCredential(), options); + } else { + throw new Error("Connection string must be either an Account connection string or a SAS connection string"); + } + } else { + throw new Error("Expecting non-empty strings for containerName and blobName parameters"); + } + super(url2, pipeline); + this.appendBlobContext = new AppendBlob(this.storageClientContext); } /** - * Attempts to cancel the underlying operation. - * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. - * - * If it's called again before it finishes, it will throw an error. + * Creates a new AppendBlobClient object identical to the source but with the + * specified snapshot timestamp. + * Provide "" will remove the snapshot and return a Client to the base blob. * - * @param options - Optional properties passed to the operation's update method. + * @param snapshot - The snapshot timestamp. + * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp. */ - cancelOperation(options = {}) { - if (!this.cancelPromise) { - this.cancelPromise = this.cancelOnce(options); - } else if (options.abortSignal) { - throw new Error("A cancel request is currently pending"); - } - return this.cancelPromise; + withSnapshot(snapshot2) { + return new _AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); } /** - * Returns the state of the operation. - * - * Even though TState will be the same type inside any of the methods of any extension of the Poller class, - * implementations of the pollers can customize what's shared with the public by writing their own - * version of the `getOperationState` method, and by defining two types, one representing the internal state of the poller - * and a public type representing a safe to share subset of the properties of the internal state. - * Their definition of getOperationState can then return their public type. - * - * Example: - * - * ```ts - * // Let's say we have our poller's operation state defined as: - * interface MyOperationState extends PollOperationState { - * privateProperty?: string; - * publicProperty?: string; - * } + * Creates a 0-length append blob. Call AppendBlock to append data to an append blob. + * @see https://docs.microsoft.com/rest/api/storageservices/put-blob * - * // To allow us to have a true separation of public and private state, we have to define another interface: - * interface PublicState extends PollOperationState { - * publicProperty?: string; - * } + * @param options - Options to the Append Block Create operation. * - * // Then, we define our Poller as follows: - * export class MyPoller extends Poller { - * // ... More content is needed here ... * - * public getOperationState(): PublicState { - * const state: PublicState = this.operation.state; - * return { - * // Properties from PollOperationState - * isStarted: state.isStarted, - * isCompleted: state.isCompleted, - * isCancelled: state.isCancelled, - * error: state.error, - * result: state.result, + * Example usage: * - * // The only other property needed by PublicState. - * publicProperty: state.publicProperty - * } - * } - * } + * ```js + * const appendBlobClient = containerClient.getAppendBlobClient(""); + * await appendBlobClient.create(); * ``` - * - * You can see this in the tests of this repository, go to the file: - * `../test/utils/testPoller.ts` - * and look for the getOperationState implementation. - */ - getOperationState() { - return this.operation.state; - } - /** - * Returns the result value of the operation, - * regardless of the state of the poller. - * It can return undefined or an incomplete form of the final TResult value - * depending on the implementation. - */ - getResult() { - const state = this.operation.state; - return state.result; - } - /** - * Returns a serialized version of the poller's operation - * by invoking the operation's toString method. */ - toString() { - return this.operation.toString(); - } - }; - } -}); - -// node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/index.js -var init_lroEngine = __esm({ - "node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/index.js"() { - } -}); - -// node_modules/@azure/core-lro/dist-esm/src/legacy/pollOperation.js -var init_pollOperation = __esm({ - "node_modules/@azure/core-lro/dist-esm/src/legacy/pollOperation.js"() { - } -}); - -// node_modules/@azure/core-lro/dist-esm/src/index.js -var init_src9 = __esm({ - "node_modules/@azure/core-lro/dist-esm/src/index.js"() { - init_lroEngine(); - init_poller(); - init_pollOperation(); - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js -function makeBlobBeginCopyFromURLPollOperation(state) { - return { - state: Object.assign({}, state), - cancel, - toString, - update - }; -} -var BlobBeginCopyFromUrlPoller, cancel, update, toString; -var init_BlobStartCopyFromUrlPoller = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js"() { - init_src5(); - init_src9(); - BlobBeginCopyFromUrlPoller = class extends Poller { - constructor(options) { - const { blobClient, copySource: copySource2, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; - let state; - if (resumeFrom) { - state = JSON.parse(resumeFrom).state; - } - const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { - blobClient, - copySource: copySource2, - startCopyFromURLOptions - })); - super(operation); - if (typeof onProgress === "function") { - this.onProgress(onProgress); - } - this.intervalInMs = intervalInMs; - } - delay() { - return delay(this.intervalInMs); - } - }; - cancel = async function cancel2(options = {}) { - const state = this.state; - const { copyId: copyId2 } = state; - if (state.isCompleted) { - return makeBlobBeginCopyFromURLPollOperation(state); - } - if (!copyId2) { - state.isCancelled = true; - return makeBlobBeginCopyFromURLPollOperation(state); - } - await state.blobClient.abortCopyFromURL(copyId2, { - abortSignal: options.abortSignal - }); - state.isCancelled = true; - return makeBlobBeginCopyFromURLPollOperation(state); - }; - update = async function update2(options = {}) { - const state = this.state; - const { blobClient, copySource: copySource2, startCopyFromURLOptions } = state; - if (!state.isStarted) { - state.isStarted = true; - const result = await blobClient.startCopyFromURL(copySource2, startCopyFromURLOptions); - state.copyId = result.copyId; - if (result.copyStatus === "success") { - state.result = result; - state.isCompleted = true; - } - } else if (!state.isCompleted) { + async create(options = {}) { + var _a2, _b2, _c2; + const { span, updatedOptions } = createSpan2("AppendBlobClient-create", options); + options.conditions = options.conditions || {}; try { - const result = await state.blobClient.getProperties({ abortSignal: options.abortSignal }); - const { copyStatus, copyProgress } = result; - const prevCopyProgress = state.copyProgress; - if (copyProgress) { - state.copyProgress = copyProgress; - } - if (copyStatus === "pending" && copyProgress !== prevCopyProgress && typeof options.fireProgress === "function") { - options.fireProgress(state); - } else if (copyStatus === "success") { - state.result = result; - state.isCompleted = true; - } else if (copyStatus === "failed") { - state.error = new Error(`Blob copy failed with reason: "${result.copyStatusDescription || "unknown"}"`); - state.isCompleted = true; - } - } catch (err) { - state.error = err; - state.isCompleted = true; - } - } - return makeBlobBeginCopyFromURLPollOperation(state); - }; - toString = function toString2() { - return JSON.stringify({ state: this.state }, (key, value) => { - if (key === "blobClient") { - return void 0; - } - return value; - }); - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/Range.js -function rangeToString(iRange) { - if (iRange.offset < 0) { - throw new RangeError(`Range.offset cannot be smaller than 0.`); - } - if (iRange.count && iRange.count <= 0) { - throw new RangeError(`Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.`); - } - return iRange.count ? `bytes=${iRange.offset}-${iRange.offset + iRange.count - 1}` : `bytes=${iRange.offset}-`; -} -var init_Range = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/Range.js"() { - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/Batch.js -import { EventEmitter } from "events"; -var BatchStates, Batch; -var init_Batch = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/Batch.js"() { - (function(BatchStates2) { - BatchStates2[BatchStates2["Good"] = 0] = "Good"; - BatchStates2[BatchStates2["Error"] = 1] = "Error"; - })(BatchStates || (BatchStates = {})); - Batch = class { - /** - * Creates an instance of Batch. - * @param concurrency - - */ - constructor(concurrency = 5) { - this.actives = 0; - this.completed = 0; - this.offset = 0; - this.operations = []; - this.state = BatchStates.Good; - if (concurrency < 1) { - throw new RangeError("concurrency must be larger than 0"); + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + return await this.appendBlobContext.create(0, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, immutabilityPolicyExpiry: (_b2 = options.immutabilityPolicy) === null || _b2 === void 0 ? void 0 : _b2.expiriesOn, immutabilityPolicyMode: (_c2 = options.immutabilityPolicy) === null || _c2 === void 0 ? void 0 : _c2.policyMode, legalHold: options.legalHold, blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } - this.concurrency = concurrency; - this.emitter = new EventEmitter(); } /** - * Add a operation into queue. + * Creates a 0-length append blob. Call AppendBlock to append data to an append blob. + * If the blob with the same name already exists, the content of the existing blob will remain unchanged. + * @see https://docs.microsoft.com/rest/api/storageservices/put-blob * - * @param operation - + * @param options - */ - addOperation(operation) { - this.operations.push(async () => { - try { - this.actives++; - await operation(); - this.actives--; - this.completed++; - this.parallelExecute(); - } catch (error) { - this.emitter.emit("error", error); + async createIfNotExists(options = {}) { + var _a2, _b2; + const { span, updatedOptions } = createSpan2("AppendBlobClient-createIfNotExists", options); + const conditions = { ifNoneMatch: ETagAny }; + try { + const res = await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions })); + return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + } catch (e2) { + if (((_a2 = e2.details) === null || _a2 === void 0 ? void 0 : _a2.errorCode) === "BlobAlreadyExists") { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: "Expected exception when creating a blob only if it does not already exist." + }); + return Object.assign(Object.assign({ succeeded: false }, (_b2 = e2.response) === null || _b2 === void 0 ? void 0 : _b2.parsedHeaders), { _response: e2.response }); } - }); + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } } /** - * Start execute operations in the queue. + * Seals the append blob, making it read only. * + * @param options - */ - async do() { - if (this.operations.length === 0) { - return Promise.resolve(); - } - this.parallelExecute(); - return new Promise((resolve2, reject) => { - this.emitter.on("finish", resolve2); - this.emitter.on("error", (error) => { - this.state = BatchStates.Error; - reject(error); + async seal(options = {}) { + var _a2; + const { span, updatedOptions } = createSpan2("AppendBlobClient-seal", options); + options.conditions = options.conditions || {}; + try { + return await this.appendBlobContext.seal(Object.assign({ abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message }); - }); + throw e2; + } finally { + span.end(); + } } /** - * Get next operation to be executed. Return null when reaching ends. + * Commits a new block of data to the end of the existing append blob. + * @see https://docs.microsoft.com/rest/api/storageservices/append-block + * + * @param body - Data to be appended. + * @param contentLength - Length of the body in bytes. + * @param options - Options to the Append Block operation. + * + * + * Example usage: + * + * ```js + * const content = "Hello World!"; + * + * // Create a new append blob and append data to the blob. + * const newAppendBlobClient = containerClient.getAppendBlobClient(""); + * await newAppendBlobClient.create(); + * await newAppendBlobClient.appendBlock(content, content.length); * + * // Append data to an existing append blob. + * const existingAppendBlobClient = containerClient.getAppendBlobClient(""); + * await existingAppendBlobClient.appendBlock(content, content.length); + * ``` */ - nextOperation() { - if (this.offset < this.operations.length) { - return this.operations[this.offset++]; + async appendBlock(body2, contentLength2, options = {}) { + var _a2; + const { span, updatedOptions } = createSpan2("AppendBlobClient-appendBlock", options); + options.conditions = options.conditions || {}; + try { + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + return await this.appendBlobContext.appendBlock(contentLength2, body2, Object.assign({ abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), requestOptions: { + onUploadProgress: options.onProgress + }, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } - return null; } /** - * Start execute operations. One one the most important difference between - * this method with do() is that do() wraps as an sync method. + * The Append Block operation commits a new block of data to the end of an existing append blob + * where the contents are read from a source url. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-url * + * @param sourceURL - + * The url to the blob that will be the source of the copy. A source blob in the same storage account can + * be authenticated via Shared Key. However, if the source is a blob in another account, the source blob + * must either be public or must be authenticated via a shared access signature. If the source blob is + * public, no authentication is required to perform the operation. + * @param sourceOffset - Offset in source to be appended + * @param count - Number of bytes to be appended as a block + * @param options - */ - parallelExecute() { - if (this.state === BatchStates.Error) { - return; - } - if (this.completed >= this.operations.length) { - this.emitter.emit("finish"); - return; + async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) { + var _a2; + const { span, updatedOptions } = createSpan2("AppendBlobClient-appendBlockFromURL", options); + options.conditions = options.conditions || {}; + options.sourceConditions = options.sourceConditions || {}; + try { + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + return await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, Object.assign({ abortSignal: options.abortSignal, sourceRange: rangeToString({ offset: sourceOffset, count }), sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, appendPositionAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), sourceModifiedAccessConditions: { + sourceIfMatch: options.sourceConditions.ifMatch, + sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince + }, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } - while (this.actives < this.concurrency) { - const operation = this.nextOperation(); - if (operation) { - operation(); + } + }; + BlockBlobClient = class _BlockBlobClient extends BlobClient { + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { + let pipeline; + let url2; + options = options || {}; + if (isPipelineLike(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; + pipeline = credentialOrPipelineOrContainerName; + } else if (isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || isTokenCredential(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; + options = blobNameOrOptions; + pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { + url2 = urlOrConnectionString; + if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { + options = blobNameOrOptions; + } + pipeline = newPipeline(new AnonymousCredential(), options); + } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { + const containerName = credentialOrPipelineOrContainerName; + const blobName = blobNameOrOptions; + const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + if (extractedCreds.kind === "AccountConnString") { + if (isNode) { + const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (!options.proxyOptions) { + options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + } + pipeline = newPipeline(sharedKeyCredential, options); + } else { + throw new Error("Account connection string is only supported in Node.js environment"); + } + } else if (extractedCreds.kind === "SASConnString") { + url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = newPipeline(new AnonymousCredential(), options); } else { - return; + throw new Error("Connection string must be either an Account connection string or a SAS connection string"); } + } else { + throw new Error("Expecting non-empty strings for containerName and blobName parameters"); } + super(url2, pipeline); + this.blockBlobContext = new BlockBlob(this.storageClientContext); + this._blobContext = new Blob3(this.storageClientContext); } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-common/src/BuffersStream.js -import { Readable as Readable4 } from "stream"; -var BuffersStream; -var init_BuffersStream = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-common/src/BuffersStream.js"() { - BuffersStream = class extends Readable4 { /** - * Creates an instance of BuffersStream that will emit the data - * contained in the array of buffers. + * Creates a new BlockBlobClient object identical to the source but with the + * specified snapshot timestamp. + * Provide "" will remove the snapshot and return a URL to the base blob. * - * @param buffers - Array of buffers containing the data - * @param byteLength - The total length of data contained in the buffers + * @param snapshot - The snapshot timestamp. + * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp. */ - constructor(buffers, byteLength, options) { - super(options); - this.buffers = buffers; - this.byteLength = byteLength; - this.byteOffsetInCurrentBuffer = 0; - this.bufferIndex = 0; - this.pushedBytesLength = 0; - let buffersLength = 0; - for (const buf of this.buffers) { - buffersLength += buf.byteLength; - } - if (buffersLength < this.byteLength) { - throw new Error("Data size shouldn't be larger than the total length of buffers."); - } + withSnapshot(snapshot2) { + return new _BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); } /** - * Internal _read() that will be called when the stream wants to pull more data in. + * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * @param size - Optional. The size of data to be read + * Quick query for a JSON or CSV formatted blob. + * + * Example usage (Node.js): + * + * ```js + * // Query and convert a blob to a string + * const queryBlockBlobResponse = await blockBlobClient.query("select * from BlobStorage"); + * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); + * console.log("Query blob content:", downloaded); + * + * async function streamToBuffer(readableStream) { + * return new Promise((resolve, reject) => { + * const chunks = []; + * readableStream.on("data", (data) => { + * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); + * }); + * readableStream.on("end", () => { + * resolve(Buffer.concat(chunks)); + * }); + * readableStream.on("error", reject); + * }); + * } + * ``` + * + * @param query - + * @param options - */ - _read(size) { - if (this.pushedBytesLength >= this.byteLength) { - this.push(null); - } - if (!size) { - size = this.readableHighWaterMark; - } - const outBuffers = []; - let i2 = 0; - while (i2 < size && this.pushedBytesLength < this.byteLength) { - const remainingDataInAllBuffers = this.byteLength - this.pushedBytesLength; - const remainingCapacityInThisBuffer = this.buffers[this.bufferIndex].byteLength - this.byteOffsetInCurrentBuffer; - const remaining = Math.min(remainingCapacityInThisBuffer, remainingDataInAllBuffers); - if (remaining > size - i2) { - const end = this.byteOffsetInCurrentBuffer + size - i2; - outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end)); - this.pushedBytesLength += size - i2; - this.byteOffsetInCurrentBuffer = end; - i2 = size; - break; - } else { - const end = this.byteOffsetInCurrentBuffer + remaining; - outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end)); - if (remaining === remainingCapacityInThisBuffer) { - this.byteOffsetInCurrentBuffer = 0; - this.bufferIndex++; - } else { - this.byteOffsetInCurrentBuffer = end; - } - this.pushedBytesLength += remaining; - i2 += remaining; + async query(query, options = {}) { + var _a2; + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + const { span, updatedOptions } = createSpan2("BlockBlobClient-query", options); + try { + if (!isNode) { + throw new Error("This operation currently is only supported in Node.js."); } - } - if (outBuffers.length > 1) { - this.push(Buffer.concat(outBuffers)); - } else if (outBuffers.length === 1) { - this.push(outBuffers[0]); + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + const response = await this._blobContext.query(Object.assign({ abortSignal: options.abortSignal, queryRequest: { + queryType: "SQL", + expression: query, + inputSerialization: toQuerySerialization(options.inputTextConfiguration), + outputSerialization: toQuerySerialization(options.outputTextConfiguration) + }, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions))); + return new BlobQueryResponse(response, { + abortSignal: options.abortSignal, + onProgress: options.onProgress, + onError: options.onError + }); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-common/src/PooledBuffer.js -var maxBufferLength, PooledBuffer; -var init_PooledBuffer = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-common/src/PooledBuffer.js"() { - init_BuffersStream(); - maxBufferLength = __require("buffer").constants.MAX_LENGTH; - PooledBuffer = class { - constructor(capacity, buffers, totalLength) { - this.buffers = []; - this.capacity = capacity; - this._size = 0; - const bufferNum = Math.ceil(capacity / maxBufferLength); - for (let i2 = 0; i2 < bufferNum; i2++) { - let len = i2 === bufferNum - 1 ? capacity % maxBufferLength : maxBufferLength; - if (len === 0) { - len = maxBufferLength; - } - this.buffers.push(Buffer.allocUnsafe(len)); - } - if (buffers) { - this.fill(buffers, totalLength); + /** + * Creates a new block blob, or updates the content of an existing block blob. + * Updating an existing block blob overwrites any existing metadata on the blob. + * Partial updates are not supported; the content of the existing blob is + * overwritten with the new content. To perform a partial update of a block blob's, + * use {@link stageBlock} and {@link commitBlockList}. + * + * This is a non-parallel uploading method, please use {@link uploadFile}, + * {@link uploadStream} or {@link uploadBrowserData} for better performance + * with concurrency uploading. + * + * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * + * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function + * which returns a new Readable stream whose offset is from data source beginning. + * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a + * string including non non-Base64/Hex-encoded characters. + * @param options - Options to the Block Blob Upload operation. + * @returns Response data for the Block Blob Upload operation. + * + * Example usage: + * + * ```js + * const content = "Hello world!"; + * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); + * ``` + */ + async upload(body2, contentLength2, options = {}) { + var _a2, _b2, _c2; + options.conditions = options.conditions || {}; + const { span, updatedOptions } = createSpan2("BlockBlobClient-upload", options); + try { + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + return await this.blockBlobContext.upload(contentLength2, body2, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), requestOptions: { + onUploadProgress: options.onProgress + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, immutabilityPolicyExpiry: (_b2 = options.immutabilityPolicy) === null || _b2 === void 0 ? void 0 : _b2.expiriesOn, immutabilityPolicyMode: (_c2 = options.immutabilityPolicy) === null || _c2 === void 0 ? void 0 : _c2.policyMode, legalHold: options.legalHold, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } } /** - * The size of the data contained in the pooled buffers. + * Creates a new Block Blob where the contents of the blob are read from a given URL. + * This API is supported beginning with the 2020-04-08 version. Partial updates + * are not supported with Put Blob from URL; the content of an existing blob is overwritten with + * the content of the new blob. To perform partial updates to a block blob’s contents using a + * source URL, use {@link stageBlockFromURL} and {@link commitBlockList}. + * + * @param sourceURL - Specifies the URL of the blob. The value + * may be a URL of up to 2 KB in length that specifies a blob. + * The value should be URL-encoded as it would appear + * in a request URI. The source blob must either be public + * or must be authenticated via a shared access signature. + * If the source blob is public, no authentication is required + * to perform the operation. Here are some examples of source object URLs: + * - https://myaccount.blob.core.windows.net/mycontainer/myblob + * - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot= + * @param options - Optional parameters. */ - get size() { - return this._size; + async syncUploadFromURL(sourceURL, options = {}) { + var _a2, _b2, _c2, _d2, _e2; + options.conditions = options.conditions || {}; + const { span, updatedOptions } = createSpan2("BlockBlobClient-syncUploadFromURL", options); + try { + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + return await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: options.conditions.tagConditions }), sourceModifiedAccessConditions: { + sourceIfMatch: (_a2 = options.sourceConditions) === null || _a2 === void 0 ? void 0 : _a2.ifMatch, + sourceIfModifiedSince: (_b2 = options.sourceConditions) === null || _b2 === void 0 ? void 0 : _b2.ifModifiedSince, + sourceIfNoneMatch: (_c2 = options.sourceConditions) === null || _c2 === void 0 ? void 0 : _c2.ifNoneMatch, + sourceIfUnmodifiedSince: (_d2 = options.sourceConditions) === null || _d2 === void 0 ? void 0 : _d2.ifUnmodifiedSince, + sourceIfTags: (_e2 = options.sourceConditions) === null || _e2 === void 0 ? void 0 : _e2.tagConditions + }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags }), convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } } /** - * Fill the internal buffers with data in the input buffers serially - * with respect to the total length and the total capacity of the internal buffers. - * Data copied will be shift out of the input buffers. - * - * @param buffers - Input buffers containing the data to be filled in the pooled buffer - * @param totalLength - Total length of the data to be filled in. + * Uploads the specified block to the block blob's "staging area" to be later + * committed by a call to commitBlockList. + * @see https://docs.microsoft.com/rest/api/storageservices/put-block * + * @param blockId - A 64-byte value that is base64-encoded + * @param body - Data to upload to the staging area. + * @param contentLength - Number of bytes to upload. + * @param options - Options to the Block Blob Stage Block operation. + * @returns Response data for the Block Blob Stage Block operation. */ - fill(buffers, totalLength) { - this._size = Math.min(this.capacity, totalLength); - let i2 = 0, j2 = 0, targetOffset = 0, sourceOffset = 0, totalCopiedNum = 0; - while (totalCopiedNum < this._size) { - const source = buffers[i2]; - const target = this.buffers[j2]; - const copiedNum = source.copy(target, targetOffset, sourceOffset); - totalCopiedNum += copiedNum; - sourceOffset += copiedNum; - targetOffset += copiedNum; - if (sourceOffset === source.length) { - i2++; - sourceOffset = 0; - } - if (targetOffset === target.length) { - j2++; - targetOffset = 0; - } + async stageBlock(blockId2, body2, contentLength2, options = {}) { + const { span, updatedOptions } = createSpan2("BlockBlobClient-stageBlock", options); + try { + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + return await this.blockBlobContext.stageBlock(blockId2, contentLength2, body2, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, requestOptions: { + onUploadProgress: options.onProgress + }, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } - buffers.splice(0, i2); - if (buffers.length > 0) { - buffers[0] = buffers[0].slice(sourceOffset); + } + /** + * The Stage Block From URL operation creates a new block to be committed as part + * of a blob where the contents are read from a URL. + * This API is available starting in version 2018-03-28. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url + * + * @param blockId - A 64-byte value that is base64-encoded + * @param sourceURL - Specifies the URL of the blob. The value + * may be a URL of up to 2 KB in length that specifies a blob. + * The value should be URL-encoded as it would appear + * in a request URI. The source blob must either be public + * or must be authenticated via a shared access signature. + * If the source blob is public, no authentication is required + * to perform the operation. Here are some examples of source object URLs: + * - https://myaccount.blob.core.windows.net/mycontainer/myblob + * - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot= + * @param offset - From which position of the blob to download, greater than or equal to 0 + * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined + * @param options - Options to the Block Blob Stage Block From URL operation. + * @returns Response data for the Block Blob Stage Block From URL operation. + */ + async stageBlockFromURL(blockId2, sourceURL, offset = 0, count, options = {}) { + const { span, updatedOptions } = createSpan2("BlockBlobClient-stageBlockFromURL", options); + try { + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + return await this.blockBlobContext.stageBlockFromURL(blockId2, 0, sourceURL, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, sourceRange: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization) }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } } /** - * Get the readable stream assembled from all the data in the internal buffers. + * Writes a blob by specifying the list of block IDs that make up the blob. + * In order to be written as part of a blob, a block must have been successfully written + * to the server in a prior {@link stageBlock} operation. You can call {@link commitBlockList} to + * update a blob by uploading only those blocks that have changed, then committing the new and existing + * blocks together. Any blocks not specified in the block list and permanently deleted. + * @see https://docs.microsoft.com/rest/api/storageservices/put-block-list * + * @param blocks - Array of 64-byte value that is base64-encoded + * @param options - Options to the Block Blob Commit Block List operation. + * @returns Response data for the Block Blob Commit Block List operation. */ - getReadableStream() { - return new BuffersStream(this.buffers, this.size); + async commitBlockList(blocks2, options = {}) { + var _a2, _b2, _c2; + options.conditions = options.conditions || {}; + const { span, updatedOptions } = createSpan2("BlockBlobClient-commitBlockList", options); + try { + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + return await this.blockBlobContext.commitBlockList({ latest: blocks2 }, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, immutabilityPolicyExpiry: (_b2 = options.immutabilityPolicy) === null || _b2 === void 0 ? void 0 : _b2.expiriesOn, immutabilityPolicyMode: (_c2 = options.immutabilityPolicy) === null || _c2 === void 0 ? void 0 : _c2.policyMode, legalHold: options.legalHold, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-common/src/BufferScheduler.js -import { EventEmitter as EventEmitter2 } from "events"; -var BufferScheduler; -var init_BufferScheduler = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-common/src/BufferScheduler.js"() { - init_PooledBuffer(); - BufferScheduler = class { /** - * Creates an instance of BufferScheduler. + * Returns the list of blocks that have been uploaded as part of a block blob + * using the specified block list filter. + * @see https://docs.microsoft.com/rest/api/storageservices/get-block-list * - * @param readable - A Node.js Readable stream - * @param bufferSize - Buffer size of every maintained buffer - * @param maxBuffers - How many buffers can be allocated - * @param outgoingHandler - An async function scheduled to be - * triggered when a buffer fully filled - * with stream data - * @param concurrency - Concurrency of executing outgoingHandlers (>0) - * @param encoding - [Optional] Encoding of Readable stream when it's a string stream + * @param listType - Specifies whether to return the list of committed blocks, + * the list of uncommitted blocks, or both lists together. + * @param options - Options to the Block Blob Get Block List operation. + * @returns Response data for the Block Blob Get Block List operation. */ - constructor(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) { - this.emitter = new EventEmitter2(); - this.offset = 0; - this.isStreamEnd = false; - this.isError = false; - this.executingOutgoingHandlers = 0; - this.numBuffers = 0; - this.unresolvedDataArray = []; - this.unresolvedLength = 0; - this.incoming = []; - this.outgoing = []; - if (bufferSize <= 0) { - throw new RangeError(`bufferSize must be larger than 0, current is ${bufferSize}`); - } - if (maxBuffers <= 0) { - throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`); - } - if (concurrency <= 0) { - throw new RangeError(`concurrency must be larger than 0, current is ${concurrency}`); + async getBlockList(listType2, options = {}) { + var _a2; + const { span, updatedOptions } = createSpan2("BlockBlobClient-getBlockList", options); + try { + const res = await this.blockBlobContext.getBlockList(listType2, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); + if (!res.committedBlocks) { + res.committedBlocks = []; + } + if (!res.uncommittedBlocks) { + res.uncommittedBlocks = []; + } + return res; + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } - this.bufferSize = bufferSize; - this.maxBuffers = maxBuffers; - this.readable = readable; - this.outgoingHandler = outgoingHandler; - this.concurrency = concurrency; - this.encoding = encoding; } + // High level functions /** - * Start the scheduler, will return error when stream of any of the outgoingHandlers - * returns error. + * Uploads a Buffer(Node.js)/Blob(browsers)/ArrayBuffer/ArrayBufferView object to a BlockBlob. + * + * When data length is no more than the specifiled {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is + * {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload. + * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList} + * to commit the block list. + * + * A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is + * `blobContentType`, enabling the browser to provide + * functionality based on file type. * + * @param data - Buffer(Node.js), Blob, ArrayBuffer or ArrayBufferView + * @param options - */ - async do() { - return new Promise((resolve2, reject) => { - this.readable.on("data", (data) => { - data = typeof data === "string" ? Buffer.from(data, this.encoding) : data; - this.appendUnresolvedData(data); - if (!this.resolveData()) { - this.readable.pause(); - } - }); - this.readable.on("error", (err) => { - this.emitter.emit("error", err); - }); - this.readable.on("end", () => { - this.isStreamEnd = true; - this.emitter.emit("checkEnd"); - }); - this.emitter.on("error", (err) => { - this.isError = true; - this.readable.pause(); - reject(err); - }); - this.emitter.on("checkEnd", () => { - if (this.outgoing.length > 0) { - this.triggerOutgoingHandlers(); - return; - } - if (this.isStreamEnd && this.executingOutgoingHandlers === 0) { - if (this.unresolvedLength > 0 && this.unresolvedLength < this.bufferSize) { - const buffer = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer.getReadableStream(), buffer.size, this.offset).then(resolve2).catch(reject); - } else if (this.unresolvedLength >= this.bufferSize) { - return; - } else { - resolve2(); - } + async uploadData(data, options = {}) { + const { span, updatedOptions } = createSpan2("BlockBlobClient-uploadData", options); + try { + if (isNode) { + let buffer; + if (data instanceof Buffer) { + buffer = data; + } else if (data instanceof ArrayBuffer) { + buffer = Buffer.from(data); + } else { + data = data; + buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength); } + return this.uploadSeekableInternal((offset, size) => buffer.slice(offset, offset + size), buffer.byteLength, updatedOptions); + } else { + const browserBlob = new Blob([data]); + return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions); + } + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message }); - }); + throw e2; + } finally { + span.end(); + } } /** - * Insert a new data into unresolved array. + * ONLY AVAILABLE IN BROWSERS. * - * @param data - - */ - appendUnresolvedData(data) { - this.unresolvedDataArray.push(data); - this.unresolvedLength += data.length; - } - /** - * Try to shift a buffer with size in blockSize. The buffer returned may be less - * than blockSize when data in unresolvedDataArray is less than bufferSize. + * Uploads a browser Blob/File/ArrayBuffer/ArrayBufferView object to block blob. + * + * When buffer length lesser than or equal to 256MB, this method will use 1 upload call to finish the upload. + * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call + * {@link commitBlockList} to commit the block list. + * + * A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is + * `blobContentType`, enabling the browser to provide + * functionality based on file type. + * + * @deprecated Use {@link uploadData} instead. * + * @param browserData - Blob, File, ArrayBuffer or ArrayBufferView + * @param options - Options to upload browser data. + * @returns Response data for the Blob Upload operation. */ - shiftBufferFromUnresolvedDataArray(buffer) { - if (!buffer) { - buffer = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); - } else { - buffer.fill(this.unresolvedDataArray, this.unresolvedLength); + async uploadBrowserData(browserData, options = {}) { + const { span, updatedOptions } = createSpan2("BlockBlobClient-uploadBrowserData", options); + try { + const browserBlob = new Blob([browserData]); + return await this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } - this.unresolvedLength -= buffer.size; - return buffer; } /** - * Resolve data in unresolvedDataArray. For every buffer with size in blockSize - * shifted, it will try to get (or allocate a buffer) from incoming, and fill it, - * then push it into outgoing to be handled by outgoing handler. * - * Return false when available buffers in incoming are not enough, else true. + * Uploads data to block blob. Requires a bodyFactory as the data source, + * which need to return a {@link HttpRequestBody} object with the offset and size provided. * - * @returns Return false when buffers in incoming are not enough, else true. + * When data length is no more than the specified {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is + * {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload. + * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList} + * to commit the block list. + * + * @param bodyFactory - + * @param size - size of the data to upload. + * @param options - Options to Upload to Block Blob operation. + * @returns Response data for the Blob Upload operation. */ - resolveData() { - while (this.unresolvedLength >= this.bufferSize) { - let buffer; - if (this.incoming.length > 0) { - buffer = this.incoming.shift(); - this.shiftBufferFromUnresolvedDataArray(buffer); - } else { - if (this.numBuffers < this.maxBuffers) { - buffer = this.shiftBufferFromUnresolvedDataArray(); - this.numBuffers++; - } else { - return false; + async uploadSeekableInternal(bodyFactory, size, options = {}) { + if (!options.blockSize) { + options.blockSize = 0; + } + if (options.blockSize < 0 || options.blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { + throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); + } + if (options.maxSingleShotSize !== 0 && !options.maxSingleShotSize) { + options.maxSingleShotSize = BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; + } + if (options.maxSingleShotSize < 0 || options.maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { + throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}`); + } + if (options.blockSize === 0) { + if (size > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { + throw new RangeError(`${size} is too larger to upload to a block blob.`); + } + if (size > options.maxSingleShotSize) { + options.blockSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS); + if (options.blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { + options.blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; } } - this.outgoing.push(buffer); - this.triggerOutgoingHandlers(); } - return true; - } - /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. - */ - async triggerOutgoingHandlers() { - let buffer; - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return; + if (!options.blobHTTPHeaders) { + options.blobHTTPHeaders = {}; + } + if (!options.conditions) { + options.conditions = {}; + } + const { span, updatedOptions } = createSpan2("BlockBlobClient-uploadSeekableInternal", options); + try { + if (size <= options.maxSingleShotSize) { + return await this.upload(bodyFactory(0, size), size, updatedOptions); } - buffer = this.outgoing.shift(); - if (buffer) { - this.triggerOutgoingHandler(buffer); + const numBlocks = Math.floor((size - 1) / options.blockSize) + 1; + if (numBlocks > BLOCK_BLOB_MAX_BLOCKS) { + throw new RangeError(`The buffer's size is too big or the BlockSize is too small;the number of blocks must be <= ${BLOCK_BLOB_MAX_BLOCKS}`); } - } while (buffer); + const blockList = []; + const blockIDPrefix = generateUuid(); + let transferProgress = 0; + const batch = new Batch(options.concurrency); + for (let i2 = 0; i2 < numBlocks; i2++) { + batch.addOperation(async () => { + const blockID = generateBlockID(blockIDPrefix, i2); + const start = options.blockSize * i2; + const end = i2 === numBlocks - 1 ? size : start + options.blockSize; + const contentLength2 = end - start; + blockList.push(blockID); + await this.stageBlock(blockID, bodyFactory(start, contentLength2), contentLength2, { + abortSignal: options.abortSignal, + conditions: options.conditions, + encryptionScope: options.encryptionScope, + tracingOptions: updatedOptions.tracingOptions + }); + transferProgress += contentLength2; + if (options.onProgress) { + options.onProgress({ + loadedBytes: transferProgress + }); + } + }); + } + await batch.do(); + return this.commitBlockList(blockList, updatedOptions); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); + } } /** - * Trigger a outgoing handler for a buffer shifted from outgoing. + * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * @param buffer - + * Uploads a local file in blocks to a block blob. + * + * When file size lesser than or equal to 256MB, this method will use 1 upload call to finish the upload. + * Otherwise, this method will call stageBlock to upload blocks, and finally call commitBlockList + * to commit the block list. + * + * @param filePath - Full path of local file + * @param options - Options to Upload to Block Blob operation. + * @returns Response data for the Blob Upload operation. */ - async triggerOutgoingHandler(buffer) { - const bufferLength = buffer.size; - this.executingOutgoingHandlers++; - this.offset += bufferLength; + async uploadFile(filePath, options = {}) { + const { span, updatedOptions } = createSpan2("BlockBlobClient-uploadFile", options); try { - await this.outgoingHandler(() => buffer.getReadableStream(), bufferLength, this.offset - bufferLength); - } catch (err) { - this.emitter.emit("error", err); - return; + const size = (await fsStat(filePath)).size; + return await this.uploadSeekableInternal((offset, count) => { + return () => fsCreateReadStream(filePath, { + autoClose: true, + end: count ? offset + count - 1 : Infinity, + start: offset + }); + }, size, Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) })); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer); - this.emitter.emit("checkEnd"); } /** - * Return buffer used by outgoing handler into incoming. + * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * @param buffer - + * Uploads a Node.js Readable stream into block blob. + * + * PERFORMANCE IMPROVEMENT TIPS: + * * Input stream highWaterMark is better to set a same value with bufferSize + * parameter, which will avoid Buffer.concat() operations. + * + * @param stream - Node.js Readable stream + * @param bufferSize - Size of every buffer allocated, also the block size in the uploaded block blob. Default value is 8MB + * @param maxConcurrency - Max concurrency indicates the max number of buffers that can be allocated, + * positive correlation with max uploading concurrency. Default value is 5 + * @param options - Options to Upload Stream to Block Blob operation. + * @returns Response data for the Blob Upload operation. */ - reuseBuffer(buffer) { - this.incoming.push(buffer); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); + async uploadStream(stream, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { + if (!options.blobHTTPHeaders) { + options.blobHTTPHeaders = {}; + } + if (!options.conditions) { + options.conditions = {}; + } + const { span, updatedOptions } = createSpan2("BlockBlobClient-uploadStream", options); + try { + let blockNum = 0; + const blockIDPrefix = generateUuid(); + let transferProgress = 0; + const blockList = []; + const scheduler = new BufferScheduler( + stream, + bufferSize, + maxConcurrency, + async (body2, length) => { + const blockID = generateBlockID(blockIDPrefix, blockNum); + blockList.push(blockID); + blockNum++; + await this.stageBlock(blockID, body2, length, { + conditions: options.conditions, + encryptionScope: options.encryptionScope, + tracingOptions: updatedOptions.tracingOptions + }); + transferProgress += length; + if (options.onProgress) { + options.onProgress({ loadedBytes: transferProgress }); + } + }, + // concurrency should set a smaller value than maxConcurrency, which is helpful to + // reduce the possibility when a outgoing handler waits for stream data, in + // this situation, outgoing handlers are blocked. + // Outgoing queue shouldn't be empty. + Math.ceil(maxConcurrency / 4 * 3) + ); + await scheduler.do(); + return await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) })); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-common/src/index.js -var init_src10 = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-common/src/index.js"() { - init_BufferScheduler(); - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/utils.node.js -import * as fs from "fs"; -import * as util2 from "util"; -async function streamToBuffer(stream, buffer, offset, end, encoding) { - let pos = 0; - const count = end - offset; - return new Promise((resolve2, reject) => { - const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); - stream.on("readable", () => { - if (pos >= count) { - clearTimeout(timeout); - resolve2(); - return; - } - let chunk = stream.read(); - if (!chunk) { - return; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding); - } - const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); - pos += chunkLength; - }); - stream.on("end", () => { - clearTimeout(timeout); - if (pos < count) { - reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); - } - resolve2(); - }); - stream.on("error", (msg) => { - clearTimeout(timeout); - reject(msg); - }); - }); -} -async function streamToBuffer2(stream, buffer, encoding) { - let pos = 0; - const bufferSize = buffer.length; - return new Promise((resolve2, reject) => { - stream.on("readable", () => { - let chunk = stream.read(); - if (!chunk) { - return; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding); - } - if (pos + chunk.length > bufferSize) { - reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`)); - return; - } - buffer.fill(chunk, pos, pos + chunk.length); - pos += chunk.length; - }); - stream.on("end", () => { - resolve2(pos); - }); - stream.on("error", reject); - }); -} -async function readStreamToLocalFile(rs, file) { - return new Promise((resolve2, reject) => { - const ws = fs.createWriteStream(file); - rs.on("error", (err) => { - reject(err); - }); - ws.on("error", (err) => { - reject(err); - }); - ws.on("close", resolve2); - rs.pipe(ws); - }); -} -var fsStat, fsCreateReadStream; -var init_utils_node = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/utils.node.js"() { - init_constants2(); - fsStat = util2.promisify(fs.stat); - fsCreateReadStream = fs.createReadStream; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/Clients.js -var BlobClient, AppendBlobClient, BlockBlobClient, PageBlobClient; -var init_Clients = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/Clients.js"() { - init_tslib_es6(); - init_src5(); - init_src4(); - init_BlobDownloadResponse(); - init_BlobQueryResponse(); - init_AnonymousCredential(); - init_StorageSharedKeyCredential(); - init_operations(); - init_models3(); - init_PageBlobRangeResponse(); - init_Pipeline(); - init_BlobStartCopyFromUrlPoller(); - init_Range(); - init_StorageClient(); - init_Batch(); - init_src10(); - init_constants2(); - init_tracing(); - init_utils_common(); - init_utils_node(); - init_BlobSASSignatureValues(); - init_BlobLeaseClient(); - BlobClient = class _BlobClient extends StorageClient { + }; + PageBlobClient = class _PageBlobClient extends BlobClient { constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { - options = options || {}; let pipeline; let url2; + options = options || {}; if (isPipelineLike(credentialOrPipelineOrContainerName)) { url2 = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; @@ -50890,9 +67168,6 @@ var init_Clients = __esm({ pipeline = newPipeline(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { url2 = urlOrConnectionString; - if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { - options = blobNameOrOptions; - } pipeline = newPipeline(new AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { const containerName = credentialOrPipelineOrContainerName; @@ -50919,172 +67194,35 @@ var init_Clients = __esm({ throw new Error("Expecting non-empty strings for containerName and blobName parameters"); } super(url2, pipeline); - ({ blobName: this._name, containerName: this._containerName } = this.getBlobAndContainerNamesFromUrl()); - this.blobContext = new Blob3(this.storageClientContext); - this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT); - this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID); - } - /** - * The name of the blob. - */ - get name() { - return this._name; - } - /** - * The name of the storage container the blob is associated with. - */ - get containerName() { - return this._containerName; + this.pageBlobContext = new PageBlob(this.storageClientContext); } /** - * Creates a new BlobClient object identical to the source but with the specified snapshot timestamp. + * Creates a new PageBlobClient object identical to the source but with the + * specified snapshot timestamp. * Provide "" will remove the snapshot and return a Client to the base blob. * * @param snapshot - The snapshot timestamp. - * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp + * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. */ withSnapshot(snapshot2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); - } - /** - * Creates a new BlobClient object pointing to a version of this blob. - * Provide "" will remove the versionId and return a Client to the base blob. - * - * @param versionId - The versionId. - * @returns A new BlobClient object pointing to the version of this blob. - */ - withVersion(versionId2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId2.length === 0 ? void 0 : versionId2), this.pipeline); - } - /** - * Creates a AppendBlobClient object. - * - */ - getAppendBlobClient() { - return new AppendBlobClient(this.url, this.pipeline); - } - /** - * Creates a BlockBlobClient object. - * - */ - getBlockBlobClient() { - return new BlockBlobClient(this.url, this.pipeline); - } - /** - * Creates a PageBlobClient object. - * - */ - getPageBlobClient() { - return new PageBlobClient(this.url, this.pipeline); + return new _PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); } /** - * Reads or downloads a blob from the system, including its metadata and properties. - * You can also call Get Blob to read a snapshot. - * - * * In Node.js, data returns in a Readable stream readableStreamBody - * * In browsers, data returns in a promise blobBody - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob - * - * @param offset - From which position of the blob to download, greater than or equal to 0 - * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined - * @param options - Optional options to Blob Download operation. - * - * - * Example usage (Node.js): - * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); - * console.log("Downloaded blob content:", downloaded.toString()); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); - * } - * ``` - * - * Example usage (browser): - * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody); - * console.log( - * "Downloaded blob content", - * downloaded - * ); + * Creates a page blob of the specified length. Call uploadPages to upload data + * data to a page blob. + * @see https://docs.microsoft.com/rest/api/storageservices/put-blob * - * async function blobToString(blob: Blob): Promise { - * const fileReader = new FileReader(); - * return new Promise((resolve, reject) => { - * fileReader.onloadend = (ev: any) => { - * resolve(ev.target!.result); - * }; - * fileReader.onerror = reject; - * fileReader.readAsText(blob); - * }); - * } - * ``` + * @param size - size of the page blob. + * @param options - Options to the Page Blob Create operation. + * @returns Response data for the Page Blob Create operation. */ - async download(offset = 0, count, options = {}) { - var _a2; - options.conditions = options.conditions || {}; + async create(size, options = {}) { + var _a2, _b2, _c2; options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - const { span, updatedOptions } = createSpan2("BlobClient-download", options); + const { span, updatedOptions } = createSpan2("PageBlobClient-create", options); try { - const res = await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), requestOptions: { - onDownloadProgress: isNode ? void 0 : options.onProgress - // for Node.js, progress is reported by RetriableReadableStream - }, range: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), rangeGetContentMD5: options.rangeGetContentMD5, rangeGetContentCRC64: options.rangeGetContentCrc64, snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions))); - const wrappedRes = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); - if (!isNode) { - return wrappedRes; - } - if (options.maxRetryRequests === void 0 || options.maxRetryRequests < 0) { - options.maxRetryRequests = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; - } - if (res.contentLength === void 0) { - throw new RangeError(`File download response doesn't contain valid content length header`); - } - if (!res.etag) { - throw new RangeError(`File download response doesn't contain valid etag header`); - } - return new BlobDownloadResponse(wrappedRes, async (start) => { - var _a3; - const updatedDownloadOptions = { - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ifMatch: options.conditions.ifMatch || res.etag, - ifModifiedSince: options.conditions.ifModifiedSince, - ifNoneMatch: options.conditions.ifNoneMatch, - ifUnmodifiedSince: options.conditions.ifUnmodifiedSince, - ifTags: (_a3 = options.conditions) === null || _a3 === void 0 ? void 0 : _a3.tagConditions - }, - range: rangeToString({ - count: offset + res.contentLength - start, - offset: start - }), - rangeGetContentMD5: options.rangeGetContentMD5, - rangeGetContentCRC64: options.rangeGetContentCrc64, - snapshot: options.snapshot, - cpkInfo: options.customerProvidedKey - }; - return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody; - }, offset, res.contentLength, { - maxRetryRequests: options.maxRetryRequests, - onProgress: options.onProgress - }); + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + return await this.pageBlobContext.create(0, size, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, blobSequenceNumber: options.blobSequenceNumber, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, immutabilityPolicyExpiry: (_b2 = options.immutabilityPolicy) === null || _b2 === void 0 ? void 0 : _b2.expiriesOn, immutabilityPolicyMode: (_c2 = options.immutabilityPolicy) === null || _c2 === void 0 ? void 0 : _c2.policyMode, legalHold: options.legalHold, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -51096,30 +67234,28 @@ var init_Clients = __esm({ } } /** - * Returns true if the Azure blob resource represented by this client exists; false otherwise. - * - * NOTE: use this function with care since an existing blob might be deleted by other clients or - * applications. Vice versa new blobs might be added by other clients or applications after this - * function completes. + * Creates a page blob of the specified length. Call uploadPages to upload data + * data to a page blob. If the blob with the same name already exists, the content + * of the existing blob will remain unchanged. + * @see https://docs.microsoft.com/rest/api/storageservices/put-blob * - * @param options - options to Exists operation. + * @param size - size of the page blob. + * @param options - */ - async exists(options = {}) { - const { span, updatedOptions } = createSpan2("BlobClient-exists", options); + async createIfNotExists(size, options = {}) { + var _a2, _b2; + const { span, updatedOptions } = createSpan2("PageBlobClient-createIfNotExists", options); try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - await this.getProperties({ - abortSignal: options.abortSignal, - customerProvidedKey: options.customerProvidedKey, - conditions: options.conditions, - tracingOptions: updatedOptions.tracingOptions - }); - return true; + const conditions = { ifNoneMatch: ETagAny }; + const res = await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions })); + return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); } catch (e2) { - if (e2.statusCode === 404) { - return false; - } else if (e2.statusCode === 409 && (e2.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg || e2.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) { - return true; + if (((_a2 = e2.details) === null || _a2 === void 0 ? void 0 : _a2.errorCode) === "BlobAlreadyExists") { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: "Expected exception when creating a blob only if it does not already exist." + }); + return Object.assign(Object.assign({ succeeded: false }, (_b2 = e2.response) === null || _b2 === void 0 ? void 0 : _b2.parsedHeaders), { _response: e2.response }); } span.setStatus({ code: SpanStatusCode.ERROR, @@ -51131,25 +67267,24 @@ var init_Clients = __esm({ } } /** - * Returns all user-defined metadata, standard HTTP properties, and system properties - * for the blob. It does not return the content of the blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties - * - * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if - * they originally contained uppercase characters. This differs from the metadata keys returned by - * the methods of {@link ContainerClient} that list blobs using the `includeMetadata` option, which - * will retain their original casing. + * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. + * @see https://docs.microsoft.com/rest/api/storageservices/put-page * - * @param options - Optional options to Get Properties operation. + * @param body - Data to upload + * @param offset - Offset of destination page blob + * @param count - Content length of the body, also number of bytes to be uploaded + * @param options - Options to the Page Blob Upload Pages operation. + * @returns Response data for the Page Blob Upload Pages operation. */ - async getProperties(options = {}) { + async uploadPages(body2, offset, count, options = {}) { var _a2; - const { span, updatedOptions } = createSpan2("BlobClient-getProperties", options); + options.conditions = options.conditions || {}; + const { span, updatedOptions } = createSpan2("PageBlobClient-uploadPages", options); try { - options.conditions = options.conditions || {}; ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - const res = await this.blobContext.getProperties(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions))); - return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); + return await this.pageBlobContext.uploadPages(count, body2, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), requestOptions: { + onUploadProgress: options.onProgress + }, range: rangeToString({ offset, count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -51161,20 +67296,29 @@ var init_Clients = __esm({ } } /** - * Marks the specified blob or snapshot for deletion. The blob is later deleted - * during garbage collection. Note that in order to delete a blob, you must delete - * all of its snapshots. You can delete both at the same time with the Delete - * Blob operation. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * The Upload Pages operation writes a range of pages to a page blob where the + * contents are read from a URL. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-page-from-url * - * @param options - Optional options to Blob Delete operation. + * @param sourceURL - Specify a URL to the copy source, Shared Access Signature(SAS) maybe needed for authentication + * @param sourceOffset - The source offset to copy from. Pass 0 to copy from the beginning of source page blob + * @param destOffset - Offset of destination page blob + * @param count - Number of bytes to be uploaded from source page blob + * @param options - */ - async delete(options = {}) { + async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { var _a2; - const { span, updatedOptions } = createSpan2("BlobClient-delete", options); options.conditions = options.conditions || {}; + options.sourceConditions = options.sourceConditions || {}; + const { span, updatedOptions } = createSpan2("PageBlobClient-uploadPagesFromURL", options); try { - return await this.blobContext.delete(Object.assign({ abortSignal: options.abortSignal, deleteSnapshots: options.deleteSnapshots, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); + ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + return await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), Object.assign({ abortSignal: options.abortSignal, sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, sequenceNumberAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), sourceModifiedAccessConditions: { + sourceIfMatch: options.sourceConditions.ifMatch, + sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization) }, convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -51186,28 +67330,21 @@ var init_Clients = __esm({ } } /** - * Marks the specified blob or snapshot for deletion if it exists. The blob is later deleted - * during garbage collection. Note that in order to delete a blob, you must delete - * all of its snapshots. You can delete both at the same time with the Delete - * Blob operation. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * Frees the specified pages from the page blob. + * @see https://docs.microsoft.com/rest/api/storageservices/put-page * - * @param options - Optional options to Blob Delete operation. + * @param offset - Starting byte position of the pages to clear. + * @param count - Number of bytes to clear. + * @param options - Options to the Page Blob Clear Pages operation. + * @returns Response data for the Page Blob Clear Pages operation. */ - async deleteIfExists(options = {}) { - var _a2, _b; - const { span, updatedOptions } = createSpan2("BlobClient-deleteIfExists", options); + async clearPages(offset = 0, count, options = {}) { + var _a2; + options.conditions = options.conditions || {}; + const { span, updatedOptions } = createSpan2("PageBlobClient-clearPages", options); try { - const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return await this.pageBlobContext.clearPages(0, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), range: rangeToString({ offset, count }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { - if (((_a2 = e2.details) === null || _a2 === void 0 ? void 0 : _a2.errorCode) === "BlobNotFound") { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: "Expected exception when deleting a blob or snapshot only if it exists." - }); - return Object.assign(Object.assign({ succeeded: false }, (_b = e2.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e2.response }); - } span.setStatus({ code: SpanStatusCode.ERROR, message: e2.message @@ -51218,17 +67355,20 @@ var init_Clients = __esm({ } } /** - * Restores the contents and metadata of soft deleted blob and any associated - * soft deleted snapshots. Undelete Blob is supported only on version 2017-07-29 - * or later. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob + * Returns the list of valid page ranges for a page blob or snapshot of a page blob. + * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges * - * @param options - Optional options to Blob Undelete operation. + * @param offset - Starting byte position of the page ranges. + * @param count - Number of bytes to get. + * @param options - Options to the Page Blob Get Ranges operation. + * @returns Response data for the Page Blob Get Ranges operation. */ - async undelete(options = {}) { - const { span, updatedOptions } = createSpan2("BlobClient-undelete", options); + async getPageRanges(offset = 0, count, options = {}) { + var _a2; + options.conditions = options.conditions || {}; + const { span, updatedOptions } = createSpan2("PageBlobClient-getPageRanges", options); try { - return await this.blobContext.undelete(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); + return await this.pageBlobContext.getPageRanges(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), range: rangeToString({ offset, count }) }, convertTracingToRequestOptionsBase(updatedOptions))).then(rangeResponseFromModel); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -51240,27 +67380,22 @@ var init_Clients = __esm({ } } /** - * Sets system properties on the blob. - * - * If no value provided, or no value provided for the specified blob HTTP headers, - * these blob HTTP headers without a value will be cleared. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * getPageRangesSegment returns a single segment of page ranges starting from the + * specified Marker. Use an empty Marker to start enumeration from the beginning. + * After getting a segment, process it, and then call getPageRangesSegment again + * (passing the the previously-returned Marker) to get the next segment. + * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges * - * @param blobHTTPHeaders - If no value provided, or no value provided for - * the specified blob HTTP headers, these blob HTTP - * headers without a value will be cleared. - * A common header to set is `blobContentType` - * enabling the browser to provide functionality - * based on file type. - * @param options - Optional options to Blob Set HTTP Headers operation. + * @param offset - Starting byte position of the page ranges. + * @param count - Number of bytes to get. + * @param marker - A string value that identifies the portion of the list to be returned with the next list operation. + * @param options - Options to PageBlob Get Page Ranges Segment operation. */ - async setHTTPHeaders(blobHTTPHeaders, options = {}) { + async listPageRangesSegment(offset = 0, count, marker2, options = {}) { var _a2; - const { span, updatedOptions } = createSpan2("BlobClient-setHTTPHeaders", options); - options.conditions = options.conditions || {}; + const { span, updatedOptions } = createSpan2("PageBlobClient-getPageRangesSegment", options); try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.blobContext.setHttpHeaders(Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); + return await this.pageBlobContext.getPageRanges(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), range: rangeToString({ offset, count }), marker: marker2, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -51272,47 +67407,171 @@ var init_Clients = __esm({ } } /** - * Sets user-defined metadata for the specified blob as one or more name-value pairs. + * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesResponseModel} * - * If no option provided, or no metadata defined in the parameter, the blob - * metadata will be removed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata + * @param offset - Starting byte position of the page ranges. + * @param count - Number of bytes to get. + * @param marker - A string value that identifies the portion of + * the get of page ranges to be returned with the next getting operation. The + * operation returns the ContinuationToken value within the response body if the + * getting operation did not return all page ranges remaining within the current page. + * The ContinuationToken value can be used as the value for + * the marker parameter in a subsequent call to request the next page of get + * items. The marker value is opaque to the client. + * @param options - Options to List Page Ranges operation. + */ + listPageRangeItemSegments(offset = 0, count, marker2, options = {}) { + return __asyncGenerator(this, arguments, function* listPageRangeItemSegments_1() { + let getPageRangeItemSegmentsResponse; + if (!!marker2 || marker2 === void 0) { + do { + getPageRangeItemSegmentsResponse = yield __await(this.listPageRangesSegment(offset, count, marker2, options)); + marker2 = getPageRangeItemSegmentsResponse.continuationToken; + yield yield __await(yield __await(getPageRangeItemSegmentsResponse)); + } while (marker2); + } + }); + } + /** + * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects + * + * @param offset - Starting byte position of the page ranges. + * @param count - Number of bytes to get. + * @param options - Options to List Page Ranges operation. + */ + listPageRangeItems(offset = 0, count, options = {}) { + return __asyncGenerator(this, arguments, function* listPageRangeItems_1() { + var e_1, _a2; + let marker2; + try { + for (var _b2 = __asyncValues(this.listPageRangeItemSegments(offset, count, marker2, options)), _c2; _c2 = yield __await(_b2.next()), !_c2.done; ) { + const getPageRangesSegment = _c2.value; + yield __await(yield* __asyncDelegator(__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (_c2 && !_c2.done && (_a2 = _b2.return)) + yield __await(_a2.call(_b2)); + } finally { + if (e_1) + throw e_1.error; + } + } + }); + } + /** + * Returns an async iterable iterator to list of page ranges for a page blob. + * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * + * .byPage() returns an async iterable iterator to list of page ranges for a page blob. + * + * Example using `for await` syntax: + * + * ```js + * // Get the pageBlobClient before you run these snippets, + * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` + * let i = 1; + * for await (const pageRange of pageBlobClient.listPageRanges()) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * } + * ``` + * + * Example using `iter.next()`: + * + * ```js + * let i = 1; + * let iter = pageBlobClient.listPageRanges(); + * let pageRangeItem = await iter.next(); + * while (!pageRangeItem.done) { + * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); + * pageRangeItem = await iter.next(); + * } + * ``` + * + * Example using `byPage()`: + * + * ```js + * // passing optional maxPageSize in the page settings + * let i = 1; + * for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { + * for (const pageRange of response) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * } + * } + * ``` + * + * Example using paging with a marker: + * + * ```js + * let i = 1; + * let iterator = pageBlobClient.listPageRanges().byPage({ maxPageSize: 2 }); + * let response = (await iterator.next()).value; + * + * // Prints 2 page ranges + * for (const pageRange of response) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * } + * + * // Gets next marker + * let marker = response.continuationToken; + * + * // Passing next marker as continuationToken + * + * iterator = pageBlobClient.listPageRanges().byPage({ continuationToken: marker, maxPageSize: 10 }); + * response = (await iterator.next()).value; * - * @param metadata - Replace existing metadata with this value. - * If no value provided the existing metadata will be removed. - * @param options - Optional options to Set Metadata operation. + * // Prints 10 page ranges + * for (const blob of response) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * } + * ``` + * @param offset - Starting byte position of the page ranges. + * @param count - Number of bytes to get. + * @param options - Options to the Page Blob Get Ranges operation. + * @returns An asyncIterableIterator that supports paging. */ - async setMetadata(metadata3, options = {}) { - var _a2; - const { span, updatedOptions } = createSpan2("BlobClient-setMetadata", options); + listPageRanges(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.blobContext.setMetadata(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: metadata3, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } + const iter = this.listPageRangeItems(offset, count, options); + return { + /** + * The next method, part of the iteration protocol + */ + next() { + return iter.next(); + }, + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator]() { + return this; + }, + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings2 = {}) => { + return this.listPageRangeItemSegments(offset, count, settings2.continuationToken, Object.assign({ maxPageSize: settings2.maxPageSize }, options)); + } + }; } /** - * Sets tags on the underlying blob. - * A blob can have up to 10 tags. Tag keys must be between 1 and 128 characters. Tag values must be between 0 and 256 characters. - * Valid tag key and value characters include lower and upper case letters, digits (0-9), - * space (' '), plus ('+'), minus ('-'), period ('.'), foward slash ('/'), colon (':'), equals ('='), and underscore ('_'). + * Gets the collection of page ranges that differ between a specified snapshot and this page blob. + * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges * - * @param tags - - * @param options - + * @param offset - Starting byte position of the page blob + * @param count - Number of bytes to get ranges diff. + * @param prevSnapshot - Timestamp of snapshot to retrieve the difference. + * @param options - Options to the Page Blob Get Page Ranges Diff operation. + * @returns Response data for the Page Blob Get Page Range Diff operation. */ - async setTags(tags2, options = {}) { + async getPageRangesDiff(offset, count, prevSnapshot, options = {}) { var _a2; - const { span, updatedOptions } = createSpan2("BlobClient-setTags", options); + options.conditions = options.conditions || {}; + const { span, updatedOptions } = createSpan2("PageBlobClient-getPageRangesDiff", options); try { - return await this.blobContext.setTags(Object.assign(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)), { tags: toBlobTags(tags2) })); + return await this.pageBlobContext.getPageRangesDiff(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), prevsnapshot: prevSnapshot, range: rangeToString({ offset, count }) }, convertTracingToRequestOptionsBase(updatedOptions))).then(rangeResponseFromModel); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -51324,17 +67583,27 @@ var init_Clients = __esm({ } } /** - * Gets the tags associated with the underlying blob. + * getPageRangesDiffSegment returns a single segment of page ranges starting from the + * specified Marker for difference between previous snapshot and the target page blob. + * Use an empty Marker to start enumeration from the beginning. + * After getting a segment, process it, and then call getPageRangesDiffSegment again + * (passing the the previously-returned Marker) to get the next segment. + * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges * - * @param options - + * @param offset - Starting byte position of the page ranges. + * @param count - Number of bytes to get. + * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference. + * @param marker - A string value that identifies the portion of the get to be returned with the next get operation. + * @param options - Options to the Page Blob Get Page Ranges Diff operation. */ - async getTags(options = {}) { + async listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options) { var _a2; - const { span, updatedOptions } = createSpan2("BlobClient-getTags", options); + const { span, updatedOptions } = createSpan2("PageBlobClient-getPageRangesDiffSegment", options); try { - const response = await this.blobContext.getTags(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); - return wrappedResponse; + return await this.pageBlobContext.getPageRangesDiff(Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a2 = options === null || options === void 0 ? void 0 : options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), prevsnapshot: prevSnapshotOrUrl, range: rangeToString({ + offset, + count + }), marker: marker2, maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -51346,280 +67615,175 @@ var init_Clients = __esm({ } } /** - * Get a {@link BlobLeaseClient} that manages leases on the blob. + * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesDiffResponseModel} * - * @param proposeLeaseId - Initial proposed lease Id. - * @returns A new BlobLeaseClient object for managing leases on the blob. + * + * @param offset - Starting byte position of the page ranges. + * @param count - Number of bytes to get. + * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference. + * @param marker - A string value that identifies the portion of + * the get of page ranges to be returned with the next getting operation. The + * operation returns the ContinuationToken value within the response body if the + * getting operation did not return all page ranges remaining within the current page. + * The ContinuationToken value can be used as the value for + * the marker parameter in a subsequent call to request the next page of get + * items. The marker value is opaque to the client. + * @param options - Options to the Page Blob Get Page Ranges Diff operation. */ - getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options) { + return __asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() { + let getPageRangeItemSegmentsResponse; + if (!!marker2 || marker2 === void 0) { + do { + getPageRangeItemSegmentsResponse = yield __await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options)); + marker2 = getPageRangeItemSegmentsResponse.continuationToken; + yield yield __await(yield __await(getPageRangeItemSegmentsResponse)); + } while (marker2); + } + }); } /** - * Creates a read-only snapshot of a blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-blob + * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects * - * @param options - Optional options to the Blob Create Snapshot operation. + * @param offset - Starting byte position of the page ranges. + * @param count - Number of bytes to get. + * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference. + * @param options - Options to the Page Blob Get Page Ranges Diff operation. */ - async createSnapshot(options = {}) { - var _a2; - const { span, updatedOptions } = createSpan2("BlobClient-createSnapshot", options); - options.conditions = options.conditions || {}; - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.blobContext.createSnapshot(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } + listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { + return __asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() { + var e_2, _a2; + let marker2; + try { + for (var _b2 = __asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options)), _c2; _c2 = yield __await(_b2.next()), !_c2.done; ) { + const getPageRangesSegment = _c2.value; + yield __await(yield* __asyncDelegator(__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); + } + } catch (e_2_1) { + e_2 = { error: e_2_1 }; + } finally { + try { + if (_c2 && !_c2.done && (_a2 = _b2.return)) + yield __await(_a2.call(_b2)); + } finally { + if (e_2) + throw e_2.error; + } + } + }); } /** - * Asynchronously copies a blob to a destination within the storage account. - * This method returns a long running operation poller that allows you to wait - * indefinitely until the copy is completed. - * You can also cancel a copy before it is completed by calling `cancelOperation` on the poller. - * Note that the onProgress callback will not be invoked if the operation completes in the first - * request, and attempting to cancel a completed copy will result in an error being thrown. + * Returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob. + * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges * - * In version 2012-02-12 and later, the source for a Copy Blob operation can be - * a committed blob in any Azure storage account. - * Beginning with version 2015-02-21, the source for a Copy Blob operation can be - * an Azure file in any Azure storage account. - * Only storage accounts created on or after June 7th, 2012 allow the Copy Blob - * operation to copy from another storage account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * .byPage() returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob. * - * Example using automatic polling: + * Example using `for await` syntax: * * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * const result = await copyPoller.pollUntilDone(); + * // Get the pageBlobClient before you run these snippets, + * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` + * let i = 1; + * for await (const pageRange of pageBlobClient.listPageRangesDiff()) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * } * ``` * - * Example using manual polling: + * Example using `iter.next()`: * * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * while (!poller.isDone()) { - * await poller.poll(); + * let i = 1; + * let iter = pageBlobClient.listPageRangesDiff(); + * let pageRangeItem = await iter.next(); + * while (!pageRangeItem.done) { + * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); + * pageRangeItem = await iter.next(); * } - * const result = copyPoller.getResult(); * ``` * - * Example using progress updates: + * Example using `byPage()`: * * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * onProgress(state) { - * console.log(`Progress: ${state.copyProgress}`); + * // passing optional maxPageSize in the page settings + * let i = 1; + * for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) { + * for (const pageRange of response) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); * } - * }); - * const result = await copyPoller.pollUntilDone(); + * } * ``` * - * Example using a changing polling interval (default 15 seconds): + * Example using paging with a marker: * * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * intervalInMs: 1000 // poll blob every 1 second for copy progress - * }); - * const result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using copy cancellation: + * let i = 1; + * let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 }); + * let response = (await iterator.next()).value; * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * // cancel operation after starting it. - * try { - * await copyPoller.cancelOperation(); - * // calls to get the result now throw PollerCancelledError - * await copyPoller.getResult(); - * } catch (err) { - * if (err.name === 'PollerCancelledError') { - * console.log('The copy was cancelled.'); - * } + * // Prints 2 page ranges + * for (const pageRange of response) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); * } - * ``` * - * @param copySource - url to the source Azure Blob/File. - * @param options - Optional options to the Blob Start Copy From URL operation. - */ - async beginCopyFromURL(copySource2, options = {}) { - const client = { - abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), - getProperties: (...args) => this.getProperties(...args), - startCopyFromURL: (...args) => this.startCopyFromURL(...args) - }; - const poller = new BlobBeginCopyFromUrlPoller({ - blobClient: client, - copySource: copySource2, - intervalInMs: options.intervalInMs, - onProgress: options.onProgress, - resumeFrom: options.resumeFrom, - startCopyFromURLOptions: options - }); - await poller.poll(); - return poller; - } - /** - * Aborts a pending asynchronous Copy Blob operation, and leaves a destination blob with zero - * length and full metadata. Version 2012-02-12 and newer. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob + * // Gets next marker + * let marker = response.continuationToken; * - * @param copyId - Id of the Copy From URL operation. - * @param options - Optional options to the Blob Abort Copy From URL operation. - */ - async abortCopyFromURL(copyId2, options = {}) { - const { span, updatedOptions } = createSpan2("BlobClient-abortCopyFromURL", options); - try { - return await this.blobContext.abortCopyFromURL(copyId2, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } - } - /** - * The synchronous Copy From URL operation copies a blob or an internet resource to a new blob. It will not - * return a response until the copy is complete. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url + * // Passing next marker as continuationToken * - * @param copySource - The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication - * @param options - + * iterator = pageBlobClient.listPageRangesDiff().byPage({ continuationToken: marker, maxPageSize: 10 }); + * response = (await iterator.next()).value; + * + * // Prints 10 page ranges + * for (const blob of response) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * } + * ``` + * @param offset - Starting byte position of the page ranges. + * @param count - Number of bytes to get. + * @param prevSnapshot - Timestamp of snapshot to retrieve the difference. + * @param options - Options to the Page Blob Get Ranges operation. + * @returns An asyncIterableIterator that supports paging. */ - async syncCopyFromURL(copySource2, options = {}) { - var _a2, _b, _c; - const { span, updatedOptions } = createSpan2("BlobClient-syncCopyFromURL", options); + listPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - try { - return await this.blobContext.copyFromURL(copySource2, Object.assign({ abortSignal: options.abortSignal, metadata: options.metadata, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: options.sourceConditions.ifMatch, - sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, - sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince - }, sourceContentMD5: options.sourceContentMD5, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, encryptionScope: options.encryptionScope, copySourceTags: options.copySourceTags }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } + const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options)); + return { + /** + * The next method, part of the iteration protocol + */ + next() { + return iter.next(); + }, + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator]() { + return this; + }, + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings2 = {}) => { + return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings2.continuationToken, Object.assign({ maxPageSize: settings2.maxPageSize }, options)); + } + }; } /** - * Sets the tier on a blob. The operation is allowed on a page blob in a premium - * storage account and on a block blob in a blob storage account (locally redundant - * storage only). A premium page blob's tier determines the allowed size, IOPS, - * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive - * storage type. This operation does not update the blob's ETag. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier + * Gets the collection of page ranges that differ between a specified snapshot and this page blob for managed disks. + * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges * - * @param tier - The tier to be set on the blob. Valid values are Hot, Cool, or Archive. - * @param options - Optional options to the Blob Set Tier operation. + * @param offset - Starting byte position of the page blob + * @param count - Number of bytes to get ranges diff. + * @param prevSnapshotUrl - URL of snapshot to retrieve the difference. + * @param options - Options to the Page Blob Get Page Ranges Diff operation. + * @returns Response data for the Page Blob Get Page Range Diff operation. */ - async setAccessTier(tier2, options = {}) { + async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl2, options = {}) { var _a2; - const { span, updatedOptions } = createSpan2("BlobClient-setAccessTier", options); - try { - return await this.blobContext.setTier(toAccessTier(tier2), Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), rehydratePriority: options.rehydratePriority }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } - } - async downloadToBuffer(param1, param2, param3, param4 = {}) { - let buffer; - let offset = 0; - let count = 0; - let options = param4; - if (param1 instanceof Buffer) { - buffer = param1; - offset = param2 || 0; - count = typeof param3 === "number" ? param3 : 0; - } else { - offset = typeof param1 === "number" ? param1 : 0; - count = typeof param2 === "number" ? param2 : 0; - options = param3 || {}; - } - const { span, updatedOptions } = createSpan2("BlobClient-downloadToBuffer", options); + options.conditions = options.conditions || {}; + const { span, updatedOptions } = createSpan2("PageBlobClient-GetPageRangesDiffForManagedDisks", options); try { - if (!options.blockSize) { - options.blockSize = 0; - } - if (options.blockSize < 0) { - throw new RangeError("blockSize option must be >= 0"); - } - if (options.blockSize === 0) { - options.blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; - } - if (offset < 0) { - throw new RangeError("offset option must be >= 0"); - } - if (count && count <= 0) { - throw new RangeError("count option must be greater than 0"); - } - if (!options.conditions) { - options.conditions = {}; - } - if (!count) { - const response = await this.getProperties(Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) })); - count = response.contentLength - offset; - if (count < 0) { - throw new RangeError(`offset ${offset} shouldn't be larger than blob size ${response.contentLength}`); - } - } - if (!buffer) { - try { - buffer = Buffer.alloc(count); - } catch (error) { - throw new Error(`Unable to allocate the buffer of size: ${count}(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile". ${error.message}`); - } - } - if (buffer.length < count) { - throw new RangeError(`The buffer's size should be equal to or larger than the request count of bytes: ${count}`); - } - let transferProgress = 0; - const batch = new Batch(options.concurrency); - for (let off = offset; off < offset + count; off = off + options.blockSize) { - batch.addOperation(async () => { - let chunkEnd = offset + count; - if (off + options.blockSize < chunkEnd) { - chunkEnd = off + options.blockSize; - } - const response = await this.download(off, chunkEnd - off, { - abortSignal: options.abortSignal, - conditions: options.conditions, - maxRetryRequests: options.maxRetryRequestsPerBlock, - customerProvidedKey: options.customerProvidedKey, - tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) - }); - const stream = response.readableStreamBody; - await streamToBuffer(stream, buffer, off - offset, chunkEnd - offset); - transferProgress += chunkEnd - off; - if (options.onProgress) { - options.onProgress({ loadedBytes: transferProgress }); - } - }); - } - await batch.do(); - return buffer; + return await this.pageBlobContext.getPageRangesDiff(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), prevSnapshotUrl: prevSnapshotUrl2, range: rangeToString({ offset, count }) }, convertTracingToRequestOptionsBase(updatedOptions))).then(rangeResponseFromModel); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -51631,30 +67795,19 @@ var init_Clients = __esm({ } } /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Downloads an Azure Blob to a local file. - * Fails if the the given file path already exits. - * Offset and count are optional, pass 0 and undefined respectively to download the entire blob. + * Resizes the page blob to the specified size (which must be a multiple of 512). + * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties * - * @param filePath - - * @param offset - From which position of the block blob to download. - * @param count - How much data to be downloaded. Will download to the end when passing undefined. - * @param options - Options to Blob download options. - * @returns The response data for blob download operation, - * but with readableStreamBody set to undefined since its - * content is already read and written into a local file - * at the specified path. + * @param size - Target size + * @param options - Options to the Page Blob Resize operation. + * @returns Response data for the Page Blob Resize operation. */ - async downloadToFile(filePath, offset = 0, count, options = {}) { - const { span, updatedOptions } = createSpan2("BlobClient-downloadToFile", options); + async resize(size, options = {}) { + var _a2; + options.conditions = options.conditions || {}; + const { span, updatedOptions } = createSpan2("PageBlobClient-resize", options); try { - const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) })); - if (response.readableStreamBody) { - await readStreamToLocalFile(response.readableStreamBody, filePath); - } - response.blobDownloadStream = void 0; - return response; + return await this.pageBlobContext.resize(size, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -51665,61 +67818,21 @@ var init_Clients = __esm({ span.end(); } } - getBlobAndContainerNamesFromUrl() { - let containerName; - let blobName; - try { - const parsedUrl = URLBuilder.parse(this.url); - if (parsedUrl.getHost().split(".")[1] === "blob") { - const pathComponents = parsedUrl.getPath().match("/([^/]*)(/(.*))?"); - containerName = pathComponents[1]; - blobName = pathComponents[3]; - } else if (isIpEndpointStyle(parsedUrl)) { - const pathComponents = parsedUrl.getPath().match("/([^/]*)/([^/]*)(/(.*))?"); - containerName = pathComponents[2]; - blobName = pathComponents[4]; - } else { - const pathComponents = parsedUrl.getPath().match("/([^/]*)(/(.*))?"); - containerName = pathComponents[1]; - blobName = pathComponents[3]; - } - containerName = decodeURIComponent(containerName); - blobName = decodeURIComponent(blobName); - blobName = blobName.replace(/\\/g, "/"); - if (!containerName) { - throw new Error("Provided containerName is invalid."); - } - return { blobName, containerName }; - } catch (error) { - throw new Error("Unable to extract blobName and containerName with provided information."); - } - } /** - * Asynchronously copies a blob to a destination within the storage account. - * In version 2012-02-12 and later, the source for a Copy Blob operation can be - * a committed blob in any Azure storage account. - * Beginning with version 2015-02-21, the source for a Copy Blob operation can be - * an Azure file in any Azure storage account. - * Only storage accounts created on or after June 7th, 2012 allow the Copy Blob - * operation to copy from another storage account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * Sets a page blob's sequence number. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties * - * @param copySource - url to the source Azure Blob/File. - * @param options - Optional options to the Blob Start Copy From URL operation. + * @param sequenceNumberAction - Indicates how the service should modify the blob's sequence number. + * @param sequenceNumber - Required if sequenceNumberAction is max or update + * @param options - Options to the Page Blob Update Sequence Number operation. + * @returns Response data for the Page Blob Update Sequence Number operation. */ - async startCopyFromURL(copySource2, options = {}) { - var _a2, _b, _c; - const { span, updatedOptions } = createSpan2("BlobClient-startCopyFromURL", options); + async updateSequenceNumber(sequenceNumberAction2, sequenceNumber, options = {}) { + var _a2; options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; + const { span, updatedOptions } = createSpan2("PageBlobClient-updateSequenceNumber", options); try { - return await this.blobContext.startCopyFromURL(copySource2, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: options.sourceConditions.ifMatch, - sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, - sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, - sourceIfTags: options.sourceConditions.tagConditions - }, immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, rehydratePriority: options.rehydratePriority, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), sealBlob: options.sealBlob }, convertTracingToRequestOptionsBase(updatedOptions))); + return await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction2, Object.assign({ abortSignal: options.abortSignal, blobSequenceNumber: sequenceNumber, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -51731,34 +67844,23 @@ var init_Clients = __esm({ } } /** - * Only available for BlobClient constructed with a shared key credential. - * - * Generates a Blob Service Shared Access Signature (SAS) URI based on the client properties - * and parameters passed in. The SAS is signed by the shared key credential of the client. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas - * - * @param options - Optional parameters. - * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. - */ - generateSasUrl(options) { - return new Promise((resolve2) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); - } - const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString(); - resolve2(appendToURLQuery(this.url, sas)); - }); - } - /** - * Delete the immutablility policy on the blob. + * Begins an operation to start an incremental copy from one page blob's snapshot to this page blob. + * The snapshot is copied such that only the differential changes between the previously + * copied snapshot are transferred to the destination. + * The copied snapshots are complete copies of the original snapshot and can be read or copied from as usual. + * @see https://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob + * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots * - * @param options - Optional options to delete immutability policy on the blob. + * @param copySource - Specifies the name of the source page blob snapshot. For example, + * https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot= + * @param options - Options to the Page Blob Copy Incremental operation. + * @returns Response data for the Page Blob Copy Incremental operation. */ - async deleteImmutabilityPolicy(options) { - const { span, updatedOptions } = createSpan2("BlobClient-deleteImmutabilityPolicy", options); + async startCopyIncremental(copySource2, options = {}) { + var _a2; + const { span, updatedOptions } = createSpan2("PageBlobClient-startCopyIncremental", options); try { - return await this.blobContext.deleteImmutabilityPolicy(Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); + return await this.pageBlobContext.copyIncremental(copySource2, Object.assign({ abortSignal: options.abortSignal, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -51769,15 +67871,278 @@ var init_Clients = __esm({ span.end(); } } + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BatchUtils.js +async function getBodyAsText(batchResponse) { + let buffer = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES); + const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer); + buffer = buffer.slice(0, responseLength); + return buffer.toString(); +} +function utf8ByteLength(str) { + return Buffer.byteLength(str); +} +var init_BatchUtils = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BatchUtils.js"() { + init_utils_node(); + init_constants2(); + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BatchResponseParser.js +var HTTP_HEADER_DELIMITER, SPACE_DELIMITER, NOT_FOUND, BatchResponseParser; +var init_BatchResponseParser = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BatchResponseParser.js"() { + init_src5(); + init_constants2(); + init_BatchUtils(); + init_log3(); + HTTP_HEADER_DELIMITER = ": "; + SPACE_DELIMITER = " "; + NOT_FOUND = -1; + BatchResponseParser = class { + constructor(batchResponse, subRequests) { + if (!batchResponse || !batchResponse.contentType) { + throw new RangeError("batchResponse is malformed or doesn't contain valid content-type."); + } + if (!subRequests || subRequests.size === 0) { + throw new RangeError("Invalid state: subRequests is not provided or size is 0."); + } + this.batchResponse = batchResponse; + this.subRequests = subRequests; + this.responseBatchBoundary = this.batchResponse.contentType.split("=")[1]; + this.perResponsePrefix = `--${this.responseBatchBoundary}${HTTP_LINE_ENDING}`; + this.batchResponseEnding = `--${this.responseBatchBoundary}--`; + } + // For example of response, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#response + async parseBatchResponse() { + if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) { + throw new Error(`Invalid state: batch request failed with status: '${this.batchResponse._response.status}'.`); + } + const responseBodyAsText = await getBodyAsText(this.batchResponse); + const subResponses = responseBodyAsText.split(this.batchResponseEnding)[0].split(this.perResponsePrefix).slice(1); + const subResponseCount = subResponses.length; + if (subResponseCount !== this.subRequests.size && subResponseCount !== 1) { + throw new Error("Invalid state: sub responses' count is not equal to sub requests' count."); + } + const deserializedSubResponses = new Array(subResponseCount); + let subResponsesSucceededCount = 0; + let subResponsesFailedCount = 0; + for (let index = 0; index < subResponseCount; index++) { + const subResponse = subResponses[index]; + const deserializedSubResponse = {}; + deserializedSubResponse.headers = new HttpHeaders(); + const responseLines = subResponse.split(`${HTTP_LINE_ENDING}`); + let subRespHeaderStartFound = false; + let subRespHeaderEndFound = false; + let subRespFailed = false; + let contentId = NOT_FOUND; + for (const responseLine of responseLines) { + if (!subRespHeaderStartFound) { + if (responseLine.startsWith(HeaderConstants.CONTENT_ID)) { + contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); + } + if (responseLine.startsWith(HTTP_VERSION_1_1)) { + subRespHeaderStartFound = true; + const tokens = responseLine.split(SPACE_DELIMITER); + deserializedSubResponse.status = parseInt(tokens[1]); + deserializedSubResponse.statusMessage = tokens.slice(2).join(SPACE_DELIMITER); + } + continue; + } + if (responseLine.trim() === "") { + if (!subRespHeaderEndFound) { + subRespHeaderEndFound = true; + } + continue; + } + if (!subRespHeaderEndFound) { + if (responseLine.indexOf(HTTP_HEADER_DELIMITER) === -1) { + throw new Error(`Invalid state: find non-empty line '${responseLine}' without HTTP header delimiter '${HTTP_HEADER_DELIMITER}'.`); + } + const tokens = responseLine.split(HTTP_HEADER_DELIMITER); + deserializedSubResponse.headers.set(tokens[0], tokens[1]); + if (tokens[0] === HeaderConstants.X_MS_ERROR_CODE) { + deserializedSubResponse.errorCode = tokens[1]; + subRespFailed = true; + } + } else { + if (!deserializedSubResponse.bodyAsText) { + deserializedSubResponse.bodyAsText = ""; + } + deserializedSubResponse.bodyAsText += responseLine; + } + } + if (contentId !== NOT_FOUND && Number.isInteger(contentId) && contentId >= 0 && contentId < this.subRequests.size && deserializedSubResponses[contentId] === void 0) { + deserializedSubResponse._request = this.subRequests.get(contentId); + deserializedSubResponses[contentId] = deserializedSubResponse; + } else { + logger2.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); + } + if (subRespFailed) { + subResponsesFailedCount++; + } else { + subResponsesSucceededCount++; + } + } + return { + subResponses: deserializedSubResponses, + subResponsesSucceededCount, + subResponsesFailedCount + }; + } + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/Mutex.js +var MutexLockStatus, Mutex; +var init_Mutex = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/Mutex.js"() { + (function(MutexLockStatus2) { + MutexLockStatus2[MutexLockStatus2["LOCKED"] = 0] = "LOCKED"; + MutexLockStatus2[MutexLockStatus2["UNLOCKED"] = 1] = "UNLOCKED"; + })(MutexLockStatus || (MutexLockStatus = {})); + Mutex = class { + /** + * Lock for a specific key. If the lock has been acquired by another customer, then + * will wait until getting the lock. + * + * @param key - lock key + */ + static async lock(key) { + return new Promise((resolve2) => { + if (this.keys[key] === void 0 || this.keys[key] === MutexLockStatus.UNLOCKED) { + this.keys[key] = MutexLockStatus.LOCKED; + resolve2(); + } else { + this.onUnlockEvent(key, () => { + this.keys[key] = MutexLockStatus.LOCKED; + resolve2(); + }); + } + }); + } /** - * Set immutablility policy on the blob. + * Unlock a key. * - * @param options - Optional options to set immutability policy on the blob. + * @param key - */ - async setImmutabilityPolicy(immutabilityPolicy, options) { - const { span, updatedOptions } = createSpan2("BlobClient-setImmutabilityPolicy", options); + static async unlock(key) { + return new Promise((resolve2) => { + if (this.keys[key] === MutexLockStatus.LOCKED) { + this.emitUnlockEvent(key); + } + delete this.keys[key]; + resolve2(); + }); + } + static onUnlockEvent(key, handler) { + if (this.listeners[key] === void 0) { + this.listeners[key] = [handler]; + } else { + this.listeners[key].push(handler); + } + } + static emitUnlockEvent(key) { + if (this.listeners[key] !== void 0 && this.listeners[key].length > 0) { + const handler = this.listeners[key].shift(); + setImmediate(() => { + handler.call(this); + }); + } + } + }; + Mutex.keys = {}; + Mutex.listeners = {}; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobBatch.js +var BlobBatch, InnerBatchRequest, BatchRequestAssemblePolicy, BatchRequestAssemblePolicyFactory, BatchHeaderFilterPolicy, BatchHeaderFilterPolicyFactory; +var init_BlobBatch = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobBatch.js"() { + init_src5(); + init_src4(); + init_AnonymousCredential(); + init_Clients(); + init_Mutex(); + init_Pipeline(); + init_utils_common(); + init_constants2(); + init_StorageSharedKeyCredential(); + init_tracing(); + BlobBatch = class { + constructor() { + this.batch = "batch"; + this.batchRequest = new InnerBatchRequest(); + } + /** + * Get the value of Content-Type for a batch request. + * The value must be multipart/mixed with a batch boundary. + * Example: multipart/mixed; boundary=batch_a81786c8-e301-4e42-a729-a32ca24ae252 + */ + getMultiPartContentType() { + return this.batchRequest.getMultipartContentType(); + } + /** + * Get assembled HTTP request body for sub requests. + */ + getHttpRequestBody() { + return this.batchRequest.getHttpRequestBody(); + } + /** + * Get sub requests that are added into the batch request. + */ + getSubRequests() { + return this.batchRequest.getSubRequests(); + } + async addSubRequestInternal(subRequest, assembleSubRequestFunc) { + await Mutex.lock(this.batch); try { - return await this.blobContext.setImmutabilityPolicy(Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, immutabilityPolicyExpiry: immutabilityPolicy.expiriesOn, immutabilityPolicyMode: immutabilityPolicy.policyMode, modifiedAccessConditions: options === null || options === void 0 ? void 0 : options.modifiedAccessCondition }, convertTracingToRequestOptionsBase(updatedOptions))); + this.batchRequest.preAddSubRequest(subRequest); + await assembleSubRequestFunc(); + this.batchRequest.postAddSubRequest(subRequest); + } finally { + await Mutex.unlock(this.batch); + } + } + setBatchType(batchType) { + if (!this.batchType) { + this.batchType = batchType; + } + if (this.batchType !== batchType) { + throw new RangeError(`BlobBatch only supports one operation type per batch and it already is being used for ${this.batchType} operations.`); + } + } + async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { + let url2; + let credential; + if (typeof urlOrBlobClient === "string" && (isNode && credentialOrOptions instanceof StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential || isTokenCredential(credentialOrOptions))) { + url2 = urlOrBlobClient; + credential = credentialOrOptions; + } else if (urlOrBlobClient instanceof BlobClient) { + url2 = urlOrBlobClient.url; + credential = urlOrBlobClient.credential; + options = credentialOrOptions; + } else { + throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); + } + if (!options) { + options = {}; + } + const { span, updatedOptions } = createSpan2("BatchDeleteRequest-addSubRequest", options); + try { + this.setBatchType("delete"); + await this.addSubRequestInternal({ + url: url2, + credential + }, async () => { + await new BlobClient(url2, this.batchRequest.createPipeline(credential)).delete(updatedOptions); + }); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -51788,15 +68153,34 @@ var init_Clients = __esm({ span.end(); } } - /** - * Set legal hold on the blob. - * - * @param options - Optional options to set legal hold on the blob. - */ - async setLegalHold(legalHoldEnabled, options) { - const { span, updatedOptions } = createSpan2("BlobClient-setLegalHold", options); + async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { + let url2; + let credential; + let tier2; + if (typeof urlOrBlobClient === "string" && (isNode && credentialOrTier instanceof StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential || isTokenCredential(credentialOrTier))) { + url2 = urlOrBlobClient; + credential = credentialOrTier; + tier2 = tierOrOptions; + } else if (urlOrBlobClient instanceof BlobClient) { + url2 = urlOrBlobClient.url; + credential = urlOrBlobClient.credential; + tier2 = credentialOrTier; + options = tierOrOptions; + } else { + throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); + } + if (!options) { + options = {}; + } + const { span, updatedOptions } = createSpan2("BatchSetTierRequest-addSubRequest", options); try { - return await this.blobContext.setLegalHold(legalHoldEnabled, Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); + this.setBatchType("setAccessTier"); + await this.addSubRequestInternal({ + url: url2, + credential + }, async () => { + await new BlobClient(url2, this.batchRequest.createPipeline(credential)).setAccessTier(tier2, updatedOptions); + }); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -51808,212 +68192,241 @@ var init_Clients = __esm({ } } }; - AppendBlobClient = class _AppendBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { - let pipeline; - let url2; - options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } else if (isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { - const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); - if (!options.proxyOptions) { - options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); - } - pipeline = newPipeline(sharedKeyCredential, options); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } else if (extractedCreds.kind === "SASConnString") { - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); + InnerBatchRequest = class { + constructor() { + this.operationCount = 0; + this.body = ""; + const tempGuid = generateUuid(); + this.boundary = `batch_${tempGuid}`; + this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`; + this.multipartContentType = `multipart/mixed; boundary=${this.boundary}`; + this.batchRequestEnding = `--${this.boundary}--`; + this.subRequests = /* @__PURE__ */ new Map(); + } + /** + * Create pipeline to assemble sub requests. The idea here is to use existing + * credential and serialization/deserialization components, with additional policies to + * filter unnecessary headers, assemble sub requests into request's body + * and intercept request from going to wire. + * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used. + */ + createPipeline(credential) { + const isAnonymousCreds = credential instanceof AnonymousCredential; + const policyFactoryLength = 3 + (isAnonymousCreds ? 0 : 1); + const factories = new Array(policyFactoryLength); + factories[0] = deserializationPolicy(); + factories[1] = new BatchHeaderFilterPolicyFactory(); + if (!isAnonymousCreds) { + factories[2] = isTokenCredential(credential) ? attachCredential(bearerTokenAuthenticationPolicy(credential, StorageOAuthScopes), credential) : credential; + } + factories[policyFactoryLength - 1] = new BatchRequestAssemblePolicyFactory(this); + return new Pipeline(factories, {}); + } + appendSubRequestToBody(request) { + this.body += [ + this.subRequestPrefix, + `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, + "", + `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` + // sub request start line with method + ].join(HTTP_LINE_ENDING); + for (const header of request.headers.headersArray()) { + this.body += `${header.name}: ${header.value}${HTTP_LINE_ENDING}`; + } + this.body += HTTP_LINE_ENDING; + } + preAddSubRequest(subRequest) { + if (this.operationCount >= BATCH_MAX_REQUEST) { + throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`); + } + const path14 = getURLPath(subRequest.url); + if (!path14 || path14 === "") { + throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); + } + } + postAddSubRequest(subRequest) { + this.subRequests.set(this.operationCount, subRequest); + this.operationCount++; + } + // Return the http request body with assembling the ending line to the sub request body. + getHttpRequestBody() { + return `${this.body}${this.batchRequestEnding}${HTTP_LINE_ENDING}`; + } + getMultipartContentType() { + return this.multipartContentType; + } + getSubRequests() { + return this.subRequests; + } + }; + BatchRequestAssemblePolicy = class extends BaseRequestPolicy { + constructor(batchRequest, nextPolicy, options) { + super(nextPolicy, options); + this.dummyResponse = { + request: new WebResource(), + status: 200, + headers: new HttpHeaders() + }; + this.batchRequest = batchRequest; + } + async sendRequest(request) { + await this.batchRequest.appendSubRequestToBody(request); + return this.dummyResponse; + } + }; + BatchRequestAssemblePolicyFactory = class { + constructor(batchRequest) { + this.batchRequest = batchRequest; + } + create(nextPolicy, options) { + return new BatchRequestAssemblePolicy(this.batchRequest, nextPolicy, options); + } + }; + BatchHeaderFilterPolicy = class extends BaseRequestPolicy { + // The base class has a protected constructor. Adding a public one to enable constructing of this class. + /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/ + constructor(nextPolicy, options) { + super(nextPolicy, options); + } + async sendRequest(request) { + let xMsHeaderName = ""; + for (const header of request.headers.headersArray()) { + if (iEqual(header.name, HeaderConstants.X_MS_VERSION)) { + xMsHeaderName = header.name; } - } else { - throw new Error("Expecting non-empty strings for containerName and blobName parameters"); } - super(url2, pipeline); - this.appendBlobContext = new AppendBlob(this.storageClientContext); + if (xMsHeaderName !== "") { + request.headers.remove(xMsHeaderName); + } + return this._nextPolicy.sendRequest(request); } - /** - * Creates a new AppendBlobClient object identical to the source but with the - * specified snapshot timestamp. - * Provide "" will remove the snapshot and return a Client to the base blob. - * - * @param snapshot - The snapshot timestamp. - * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp. - */ - withSnapshot(snapshot2) { - return new _AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + }; + BatchHeaderFilterPolicyFactory = class { + create(nextPolicy, options) { + return new BatchHeaderFilterPolicy(nextPolicy, options); } - /** - * Creates a 0-length append blob. Call AppendBlock to append data to an append blob. - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob - * - * @param options - Options to the Append Block Create operation. - * - * - * Example usage: - * - * ```js - * const appendBlobClient = containerClient.getAppendBlobClient(""); - * await appendBlobClient.create(); - * ``` - */ - async create(options = {}) { - var _a2, _b, _c; - const { span, updatedOptions } = createSpan2("AppendBlobClient-create", options); - options.conditions = options.conditions || {}; - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.appendBlobContext.create(0, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + }; + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobBatchClient.js +var BlobBatchClient; +var init_BlobBatchClient = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobBatchClient.js"() { + init_BatchResponseParser(); + init_BatchUtils(); + init_BlobBatch(); + init_src4(); + init_tracing(); + init_operations(); + init_AnonymousCredential(); + init_storageClientContext(); + init_Pipeline(); + init_utils_common(); + BlobBatchClient = class { + constructor(url2, credentialOrPipeline, options) { + let pipeline; + if (isPipelineLike(credentialOrPipeline)) { + pipeline = credentialOrPipeline; + } else if (!credentialOrPipeline) { + pipeline = newPipeline(new AnonymousCredential(), options); + } else { + pipeline = newPipeline(credentialOrPipeline, options); + } + const storageClientContext = new StorageClientContext(url2, pipeline.toServiceClientOptions()); + const path14 = getURLPath(url2); + if (path14 && path14 !== "/") { + this.serviceOrContainerContext = new Container(storageClientContext); + } else { + this.serviceOrContainerContext = new Service(storageClientContext); } } /** - * Creates a 0-length append blob. Call AppendBlock to append data to an append blob. - * If the blob with the same name already exists, the content of the existing blob will remain unchanged. - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob - * - * @param options - + * Creates a {@link BlobBatch}. + * A BlobBatch represents an aggregated set of operations on blobs. */ - async createIfNotExists(options = {}) { - var _a2, _b; - const { span, updatedOptions } = createSpan2("AppendBlobClient-createIfNotExists", options); - const conditions = { ifNoneMatch: ETagAny }; - try { - const res = await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions })); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } catch (e2) { - if (((_a2 = e2.details) === null || _a2 === void 0 ? void 0 : _a2.errorCode) === "BlobAlreadyExists") { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: "Expected exception when creating a blob only if it does not already exist." - }); - return Object.assign(Object.assign({ succeeded: false }, (_b = e2.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e2.response }); + createBatch() { + return new BlobBatch(); + } + async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) { + const batch = new BlobBatch(); + for (const urlOrBlobClient of urlsOrBlobClients) { + if (typeof urlOrBlobClient === "string") { + await batch.deleteBlob(urlOrBlobClient, credentialOrOptions, options); + } else { + await batch.deleteBlob(urlOrBlobClient, credentialOrOptions); } - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); } + return this.submitBatch(batch); } - /** - * Seals the append blob, making it read only. - * - * @param options - - */ - async seal(options = {}) { - var _a2; - const { span, updatedOptions } = createSpan2("AppendBlobClient-seal", options); - options.conditions = options.conditions || {}; - try { - return await this.appendBlobContext.seal(Object.assign({ abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, options) { + const batch = new BlobBatch(); + for (const urlOrBlobClient of urlsOrBlobClients) { + if (typeof urlOrBlobClient === "string") { + await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options); + } else { + await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions); + } } + return this.submitBatch(batch); } /** - * Commits a new block of data to the end of the existing append blob. - * @see https://docs.microsoft.com/rest/api/storageservices/append-block - * - * @param body - Data to be appended. - * @param contentLength - Length of the body in bytes. - * @param options - Options to the Append Block operation. + * Submit batch request which consists of multiple subrequests. * + * Get `blobBatchClient` and other details before running the snippets. + * `blobServiceClient.getBlobBatchClient()` gives the `blobBatchClient` * * Example usage: * * ```js - * const content = "Hello World!"; + * let batchRequest = new BlobBatch(); + * await batchRequest.deleteBlob(urlInString0, credential0); + * await batchRequest.deleteBlob(urlInString1, credential1, { + * deleteSnapshots: "include" + * }); + * const batchResp = await blobBatchClient.submitBatch(batchRequest); + * console.log(batchResp.subResponsesSucceededCount); + * ``` * - * // Create a new append blob and append data to the blob. - * const newAppendBlobClient = containerClient.getAppendBlobClient(""); - * await newAppendBlobClient.create(); - * await newAppendBlobClient.appendBlock(content, content.length); + * Example using a lease: * - * // Append data to an existing append blob. - * const existingAppendBlobClient = containerClient.getAppendBlobClient(""); - * await existingAppendBlobClient.appendBlock(content, content.length); + * ```js + * let batchRequest = new BlobBatch(); + * await batchRequest.setBlobAccessTier(blockBlobClient0, "Cool"); + * await batchRequest.setBlobAccessTier(blockBlobClient1, "Cool", { + * conditions: { leaseId: leaseId } + * }); + * const batchResp = await blobBatchClient.submitBatch(batchRequest); + * console.log(batchResp.subResponsesSucceededCount); * ``` - */ - async appendBlock(body2, contentLength2, options = {}) { - var _a2; - const { span, updatedOptions } = createSpan2("AppendBlobClient-appendBlock", options); - options.conditions = options.conditions || {}; - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.appendBlobContext.appendBlock(contentLength2, body2, Object.assign({ abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), requestOptions: { - onUploadProgress: options.onProgress - }, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } - } - /** - * The Append Block operation commits a new block of data to the end of an existing append blob - * where the contents are read from a source url. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-url * - * @param sourceURL - - * The url to the blob that will be the source of the copy. A source blob in the same storage account can - * be authenticated via Shared Key. However, if the source is a blob in another account, the source blob - * must either be public or must be authenticated via a shared access signature. If the source blob is - * public, no authentication is required to perform the operation. - * @param sourceOffset - Offset in source to be appended - * @param count - Number of bytes to be appended as a block + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * + * @param batchRequest - A set of Delete or SetTier operations. * @param options - */ - async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) { - var _a2; - const { span, updatedOptions } = createSpan2("AppendBlobClient-appendBlockFromURL", options); - options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; + async submitBatch(batchRequest, options = {}) { + if (!batchRequest || batchRequest.getSubRequests().size === 0) { + throw new RangeError("Batch request should contain one or more sub requests."); + } + const { span, updatedOptions } = createSpan2("BlobBatchClient-submitBatch", options); try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, Object.assign({ abortSignal: options.abortSignal, sourceRange: rangeToString({ offset: sourceOffset, count }), sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, appendPositionAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: options.sourceConditions.ifMatch, - sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, - sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince - }, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); + const batchRequestBody = batchRequest.getHttpRequestBody(); + const rawBatchResponse = await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign(Object.assign({}, options), convertTracingToRequestOptionsBase(updatedOptions))); + const batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); + const responseSummary = await batchResponseParser.parseBatchResponse(); + const res = { + _response: rawBatchResponse._response, + contentType: rawBatchResponse.contentType, + errorCode: rawBatchResponse.errorCode, + requestId: rawBatchResponse.requestId, + clientRequestId: rawBatchResponse.clientRequestId, + version: rawBatchResponse.version, + subResponses: responseSummary.subResponses, + subResponsesSucceededCount: responseSummary.subResponsesSucceededCount, + subResponsesFailedCount: responseSummary.subResponsesFailedCount + }; + return res; } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -52025,8 +68438,29 @@ var init_Clients = __esm({ } } }; - BlockBlobClient = class _BlockBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/ContainerClient.js +var ContainerClient; +var init_ContainerClient = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/ContainerClient.js"() { + init_tslib_es6(); + init_src5(); + init_src4(); + init_AnonymousCredential(); + init_StorageSharedKeyCredential(); + init_operations(); + init_Pipeline(); + init_StorageClient(); + init_tracing(); + init_utils_common(); + init_BlobSASSignatureValues(); + init_BlobLeaseClient(); + init_Clients(); + init_BlobBatchClient(); + ContainerClient = class extends StorageClient { + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { let pipeline; let url2; options = options || {}; @@ -52035,22 +68469,17 @@ var init_Clients = __esm({ pipeline = credentialOrPipelineOrContainerName; } else if (isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || isTokenCredential(credentialOrPipelineOrContainerName)) { url2 = urlOrConnectionString; - options = blobNameOrOptions; pipeline = newPipeline(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { url2 = urlOrConnectionString; - if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { - options = blobNameOrOptions; - } pipeline = newPipeline(new AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { + } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; const extractedCreds = extractConnectionStringParts(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { if (isNode) { const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + url2 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); if (!options.proxyOptions) { options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); } @@ -52059,259 +68488,45 @@ var init_Clients = __esm({ throw new Error("Account connection string is only supported in Node.js environment"); } } else if (extractedCreds.kind === "SASConnString") { - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + url2 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; pipeline = newPipeline(new AnonymousCredential(), options); } else { throw new Error("Connection string must be either an Account connection string or a SAS connection string"); } } else { - throw new Error("Expecting non-empty strings for containerName and blobName parameters"); + throw new Error("Expecting non-empty strings for containerName parameter"); } super(url2, pipeline); - this.blockBlobContext = new BlockBlob(this.storageClientContext); - this._blobContext = new Blob3(this.storageClientContext); - } - /** - * Creates a new BlockBlobClient object identical to the source but with the - * specified snapshot timestamp. - * Provide "" will remove the snapshot and return a URL to the base blob. - * - * @param snapshot - The snapshot timestamp. - * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp. - */ - withSnapshot(snapshot2) { - return new _BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + this._containerName = this.getContainerNameFromUrl(); + this.containerContext = new Container(this.storageClientContext); } /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Quick query for a JSON or CSV formatted blob. - * - * Example usage (Node.js): - * - * ```js - * // Query and convert a blob to a string - * const queryBlockBlobResponse = await blockBlobClient.query("select * from BlobStorage"); - * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); - * console.log("Query blob content:", downloaded); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); - * } - * ``` - * - * @param query - - * @param options - + * The name of the container. */ - async query(query, options = {}) { - var _a2; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - const { span, updatedOptions } = createSpan2("BlockBlobClient-query", options); - try { - if (!isNode) { - throw new Error("This operation currently is only supported in Node.js."); - } - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - const response = await this._blobContext.query(Object.assign({ abortSignal: options.abortSignal, queryRequest: { - queryType: "SQL", - expression: query, - inputSerialization: toQuerySerialization(options.inputTextConfiguration), - outputSerialization: toQuerySerialization(options.outputTextConfiguration) - }, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions))); - return new BlobQueryResponse(response, { - abortSignal: options.abortSignal, - onProgress: options.onProgress, - onError: options.onError - }); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } + get containerName() { + return this._containerName; } /** - * Creates a new block blob, or updates the content of an existing block blob. - * Updating an existing block blob overwrites any existing metadata on the blob. - * Partial updates are not supported; the content of the existing blob is - * overwritten with the new content. To perform a partial update of a block blob's, - * use {@link stageBlock} and {@link commitBlockList}. - * - * This is a non-parallel uploading method, please use {@link uploadFile}, - * {@link uploadStream} or {@link uploadBrowserData} for better performance - * with concurrency uploading. + * Creates a new container under the specified account. If the container with + * the same name already exists, the operation fails. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @param options - Options to Container Create operation. * - * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function - * which returns a new Readable stream whose offset is from data source beginning. - * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a - * string including non non-Base64/Hex-encoded characters. - * @param options - Options to the Block Blob Upload operation. - * @returns Response data for the Block Blob Upload operation. * * Example usage: * * ```js - * const content = "Hello world!"; - * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); - * ``` - */ - async upload(body2, contentLength2, options = {}) { - var _a2, _b, _c; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan2("BlockBlobClient-upload", options); - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.blockBlobContext.upload(contentLength2, body2, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), requestOptions: { - onUploadProgress: options.onProgress - }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } - } - /** - * Creates a new Block Blob where the contents of the blob are read from a given URL. - * This API is supported beginning with the 2020-04-08 version. Partial updates - * are not supported with Put Blob from URL; the content of an existing blob is overwritten with - * the content of the new blob. To perform partial updates to a block blob’s contents using a - * source URL, use {@link stageBlockFromURL} and {@link commitBlockList}. - * - * @param sourceURL - Specifies the URL of the blob. The value - * may be a URL of up to 2 KB in length that specifies a blob. - * The value should be URL-encoded as it would appear - * in a request URI. The source blob must either be public - * or must be authenticated via a shared access signature. - * If the source blob is public, no authentication is required - * to perform the operation. Here are some examples of source object URLs: - * - https://myaccount.blob.core.windows.net/mycontainer/myblob - * - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot= - * @param options - Optional parameters. - */ - async syncUploadFromURL(sourceURL, options = {}) { - var _a2, _b, _c, _d, _e2; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan2("BlockBlobClient-syncUploadFromURL", options); - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: options.conditions.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: (_a2 = options.sourceConditions) === null || _a2 === void 0 ? void 0 : _a2.ifMatch, - sourceIfModifiedSince: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifModifiedSince, - sourceIfNoneMatch: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch, - sourceIfUnmodifiedSince: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifUnmodifiedSince, - sourceIfTags: (_e2 = options.sourceConditions) === null || _e2 === void 0 ? void 0 : _e2.tagConditions - }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags }), convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } - } - /** - * Uploads the specified block to the block blob's "staging area" to be later - * committed by a call to commitBlockList. - * @see https://docs.microsoft.com/rest/api/storageservices/put-block - * - * @param blockId - A 64-byte value that is base64-encoded - * @param body - Data to upload to the staging area. - * @param contentLength - Number of bytes to upload. - * @param options - Options to the Block Blob Stage Block operation. - * @returns Response data for the Block Blob Stage Block operation. - */ - async stageBlock(blockId2, body2, contentLength2, options = {}) { - const { span, updatedOptions } = createSpan2("BlockBlobClient-stageBlock", options); - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.blockBlobContext.stageBlock(blockId2, contentLength2, body2, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, requestOptions: { - onUploadProgress: options.onProgress - }, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } - } - /** - * The Stage Block From URL operation creates a new block to be committed as part - * of a blob where the contents are read from a URL. - * This API is available starting in version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url - * - * @param blockId - A 64-byte value that is base64-encoded - * @param sourceURL - Specifies the URL of the blob. The value - * may be a URL of up to 2 KB in length that specifies a blob. - * The value should be URL-encoded as it would appear - * in a request URI. The source blob must either be public - * or must be authenticated via a shared access signature. - * If the source blob is public, no authentication is required - * to perform the operation. Here are some examples of source object URLs: - * - https://myaccount.blob.core.windows.net/mycontainer/myblob - * - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot= - * @param offset - From which position of the blob to download, greater than or equal to 0 - * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined - * @param options - Options to the Block Blob Stage Block From URL operation. - * @returns Response data for the Block Blob Stage Block From URL operation. - */ - async stageBlockFromURL(blockId2, sourceURL, offset = 0, count, options = {}) { - const { span, updatedOptions } = createSpan2("BlockBlobClient-stageBlockFromURL", options); - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.blockBlobContext.stageBlockFromURL(blockId2, 0, sourceURL, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, sourceRange: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization) }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } - } - /** - * Writes a blob by specifying the list of block IDs that make up the blob. - * In order to be written as part of a blob, a block must have been successfully written - * to the server in a prior {@link stageBlock} operation. You can call {@link commitBlockList} to - * update a blob by uploading only those blocks that have changed, then committing the new and existing - * blocks together. Any blocks not specified in the block list and permanently deleted. - * @see https://docs.microsoft.com/rest/api/storageservices/put-block-list - * - * @param blocks - Array of 64-byte value that is base64-encoded - * @param options - Options to the Block Blob Commit Block List operation. - * @returns Response data for the Block Blob Commit Block List operation. + * const containerClient = blobServiceClient.getContainerClient(""); + * const createContainerResponse = await containerClient.create(); + * console.log("Container was created successfully", createContainerResponse.requestId); + * ``` */ - async commitBlockList(blocks2, options = {}) { - var _a2, _b, _c; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan2("BlockBlobClient-commitBlockList", options); + async create(options = {}) { + const { span, updatedOptions } = createSpan2("ContainerClient-create", options); try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.blockBlobContext.commitBlockList({ latest: blocks2 }, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions))); + return await this.containerContext.create(Object.assign(Object.assign({}, options), convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -52323,28 +68538,27 @@ var init_Clients = __esm({ } } /** - * Returns the list of blocks that have been uploaded as part of a block blob - * using the specified block list filter. - * @see https://docs.microsoft.com/rest/api/storageservices/get-block-list + * Creates a new container under the specified account. If the container with + * the same name already exists, it is not changed. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata * - * @param listType - Specifies whether to return the list of committed blocks, - * the list of uncommitted blocks, or both lists together. - * @param options - Options to the Block Blob Get Block List operation. - * @returns Response data for the Block Blob Get Block List operation. + * @param options - */ - async getBlockList(listType2, options = {}) { - var _a2; - const { span, updatedOptions } = createSpan2("BlockBlobClient-getBlockList", options); + async createIfNotExists(options = {}) { + var _a2, _b2; + const { span, updatedOptions } = createSpan2("ContainerClient-createIfNotExists", options); try { - const res = await this.blockBlobContext.getBlockList(listType2, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - if (!res.committedBlocks) { - res.committedBlocks = []; - } - if (!res.uncommittedBlocks) { - res.uncommittedBlocks = []; - } - return res; + const res = await this.create(updatedOptions); + return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); } catch (e2) { + if (((_a2 = e2.details) === null || _a2 === void 0 ? void 0 : _a2.errorCode) === "ContainerAlreadyExists") { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: "Expected exception when creating a container only if it does not already exist." + }); + return Object.assign(Object.assign({ succeeded: false }, (_b2 = e2.response) === null || _b2 === void 0 ? void 0 : _b2.parsedHeaders), { _response: e2.response }); + } span.setStatus({ code: SpanStatusCode.ERROR, message: e2.message @@ -52354,41 +68568,31 @@ var init_Clients = __esm({ span.end(); } } - // High level functions /** - * Uploads a Buffer(Node.js)/Blob(browsers)/ArrayBuffer/ArrayBufferView object to a BlockBlob. - * - * When data length is no more than the specifiled {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is - * {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload. - * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList} - * to commit the block list. + * Returns true if the Azure container resource represented by this client exists; false otherwise. * - * A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is - * `blobContentType`, enabling the browser to provide - * functionality based on file type. + * NOTE: use this function with care since an existing container might be deleted by other clients or + * applications. Vice versa new containers with the same name might be added by other clients or + * applications after this function completes. * - * @param data - Buffer(Node.js), Blob, ArrayBuffer or ArrayBufferView * @param options - */ - async uploadData(data, options = {}) { - const { span, updatedOptions } = createSpan2("BlockBlobClient-uploadData", options); + async exists(options = {}) { + const { span, updatedOptions } = createSpan2("ContainerClient-exists", options); try { - if (isNode) { - let buffer; - if (data instanceof Buffer) { - buffer = data; - } else if (data instanceof ArrayBuffer) { - buffer = Buffer.from(data); - } else { - data = data; - buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength); - } - return this.uploadSeekableInternal((offset, size) => buffer.slice(offset, offset + size), buffer.byteLength, updatedOptions); - } else { - const browserBlob = new Blob([data]); - return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions); - } + await this.getProperties({ + abortSignal: options.abortSignal, + tracingOptions: updatedOptions.tracingOptions + }); + return true; } catch (e2) { + if (e2.statusCode === 404) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: "Expected exception when checking container existence" + }); + return false; + } span.setStatus({ code: SpanStatusCode.ERROR, message: e2.message @@ -52399,29 +68603,67 @@ var init_Clients = __esm({ } } /** - * ONLY AVAILABLE IN BROWSERS. + * Creates a {@link BlobClient} * - * Uploads a browser Blob/File/ArrayBuffer/ArrayBufferView object to block blob. + * @param blobName - A blob name + * @returns A new BlobClient object for the given blob name. + */ + getBlobClient(blobName) { + return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + } + /** + * Creates an {@link AppendBlobClient} * - * When buffer length lesser than or equal to 256MB, this method will use 1 upload call to finish the upload. - * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call - * {@link commitBlockList} to commit the block list. + * @param blobName - An append blob name + */ + getAppendBlobClient(blobName) { + return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + } + /** + * Creates a {@link BlockBlobClient} * - * A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is - * `blobContentType`, enabling the browser to provide - * functionality based on file type. + * @param blobName - A block blob name * - * @deprecated Use {@link uploadData} instead. * - * @param browserData - Blob, File, ArrayBuffer or ArrayBufferView - * @param options - Options to upload browser data. - * @returns Response data for the Blob Upload operation. + * Example usage: + * + * ```js + * const content = "Hello world!"; + * + * const blockBlobClient = containerClient.getBlockBlobClient(""); + * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); + * ``` */ - async uploadBrowserData(browserData, options = {}) { - const { span, updatedOptions } = createSpan2("BlockBlobClient-uploadBrowserData", options); + getBlockBlobClient(blobName) { + return new BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + } + /** + * Creates a {@link PageBlobClient} + * + * @param blobName - A page blob name + */ + getPageBlobClient(blobName) { + return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + } + /** + * Returns all user-defined metadata and system properties for the specified + * container. The data returned does not include the container's list of blobs. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties + * + * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if + * they originally contained uppercase characters. This differs from the metadata keys returned by + * the `listContainers` method of {@link BlobServiceClient} using the `includeMetadata` option, which + * will retain their original casing. + * + * @param options - Options to Container Get Properties operation. + */ + async getProperties(options = {}) { + if (!options.conditions) { + options.conditions = {}; + } + const { span, updatedOptions } = createSpan2("ContainerClient-getProperties", options); try { - const browserBlob = new Blob([browserData]); - return await this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions); + return await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -52433,86 +68675,19 @@ var init_Clients = __esm({ } } /** + * Marks the specified container for deletion. The container and any blobs + * contained within it are later deleted during garbage collection. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container * - * Uploads data to block blob. Requires a bodyFactory as the data source, - * which need to return a {@link HttpRequestBody} object with the offset and size provided. - * - * When data length is no more than the specified {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is - * {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload. - * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList} - * to commit the block list. - * - * @param bodyFactory - - * @param size - size of the data to upload. - * @param options - Options to Upload to Block Blob operation. - * @returns Response data for the Blob Upload operation. + * @param options - Options to Container Delete operation. */ - async uploadSeekableInternal(bodyFactory, size, options = {}) { - if (!options.blockSize) { - options.blockSize = 0; - } - if (options.blockSize < 0 || options.blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { - throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); - } - if (options.maxSingleShotSize !== 0 && !options.maxSingleShotSize) { - options.maxSingleShotSize = BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; - } - if (options.maxSingleShotSize < 0 || options.maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { - throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}`); - } - if (options.blockSize === 0) { - if (size > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { - throw new RangeError(`${size} is too larger to upload to a block blob.`); - } - if (size > options.maxSingleShotSize) { - options.blockSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS); - if (options.blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { - options.blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; - } - } - } - if (!options.blobHTTPHeaders) { - options.blobHTTPHeaders = {}; - } + async delete(options = {}) { if (!options.conditions) { options.conditions = {}; } - const { span, updatedOptions } = createSpan2("BlockBlobClient-uploadSeekableInternal", options); + const { span, updatedOptions } = createSpan2("ContainerClient-delete", options); try { - if (size <= options.maxSingleShotSize) { - return await this.upload(bodyFactory(0, size), size, updatedOptions); - } - const numBlocks = Math.floor((size - 1) / options.blockSize) + 1; - if (numBlocks > BLOCK_BLOB_MAX_BLOCKS) { - throw new RangeError(`The buffer's size is too big or the BlockSize is too small;the number of blocks must be <= ${BLOCK_BLOB_MAX_BLOCKS}`); - } - const blockList = []; - const blockIDPrefix = generateUuid(); - let transferProgress = 0; - const batch = new Batch(options.concurrency); - for (let i2 = 0; i2 < numBlocks; i2++) { - batch.addOperation(async () => { - const blockID = generateBlockID(blockIDPrefix, i2); - const start = options.blockSize * i2; - const end = i2 === numBlocks - 1 ? size : start + options.blockSize; - const contentLength2 = end - start; - blockList.push(blockID); - await this.stageBlock(blockID, bodyFactory(start, contentLength2), contentLength2, { - abortSignal: options.abortSignal, - conditions: options.conditions, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - }); - transferProgress += contentLength2; - if (options.onProgress) { - options.onProgress({ - loadedBytes: transferProgress - }); - } - }); - } - await batch.do(); - return this.commitBlockList(blockList, updatedOptions); + return await this.containerContext.delete(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -52524,30 +68699,26 @@ var init_Clients = __esm({ } } /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Uploads a local file in blocks to a block blob. - * - * When file size lesser than or equal to 256MB, this method will use 1 upload call to finish the upload. - * Otherwise, this method will call stageBlock to upload blocks, and finally call commitBlockList - * to commit the block list. + * Marks the specified container for deletion if it exists. The container and any blobs + * contained within it are later deleted during garbage collection. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container * - * @param filePath - Full path of local file - * @param options - Options to Upload to Block Blob operation. - * @returns Response data for the Blob Upload operation. + * @param options - Options to Container Delete operation. */ - async uploadFile(filePath, options = {}) { - const { span, updatedOptions } = createSpan2("BlockBlobClient-uploadFile", options); + async deleteIfExists(options = {}) { + var _a2, _b2; + const { span, updatedOptions } = createSpan2("ContainerClient-deleteIfExists", options); try { - const size = (await fsStat(filePath)).size; - return await this.uploadSeekableInternal((offset, count) => { - return () => fsCreateReadStream(filePath, { - autoClose: true, - end: count ? offset + count - 1 : Infinity, - start: offset - }); - }, size, Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) })); + const res = await this.delete(updatedOptions); + return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); } catch (e2) { + if (((_a2 = e2.details) === null || _a2 === void 0 ? void 0 : _a2.errorCode) === "ContainerNotFound") { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: "Expected exception when deleting a container only if it exists." + }); + return Object.assign(Object.assign({ succeeded: false }, (_b2 = e2.response) === null || _b2 === void 0 ? void 0 : _b2.parsedHeaders), { _response: e2.response }); + } span.setStatus({ code: SpanStatusCode.ERROR, message: e2.message @@ -52558,60 +68729,27 @@ var init_Clients = __esm({ } } /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. + * Sets one or more user-defined name-value pairs for the specified container. * - * Uploads a Node.js Readable stream into block blob. + * If no option provided, or no metadata defined in the parameter, the container + * metadata will be removed. * - * PERFORMANCE IMPROVEMENT TIPS: - * * Input stream highWaterMark is better to set a same value with bufferSize - * parameter, which will avoid Buffer.concat() operations. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata * - * @param stream - Node.js Readable stream - * @param bufferSize - Size of every buffer allocated, also the block size in the uploaded block blob. Default value is 8MB - * @param maxConcurrency - Max concurrency indicates the max number of buffers that can be allocated, - * positive correlation with max uploading concurrency. Default value is 5 - * @param options - Options to Upload Stream to Block Blob operation. - * @returns Response data for the Blob Upload operation. + * @param metadata - Replace existing metadata with this value. + * If no value provided the existing metadata will be removed. + * @param options - Options to Container Set Metadata operation. */ - async uploadStream(stream, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { - if (!options.blobHTTPHeaders) { - options.blobHTTPHeaders = {}; - } + async setMetadata(metadata3, options = {}) { if (!options.conditions) { options.conditions = {}; } - const { span, updatedOptions } = createSpan2("BlockBlobClient-uploadStream", options); + if (options.conditions.ifUnmodifiedSince) { + throw new RangeError("the IfUnmodifiedSince must have their default values because they are ignored by the blob service"); + } + const { span, updatedOptions } = createSpan2("ContainerClient-setMetadata", options); try { - let blockNum = 0; - const blockIDPrefix = generateUuid(); - let transferProgress = 0; - const blockList = []; - const scheduler = new BufferScheduler( - stream, - bufferSize, - maxConcurrency, - async (body2, length) => { - const blockID = generateBlockID(blockIDPrefix, blockNum); - blockList.push(blockID); - blockNum++; - await this.stageBlock(blockID, body2, length, { - conditions: options.conditions, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - }); - transferProgress += length; - if (options.onProgress) { - options.onProgress({ loadedBytes: transferProgress }); - } - }, - // concurrency should set a smaller value than maxConcurrency, which is helpful to - // reduce the possibility when a outgoing handler waits for stream data, in - // this situation, outgoing handlers are blocked. - // Outgoing queue shouldn't be empty. - Math.ceil(maxConcurrency / 4 * 3) - ); - await scheduler.do(); - return await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) })); + return await this.containerContext.setMetadata(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: metadata3, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -52622,76 +68760,55 @@ var init_Clients = __esm({ span.end(); } } - }; - PageBlobClient = class _PageBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { - let pipeline; - let url2; - options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } else if (isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { - const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); - if (!options.proxyOptions) { - options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); - } - pipeline = newPipeline(sharedKeyCredential, options); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } else if (extractedCreds.kind === "SASConnString") { - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); - } - } else { - throw new Error("Expecting non-empty strings for containerName and blobName parameters"); - } - super(url2, pipeline); - this.pageBlobContext = new PageBlob(this.storageClientContext); - } /** - * Creates a new PageBlobClient object identical to the source but with the - * specified snapshot timestamp. - * Provide "" will remove the snapshot and return a Client to the base blob. + * Gets the permissions for the specified container. The permissions indicate + * whether container data may be accessed publicly. * - * @param snapshot - The snapshot timestamp. - * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. - */ - withSnapshot(snapshot2) { - return new _PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); - } - /** - * Creates a page blob of the specified length. Call uploadPages to upload data - * data to a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * WARNING: JavaScript Date will potentially lose precision when parsing startsOn and expiresOn strings. + * For example, new Date("2018-12-31T03:44:23.8827891Z").toISOString() will get "2018-12-31T03:44:23.882Z". * - * @param size - size of the page blob. - * @param options - Options to the Page Blob Create operation. - * @returns Response data for the Page Blob Create operation. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl + * + * @param options - Options to Container Get Access Policy operation. */ - async create(size, options = {}) { - var _a2, _b, _c; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan2("PageBlobClient-create", options); + async getAccessPolicy(options = {}) { + if (!options.conditions) { + options.conditions = {}; + } + const { span, updatedOptions } = createSpan2("ContainerClient-getAccessPolicy", options); try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.pageBlobContext.create(0, size, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, blobSequenceNumber: options.blobSequenceNumber, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions))); + const response = await this.containerContext.getAccessPolicy(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions))); + const res = { + _response: response._response, + blobPublicAccess: response.blobPublicAccess, + date: response.date, + etag: response.etag, + errorCode: response.errorCode, + lastModified: response.lastModified, + requestId: response.requestId, + clientRequestId: response.clientRequestId, + signedIdentifiers: [], + version: response.version + }; + for (const identifier of response) { + let accessPolicy = void 0; + if (identifier.accessPolicy) { + accessPolicy = { + permissions: identifier.accessPolicy.permissions + }; + if (identifier.accessPolicy.expiresOn) { + accessPolicy.expiresOn = new Date(identifier.accessPolicy.expiresOn); + } + if (identifier.accessPolicy.startsOn) { + accessPolicy.startsOn = new Date(identifier.accessPolicy.startsOn); + } + } + res.signedIdentifiers.push({ + accessPolicy, + id: identifier.id + }); + } + return res; } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -52703,29 +68820,39 @@ var init_Clients = __esm({ } } /** - * Creates a page blob of the specified length. Call uploadPages to upload data - * data to a page blob. If the blob with the same name already exists, the content - * of the existing blob will remain unchanged. - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * Sets the permissions for the specified container. The permissions indicate + * whether blobs in a container may be accessed publicly. * - * @param size - size of the page blob. - * @param options - + * When you set permissions for a container, the existing permissions are replaced. + * If no access or containerAcl provided, the existing container ACL will be + * removed. + * + * When you establish a stored access policy on a container, it may take up to 30 seconds to take effect. + * During this interval, a shared access signature that is associated with the stored access policy will + * fail with status code 403 (Forbidden), until the access policy becomes active. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl + * + * @param access - The level of public access to data in the container. + * @param containerAcl - Array of elements each having a unique Id and details of the access policy. + * @param options - Options to Container Set Access Policy operation. */ - async createIfNotExists(size, options = {}) { - var _a2, _b; - const { span, updatedOptions } = createSpan2("PageBlobClient-createIfNotExists", options); + async setAccessPolicy(access2, containerAcl2, options = {}) { + options.conditions = options.conditions || {}; + const { span, updatedOptions } = createSpan2("ContainerClient-setAccessPolicy", options); try { - const conditions = { ifNoneMatch: ETagAny }; - const res = await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions })); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } catch (e2) { - if (((_a2 = e2.details) === null || _a2 === void 0 ? void 0 : _a2.errorCode) === "BlobAlreadyExists") { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: "Expected exception when creating a blob only if it does not already exist." + const acl = []; + for (const identifier of containerAcl2 || []) { + acl.push({ + accessPolicy: { + expiresOn: identifier.accessPolicy.expiresOn ? truncatedISO8061Date(identifier.accessPolicy.expiresOn) : "", + permissions: identifier.accessPolicy.permissions, + startsOn: identifier.accessPolicy.startsOn ? truncatedISO8061Date(identifier.accessPolicy.startsOn) : "" + }, + id: identifier.id }); - return Object.assign(Object.assign({ succeeded: false }, (_b = e2.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e2.response }); } + return await this.containerContext.setAccessPolicy(Object.assign({ abortSignal: options.abortSignal, access: access2, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, message: e2.message @@ -52736,58 +68863,45 @@ var init_Clients = __esm({ } } /** - * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page + * Get a {@link BlobLeaseClient} that manages leases on the container. * - * @param body - Data to upload - * @param offset - Offset of destination page blob - * @param count - Content length of the body, also number of bytes to be uploaded - * @param options - Options to the Page Blob Upload Pages operation. - * @returns Response data for the Page Blob Upload Pages operation. - */ - async uploadPages(body2, offset, count, options = {}) { - var _a2; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan2("PageBlobClient-uploadPages", options); - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.pageBlobContext.uploadPages(count, body2, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), requestOptions: { - onUploadProgress: options.onProgress - }, range: rangeToString({ offset, count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } + * @param proposeLeaseId - Initial proposed lease Id. + * @returns A new BlobLeaseClient object for managing leases on the container. + */ + getBlobLeaseClient(proposeLeaseId) { + return new BlobLeaseClient(this, proposeLeaseId); } /** - * The Upload Pages operation writes a range of pages to a page blob where the - * contents are read from a URL. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-page-from-url + * Creates a new block blob, or updates the content of an existing block blob. * - * @param sourceURL - Specify a URL to the copy source, Shared Access Signature(SAS) maybe needed for authentication - * @param sourceOffset - The source offset to copy from. Pass 0 to copy from the beginning of source page blob - * @param destOffset - Offset of destination page blob - * @param count - Number of bytes to be uploaded from source page blob - * @param options - + * Updating an existing block blob overwrites any existing metadata on the blob. + * Partial updates are not supported; the content of the existing blob is + * overwritten with the new content. To perform a partial update of a block blob's, + * use {@link BlockBlobClient.stageBlock} and {@link BlockBlobClient.commitBlockList}. + * + * This is a non-parallel uploading method, please use {@link BlockBlobClient.uploadFile}, + * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better + * performance with concurrency uploading. + * + * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * + * @param blobName - Name of the block blob to create or update. + * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function + * which returns a new Readable stream whose offset is from data source beginning. + * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a + * string including non non-Base64/Hex-encoded characters. + * @param options - Options to configure the Block Blob Upload operation. + * @returns Block Blob upload response data and the corresponding BlockBlobClient instance. */ - async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { - var _a2; - options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - const { span, updatedOptions } = createSpan2("PageBlobClient-uploadPagesFromURL", options); + async uploadBlockBlob(blobName, body2, contentLength2, options = {}) { + const { span, updatedOptions } = createSpan2("ContainerClient-uploadBlockBlob", options); try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), Object.assign({ abortSignal: options.abortSignal, sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, sequenceNumberAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: options.sourceConditions.ifMatch, - sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, - sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince - }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization) }, convertTracingToRequestOptionsBase(updatedOptions))); + const blockBlobClient = this.getBlockBlobClient(blobName); + const response = await blockBlobClient.upload(body2, contentLength2, updatedOptions); + return { + blockBlobClient, + response + }; } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -52799,20 +68913,24 @@ var init_Clients = __esm({ } } /** - * Frees the specified pages from the page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page + * Marks the specified blob or snapshot for deletion. The blob is later deleted + * during garbage collection. Note that in order to delete a blob, you must delete + * all of its snapshots. You can delete both at the same time with the Delete + * Blob operation. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob * - * @param offset - Starting byte position of the pages to clear. - * @param count - Number of bytes to clear. - * @param options - Options to the Page Blob Clear Pages operation. - * @returns Response data for the Page Blob Clear Pages operation. + * @param blobName - + * @param options - Options to Blob Delete operation. + * @returns Block blob deletion response data. */ - async clearPages(offset = 0, count, options = {}) { - var _a2; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan2("PageBlobClient-clearPages", options); + async deleteBlob(blobName, options = {}) { + const { span, updatedOptions } = createSpan2("ContainerClient-deleteBlob", options); try { - return await this.pageBlobContext.clearPages(0, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), range: rangeToString({ offset, count }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); + let blobClient = this.getBlobClient(blobName); + if (options.versionId) { + blobClient = blobClient.withVersion(options.versionId); + } + return await blobClient.delete(updatedOptions); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -52824,20 +68942,24 @@ var init_Clients = __esm({ } } /** - * Returns the list of valid page ranges for a page blob or snapshot of a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * listBlobFlatSegment returns a single segment of blobs starting from the + * specified Marker. Use an empty Marker to start enumeration from the beginning. + * After getting a segment, process it, and then call listBlobsFlatSegment again + * (passing the the previously-returned Marker) to get the next segment. + * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param options - Options to the Page Blob Get Ranges operation. - * @returns Response data for the Page Blob Get Ranges operation. + * @param marker - A string value that identifies the portion of the list to be returned with the next list operation. + * @param options - Options to Container List Blob Flat Segment operation. */ - async getPageRanges(offset = 0, count, options = {}) { - var _a2; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan2("PageBlobClient-getPageRanges", options); + async listBlobFlatSegment(marker2, options = {}) { + const { span, updatedOptions } = createSpan2("ContainerClient-listBlobFlatSegment", options); try { - return await this.pageBlobContext.getPageRanges(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), range: rangeToString({ offset, count }) }, convertTracingToRequestOptionsBase(updatedOptions))).then(rangeResponseFromModel); + const response = await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker: marker2 }, options), convertTracingToRequestOptionsBase(updatedOptions))); + const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => { + const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) }); + return blobItem; + }) }) }); + return wrappedResponse; } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -52849,22 +68971,29 @@ var init_Clients = __esm({ } } /** - * getPageRangesSegment returns a single segment of page ranges starting from the - * specified Marker. Use an empty Marker to start enumeration from the beginning. - * After getting a segment, process it, and then call getPageRangesSegment again - * (passing the the previously-returned Marker) to get the next segment. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * listBlobHierarchySegment returns a single segment of blobs starting from + * the specified Marker. Use an empty Marker to start enumeration from the + * beginning. After getting a segment, process it, and then call listBlobsHierarchicalSegment + * again (passing the the previously-returned Marker) to get the next segment. + * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. + * @param delimiter - The character or string used to define the virtual hierarchy * @param marker - A string value that identifies the portion of the list to be returned with the next list operation. - * @param options - Options to PageBlob Get Page Ranges Segment operation. + * @param options - Options to Container List Blob Hierarchy Segment operation. */ - async listPageRangesSegment(offset = 0, count, marker2, options = {}) { + async listBlobHierarchySegment(delimiter2, marker2, options = {}) { var _a2; - const { span, updatedOptions } = createSpan2("PageBlobClient-getPageRangesSegment", options); + const { span, updatedOptions } = createSpan2("ContainerClient-listBlobHierarchySegment", options); try { - return await this.pageBlobContext.getPageRanges(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), range: rangeToString({ offset, count }), marker: marker2, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions))); + const response = await this.containerContext.listBlobHierarchySegment(delimiter2, Object.assign(Object.assign({ marker: marker2 }, options), convertTracingToRequestOptionsBase(updatedOptions))); + const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => { + const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) }); + return blobItem; + }), blobPrefixes: (_a2 = response.segment.blobPrefixes) === null || _a2 === void 0 ? void 0 : _a2.map((blobPrefixInternal) => { + const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); + return blobPrefix; + }) }) }); + return wrappedResponse; } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -52876,53 +69005,49 @@ var init_Clients = __esm({ } } /** - * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesResponseModel} + * Returns an AsyncIterableIterator for ContainerListBlobFlatSegmentResponse * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. * @param marker - A string value that identifies the portion of - * the get of page ranges to be returned with the next getting operation. The + * the list of blobs to be returned with the next listing operation. The * operation returns the ContinuationToken value within the response body if the - * getting operation did not return all page ranges remaining within the current page. - * The ContinuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of get + * listing operation did not return all blobs remaining to be listed + * with the current page. The ContinuationToken value can be used as the value for + * the marker parameter in a subsequent call to request the next page of list * items. The marker value is opaque to the client. - * @param options - Options to List Page Ranges operation. + * @param options - Options to list blobs operation. */ - listPageRangeItemSegments(offset = 0, count, marker2, options = {}) { - return __asyncGenerator(this, arguments, function* listPageRangeItemSegments_1() { - let getPageRangeItemSegmentsResponse; + listSegments(marker2, options = {}) { + return __asyncGenerator(this, arguments, function* listSegments_1() { + let listBlobsFlatSegmentResponse; if (!!marker2 || marker2 === void 0) { do { - getPageRangeItemSegmentsResponse = yield __await(this.listPageRangesSegment(offset, count, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield __await(yield __await(getPageRangeItemSegmentsResponse)); + listBlobsFlatSegmentResponse = yield __await(this.listBlobFlatSegment(marker2, options)); + marker2 = listBlobsFlatSegmentResponse.continuationToken; + yield yield __await(yield __await(listBlobsFlatSegmentResponse)); } while (marker2); } }); } /** - * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects + * Returns an AsyncIterableIterator of {@link BlobItem} objects * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param options - Options to List Page Ranges operation. + * @param options - Options to list blobs operation. */ - listPageRangeItems(offset = 0, count, options = {}) { - return __asyncGenerator(this, arguments, function* listPageRangeItems_1() { + listItems(options = {}) { + return __asyncGenerator(this, arguments, function* listItems_1() { var e_1, _a2; let marker2; try { - for (var _b = __asyncValues(this.listPageRangeItemSegments(offset, count, marker2, options)), _c; _c = yield __await(_b.next()), !_c.done; ) { - const getPageRangesSegment = _c.value; - yield __await(yield* __asyncDelegator(__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); + for (var _b2 = __asyncValues(this.listSegments(marker2, options)), _c2; _c2 = yield __await(_b2.next()), !_c2.done; ) { + const listBlobsFlatSegmentResponse = _c2.value; + yield __await(yield* __asyncDelegator(__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems))); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { - if (_c && !_c.done && (_a2 = _b.return)) - yield __await(_a2.call(_b)); + if (_c2 && !_c2.done && (_a2 = _b2.return)) + yield __await(_a2.call(_b2)); } finally { if (e_1) throw e_1.error; @@ -52931,19 +69056,19 @@ var init_Clients = __esm({ }); } /** - * Returns an async iterable iterator to list of page ranges for a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * Returns an async iterable iterator to list all the blobs + * under the specified account. * - * .byPage() returns an async iterable iterator to list of page ranges for a page blob. + * .byPage() returns an async iterable iterator to list the blobs in pages. * * Example using `for await` syntax: * * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` + * // Get the containerClient before you run these snippets, + * // Can be obtained from `blobServiceClient.getContainerClient("");` * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRanges()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * for await (const blob of containerClient.listBlobsFlat()) { + * console.log(`Blob ${i++}: ${blob.name}`); * } * ``` * @@ -52951,11 +69076,11 @@ var init_Clients = __esm({ * * ```js * let i = 1; - * let iter = pageBlobClient.listPageRanges(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * let iter = containerClient.listBlobsFlat(); + * let blobItem = await iter.next(); + * while (!blobItem.done) { + * console.log(`Blob ${i++}: ${blobItem.value.name}`); + * blobItem = await iter.next(); * } * ``` * @@ -52964,9 +69089,9 @@ var init_Clients = __esm({ * ```js * // passing optional maxPageSize in the page settings * let i = 1; - * for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { + * for (const blob of response.segment.blobItems) { + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -52975,12 +69100,12 @@ var init_Clients = __esm({ * * ```js * let i = 1; - * let iterator = pageBlobClient.listPageRanges().byPage({ maxPageSize: 2 }); + * let iterator = containerClient.listBlobsFlat().byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; * - * // Prints 2 page ranges - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * // Prints 2 blob names + * for (const blob of response.segment.blobItems) { + * console.log(`Blob ${i++}: ${blob.name}`); * } * * // Gets next marker @@ -52988,22 +69113,55 @@ var init_Clients = __esm({ * * // Passing next marker as continuationToken * - * iterator = pageBlobClient.listPageRanges().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = containerClient.listBlobsFlat().byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; * - * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * // Prints 10 blob names + * for (const blob of response.segment.blobItems) { + * console.log(`Blob ${i++}: ${blob.name}`); * } * ``` - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param options - Options to the Page Blob Get Ranges operation. + * + * @param options - Options to list blobs. * @returns An asyncIterableIterator that supports paging. */ - listPageRanges(offset = 0, count, options = {}) { - options.conditions = options.conditions || {}; - const iter = this.listPageRangeItems(offset, count, options); + listBlobsFlat(options = {}) { + const include2 = []; + if (options.includeCopy) { + include2.push("copy"); + } + if (options.includeDeleted) { + include2.push("deleted"); + } + if (options.includeMetadata) { + include2.push("metadata"); + } + if (options.includeSnapshots) { + include2.push("snapshots"); + } + if (options.includeVersions) { + include2.push("versions"); + } + if (options.includeUncommitedBlobs) { + include2.push("uncommittedblobs"); + } + if (options.includeTags) { + include2.push("tags"); + } + if (options.includeDeletedWithVersions) { + include2.push("deletedwithversions"); + } + if (options.includeImmutabilityPolicy) { + include2.push("immutabilitypolicy"); + } + if (options.includeLegalHold) { + include2.push("legalhold"); + } + if (options.prefix === "") { + options.prefix = void 0; + } + const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const iter = this.listItems(updatedOptions); return { /** * The next method, part of the iteration protocol @@ -53021,58 +69179,240 @@ var init_Clients = __esm({ * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings2 = {}) => { - return this.listPageRangeItemSegments(offset, count, settings2.continuationToken, Object.assign({ maxPageSize: settings2.maxPageSize }, options)); + return this.listSegments(settings2.continuationToken, Object.assign({ maxPageSize: settings2.maxPageSize }, updatedOptions)); } }; } /** - * Gets the collection of page ranges that differ between a specified snapshot and this page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * Returns an AsyncIterableIterator for ContainerListBlobHierarchySegmentResponse * - * @param offset - Starting byte position of the page blob - * @param count - Number of bytes to get ranges diff. - * @param prevSnapshot - Timestamp of snapshot to retrieve the difference. - * @param options - Options to the Page Blob Get Page Ranges Diff operation. - * @returns Response data for the Page Blob Get Page Range Diff operation. + * @param delimiter - The character or string used to define the virtual hierarchy + * @param marker - A string value that identifies the portion of + * the list of blobs to be returned with the next listing operation. The + * operation returns the ContinuationToken value within the response body if the + * listing operation did not return all blobs remaining to be listed + * with the current page. The ContinuationToken value can be used as the value for + * the marker parameter in a subsequent call to request the next page of list + * items. The marker value is opaque to the client. + * @param options - Options to list blobs operation. */ - async getPageRangesDiff(offset, count, prevSnapshot, options = {}) { - var _a2; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan2("PageBlobClient-getPageRangesDiff", options); - try { - return await this.pageBlobContext.getPageRangesDiff(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), prevsnapshot: prevSnapshot, range: rangeToString({ offset, count }) }, convertTracingToRequestOptionsBase(updatedOptions))).then(rangeResponseFromModel); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + listHierarchySegments(delimiter2, marker2, options = {}) { + return __asyncGenerator(this, arguments, function* listHierarchySegments_1() { + let listBlobsHierarchySegmentResponse; + if (!!marker2 || marker2 === void 0) { + do { + listBlobsHierarchySegmentResponse = yield __await(this.listBlobHierarchySegment(delimiter2, marker2, options)); + marker2 = listBlobsHierarchySegmentResponse.continuationToken; + yield yield __await(yield __await(listBlobsHierarchySegmentResponse)); + } while (marker2); + } + }); + } + /** + * Returns an AsyncIterableIterator for {@link BlobPrefix} and {@link BlobItem} objects. + * + * @param delimiter - The character or string used to define the virtual hierarchy + * @param options - Options to list blobs operation. + */ + listItemsByHierarchy(delimiter2, options = {}) { + return __asyncGenerator(this, arguments, function* listItemsByHierarchy_1() { + var e_2, _a2; + let marker2; + try { + for (var _b2 = __asyncValues(this.listHierarchySegments(delimiter2, marker2, options)), _c2; _c2 = yield __await(_b2.next()), !_c2.done; ) { + const listBlobsHierarchySegmentResponse = _c2.value; + const segment = listBlobsHierarchySegmentResponse.segment; + if (segment.blobPrefixes) { + for (const prefix2 of segment.blobPrefixes) { + yield yield __await(Object.assign({ kind: "prefix" }, prefix2)); + } + } + for (const blob of segment.blobItems) { + yield yield __await(Object.assign({ kind: "blob" }, blob)); + } + } + } catch (e_2_1) { + e_2 = { error: e_2_1 }; + } finally { + try { + if (_c2 && !_c2.done && (_a2 = _b2.return)) + yield __await(_a2.call(_b2)); + } finally { + if (e_2) + throw e_2.error; + } + } + }); + } + /** + * Returns an async iterable iterator to list all the blobs by hierarchy. + * under the specified account. + * + * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages. + * + * Example using `for await` syntax: + * + * ```js + * for await (const item of containerClient.listBlobsByHierarchy("/")) { + * if (item.kind === "prefix") { + * console.log(`\tBlobPrefix: ${item.name}`); + * } else { + * console.log(`\tBlobItem: name - ${item.name}`); + * } + * } + * ``` + * + * Example using `iter.next()`: + * + * ```js + * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); + * let entity = await iter.next(); + * while (!entity.done) { + * let item = entity.value; + * if (item.kind === "prefix") { + * console.log(`\tBlobPrefix: ${item.name}`); + * } else { + * console.log(`\tBlobItem: name - ${item.name}`); + * } + * entity = await iter.next(); + * } + * ``` + * + * Example using `byPage()`: + * + * ```js + * console.log("Listing blobs by hierarchy by page"); + * for await (const response of containerClient.listBlobsByHierarchy("/").byPage()) { + * const segment = response.segment; + * if (segment.blobPrefixes) { + * for (const prefix of segment.blobPrefixes) { + * console.log(`\tBlobPrefix: ${prefix.name}`); + * } + * } + * for (const blob of response.segment.blobItems) { + * console.log(`\tBlobItem: name - ${blob.name}`); + * } + * } + * ``` + * + * Example using paging with a max page size: + * + * ```js + * console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size"); + * + * let i = 1; + * for await (const response of containerClient + * .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" }) + * .byPage({ maxPageSize: 2 })) { + * console.log(`Page ${i++}`); + * const segment = response.segment; + * + * if (segment.blobPrefixes) { + * for (const prefix of segment.blobPrefixes) { + * console.log(`\tBlobPrefix: ${prefix.name}`); + * } + * } + * + * for (const blob of response.segment.blobItems) { + * console.log(`\tBlobItem: name - ${blob.name}`); + * } + * } + * ``` + * + * @param delimiter - The character or string used to define the virtual hierarchy + * @param options - Options to list blobs operation. + */ + listBlobsByHierarchy(delimiter2, options = {}) { + if (delimiter2 === "") { + throw new RangeError("delimiter should contain one or more characters"); + } + const include2 = []; + if (options.includeCopy) { + include2.push("copy"); + } + if (options.includeDeleted) { + include2.push("deleted"); + } + if (options.includeMetadata) { + include2.push("metadata"); + } + if (options.includeSnapshots) { + include2.push("snapshots"); + } + if (options.includeVersions) { + include2.push("versions"); + } + if (options.includeUncommitedBlobs) { + include2.push("uncommittedblobs"); + } + if (options.includeTags) { + include2.push("tags"); + } + if (options.includeDeletedWithVersions) { + include2.push("deletedwithversions"); + } + if (options.includeImmutabilityPolicy) { + include2.push("immutabilitypolicy"); } + if (options.includeLegalHold) { + include2.push("legalhold"); + } + if (options.prefix === "") { + options.prefix = void 0; + } + const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const iter = this.listItemsByHierarchy(delimiter2, updatedOptions); + return { + /** + * The next method, part of the iteration protocol + */ + async next() { + return iter.next(); + }, + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator]() { + return this; + }, + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings2 = {}) => { + return this.listHierarchySegments(delimiter2, settings2.continuationToken, Object.assign({ maxPageSize: settings2.maxPageSize }, updatedOptions)); + } + }; } /** - * getPageRangesDiffSegment returns a single segment of page ranges starting from the - * specified Marker for difference between previous snapshot and the target page blob. - * Use an empty Marker to start enumeration from the beginning. - * After getting a segment, process it, and then call getPageRangesDiffSegment again - * (passing the the previously-returned Marker) to get the next segment. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * The Filter Blobs operation enables callers to list blobs in the container whose tags + * match a given search expression. * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference. - * @param marker - A string value that identifies the portion of the get to be returned with the next get operation. - * @param options - Options to the Page Blob Get Page Ranges Diff operation. + * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. + * The given expression must evaluate to true for a blob to be returned in the results. + * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; + * however, only a subset of the OData filter syntax is supported in the Blob service. + * @param marker - A string value that identifies the portion of + * the list of blobs to be returned with the next listing operation. The + * operation returns the continuationToken value within the response body if the + * listing operation did not return all blobs remaining to be listed + * with the current page. The continuationToken value can be used as the value for + * the marker parameter in a subsequent call to request the next page of list + * items. The marker value is opaque to the client. + * @param options - Options to find blobs by tags. */ - async listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options) { - var _a2; - const { span, updatedOptions } = createSpan2("PageBlobClient-getPageRangesDiffSegment", options); + async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { + const { span, updatedOptions } = createSpan2("ContainerClient-findBlobsByTagsSegment", options); try { - return await this.pageBlobContext.getPageRangesDiff(Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a2 = options === null || options === void 0 ? void 0 : options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), prevsnapshot: prevSnapshotOrUrl, range: rangeToString({ - offset, - count - }), marker: marker2, maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions))); + const response = await this.containerContext.filterBlobs(Object.assign({ abortSignal: options.abortSignal, where: tagFilterSqlExpression, marker: marker2, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions))); + const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { + var _a2; + let tagValue = ""; + if (((_a2 = blob.tags) === null || _a2 === void 0 ? void 0 : _a2.blobTagSet.length) === 1) { + tagValue = blob.tags.blobTagSet[0].value; + } + return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); + }) }); + return wrappedResponse; } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -53084,77 +69424,77 @@ var init_Clients = __esm({ } } /** - * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesDiffResponseModel} - * + * Returns an AsyncIterableIterator for ContainerFindBlobsByTagsSegmentResponse. * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference. + * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. + * The given expression must evaluate to true for a blob to be returned in the results. + * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; + * however, only a subset of the OData filter syntax is supported in the Blob service. * @param marker - A string value that identifies the portion of - * the get of page ranges to be returned with the next getting operation. The - * operation returns the ContinuationToken value within the response body if the - * getting operation did not return all page ranges remaining within the current page. - * The ContinuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of get + * the list of blobs to be returned with the next listing operation. The + * operation returns the continuationToken value within the response body if the + * listing operation did not return all blobs remaining to be listed + * with the current page. The continuationToken value can be used as the value for + * the marker parameter in a subsequent call to request the next page of list * items. The marker value is opaque to the client. - * @param options - Options to the Page Blob Get Page Ranges Diff operation. + * @param options - Options to find blobs by tags. */ - listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options) { - return __asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() { - let getPageRangeItemSegmentsResponse; + findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options = {}) { + return __asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1() { + let response; if (!!marker2 || marker2 === void 0) { do { - getPageRangeItemSegmentsResponse = yield __await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield __await(yield __await(getPageRangeItemSegmentsResponse)); + response = yield __await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); + response.blobs = response.blobs || []; + marker2 = response.continuationToken; + yield yield __await(response); } while (marker2); } }); } /** - * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects + * Returns an AsyncIterableIterator for blobs. * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference. - * @param options - Options to the Page Blob Get Page Ranges Diff operation. + * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. + * The given expression must evaluate to true for a blob to be returned in the results. + * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; + * however, only a subset of the OData filter syntax is supported in the Blob service. + * @param options - Options to findBlobsByTagsItems. */ - listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { - return __asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() { - var e_2, _a2; + findBlobsByTagsItems(tagFilterSqlExpression, options = {}) { + return __asyncGenerator(this, arguments, function* findBlobsByTagsItems_1() { + var e_3, _a2; let marker2; try { - for (var _b = __asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options)), _c; _c = yield __await(_b.next()), !_c.done; ) { - const getPageRangesSegment = _c.value; - yield __await(yield* __asyncDelegator(__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); + for (var _b2 = __asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _c2; _c2 = yield __await(_b2.next()), !_c2.done; ) { + const segment = _c2.value; + yield __await(yield* __asyncDelegator(__asyncValues(segment.blobs))); } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; + } catch (e_3_1) { + e_3 = { error: e_3_1 }; } finally { try { - if (_c && !_c.done && (_a2 = _b.return)) - yield __await(_a2.call(_b)); + if (_c2 && !_c2.done && (_a2 = _b2.return)) + yield __await(_a2.call(_b2)); } finally { - if (e_2) - throw e_2.error; + if (e_3) + throw e_3.error; } } }); } /** - * Returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * Returns an async iterable iterator to find all blobs with specified tag + * under the specified container. * - * .byPage() returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob. + * .byPage() returns an async iterable iterator to list the blobs in pages. * * Example using `for await` syntax: * * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRangesDiff()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * for await (const blob of containerClient.findBlobsByTags("tagkey='tagvalue'")) { + * console.log(`Blob ${i++}: ${blob.name}`); * } * ``` * @@ -53162,11 +69502,11 @@ var init_Clients = __esm({ * * ```js * let i = 1; - * let iter = pageBlobClient.listPageRangesDiff(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'"); + * let blobItem = await iter.next(); + * while (!blobItem.done) { + * console.log(`Blob ${i++}: ${blobItem.value.name}`); + * blobItem = await iter.next(); * } * ``` * @@ -53175,9 +69515,11 @@ var init_Clients = __esm({ * ```js * // passing optional maxPageSize in the page settings * let i = 1; - * for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { + * if (response.blobs) { + * for (const blob of response.blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * } * ``` @@ -53186,36 +69528,41 @@ var init_Clients = __esm({ * * ```js * let i = 1; - * let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 }); + * let iterator = containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; * - * // Prints 2 page ranges - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * // Prints 2 blob names + * if (response.blobs) { + * for (const blob of response.blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * * // Gets next marker * let marker = response.continuationToken; - * * // Passing next marker as continuationToken - * - * iterator = pageBlobClient.listPageRangesDiff().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = containerClient + * .findBlobsByTags("tagkey='tagvalue'") + * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; * - * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * // Prints blob names + * if (response.blobs) { + * for (const blob of response.blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * ``` - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param prevSnapshot - Timestamp of snapshot to retrieve the difference. - * @param options - Options to the Page Blob Get Ranges operation. - * @returns An asyncIterableIterator that supports paging. + * + * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. + * The given expression must evaluate to true for a blob to be returned in the results. + * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; + * however, only a subset of the OData filter syntax is supported in the Blob service. + * @param options - Options to find blobs by tags. */ - listPageRangesDiff(offset, count, prevSnapshot, options = {}) { - options.conditions = options.conditions || {}; - const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options)); + findBlobsByTags(tagFilterSqlExpression, options = {}) { + const listSegmentOptions = Object.assign({}, options); + const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** * The next method, part of the iteration protocol @@ -53233,961 +69580,534 @@ var init_Clients = __esm({ * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings2 = {}) => { - return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings2.continuationToken, Object.assign({ maxPageSize: settings2.maxPageSize }, options)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings2.continuationToken, Object.assign({ maxPageSize: settings2.maxPageSize }, listSegmentOptions)); } }; } - /** - * Gets the collection of page ranges that differ between a specified snapshot and this page blob for managed disks. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges - * - * @param offset - Starting byte position of the page blob - * @param count - Number of bytes to get ranges diff. - * @param prevSnapshotUrl - URL of snapshot to retrieve the difference. - * @param options - Options to the Page Blob Get Page Ranges Diff operation. - * @returns Response data for the Page Blob Get Page Range Diff operation. - */ - async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl2, options = {}) { - var _a2; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan2("PageBlobClient-GetPageRangesDiffForManagedDisks", options); + getContainerNameFromUrl() { + let containerName; try { - return await this.pageBlobContext.getPageRangesDiff(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), prevSnapshotUrl: prevSnapshotUrl2, range: rangeToString({ offset, count }) }, convertTracingToRequestOptionsBase(updatedOptions))).then(rangeResponseFromModel); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + const parsedUrl = URLBuilder.parse(this.url); + if (parsedUrl.getHost().split(".")[1] === "blob") { + containerName = parsedUrl.getPath().split("/")[1]; + } else if (isIpEndpointStyle(parsedUrl)) { + containerName = parsedUrl.getPath().split("/")[2]; + } else { + containerName = parsedUrl.getPath().split("/")[1]; + } + containerName = decodeURIComponent(containerName); + if (!containerName) { + throw new Error("Provided containerName is invalid."); + } + return containerName; + } catch (error) { + throw new Error("Unable to extract containerName with provided information."); } } /** - * Resizes the page blob to the specified size (which must be a multiple of 512). - * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties + * Only available for ContainerClient constructed with a shared key credential. * - * @param size - Target size - * @param options - Options to the Page Blob Resize operation. - * @returns Response data for the Page Blob Resize operation. - */ - async resize(size, options = {}) { - var _a2; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan2("PageBlobClient-resize", options); - try { - return await this.pageBlobContext.resize(size, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } - } - /** - * Sets a page blob's sequence number. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * Generates a Blob Container Service Shared Access Signature (SAS) URI based on the client properties + * and parameters passed in. The SAS is signed by the shared key credential of the client. * - * @param sequenceNumberAction - Indicates how the service should modify the blob's sequence number. - * @param sequenceNumber - Required if sequenceNumberAction is max or update - * @param options - Options to the Page Blob Update Sequence Number operation. - * @returns Response data for the Page Blob Update Sequence Number operation. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * + * @param options - Optional parameters. + * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. */ - async updateSequenceNumber(sequenceNumberAction2, sequenceNumber, options = {}) { - var _a2; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan2("PageBlobClient-updateSequenceNumber", options); - try { - return await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction2, Object.assign({ abortSignal: options.abortSignal, blobSequenceNumber: sequenceNumber, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } + generateSasUrl(options) { + return new Promise((resolve2) => { + if (!(this.credential instanceof StorageSharedKeyCredential)) { + throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); + } + const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString(); + resolve2(appendToURLQuery(this.url, sas)); + }); } /** - * Begins an operation to start an incremental copy from one page blob's snapshot to this page blob. - * The snapshot is copied such that only the differential changes between the previously - * copied snapshot are transferred to the destination. - * The copied snapshots are complete copies of the original snapshot and can be read or copied from as usual. - * @see https://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob - * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots + * Creates a BlobBatchClient object to conduct batch operations. * - * @param copySource - Specifies the name of the source page blob snapshot. For example, - * https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot= - * @param options - Options to the Page Blob Copy Incremental operation. - * @returns Response data for the Page Blob Copy Incremental operation. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * + * @returns A new BlobBatchClient object for this container. */ - async startCopyIncremental(copySource2, options = {}) { - var _a2; - const { span, updatedOptions } = createSpan2("PageBlobClient-startCopyIncremental", options); - try { - return await this.pageBlobContext.copyIncremental(copySource2, Object.assign({ abortSignal: options.abortSignal, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } - } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BatchUtils.js -async function getBodyAsText(batchResponse) { - let buffer = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES); - const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer); - buffer = buffer.slice(0, responseLength); - return buffer.toString(); -} -function utf8ByteLength(str) { - return Buffer.byteLength(str); -} -var init_BatchUtils = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BatchUtils.js"() { - init_utils_node(); - init_constants2(); - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BatchResponseParser.js -var HTTP_HEADER_DELIMITER, SPACE_DELIMITER, NOT_FOUND, BatchResponseParser; -var init_BatchResponseParser = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BatchResponseParser.js"() { - init_src5(); - init_constants2(); - init_BatchUtils(); - init_log3(); - HTTP_HEADER_DELIMITER = ": "; - SPACE_DELIMITER = " "; - NOT_FOUND = -1; - BatchResponseParser = class { - constructor(batchResponse, subRequests) { - if (!batchResponse || !batchResponse.contentType) { - throw new RangeError("batchResponse is malformed or doesn't contain valid content-type."); - } - if (!subRequests || subRequests.size === 0) { - throw new RangeError("Invalid state: subRequests is not provided or size is 0."); - } - this.batchResponse = batchResponse; - this.subRequests = subRequests; - this.responseBatchBoundary = this.batchResponse.contentType.split("=")[1]; - this.perResponsePrefix = `--${this.responseBatchBoundary}${HTTP_LINE_ENDING}`; - this.batchResponseEnding = `--${this.responseBatchBoundary}--`; - } - // For example of response, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#response - async parseBatchResponse() { - if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) { - throw new Error(`Invalid state: batch request failed with status: '${this.batchResponse._response.status}'.`); - } - const responseBodyAsText = await getBodyAsText(this.batchResponse); - const subResponses = responseBodyAsText.split(this.batchResponseEnding)[0].split(this.perResponsePrefix).slice(1); - const subResponseCount = subResponses.length; - if (subResponseCount !== this.subRequests.size && subResponseCount !== 1) { - throw new Error("Invalid state: sub responses' count is not equal to sub requests' count."); - } - const deserializedSubResponses = new Array(subResponseCount); - let subResponsesSucceededCount = 0; - let subResponsesFailedCount = 0; - for (let index = 0; index < subResponseCount; index++) { - const subResponse = subResponses[index]; - const deserializedSubResponse = {}; - deserializedSubResponse.headers = new HttpHeaders(); - const responseLines = subResponse.split(`${HTTP_LINE_ENDING}`); - let subRespHeaderStartFound = false; - let subRespHeaderEndFound = false; - let subRespFailed = false; - let contentId = NOT_FOUND; - for (const responseLine of responseLines) { - if (!subRespHeaderStartFound) { - if (responseLine.startsWith(HeaderConstants.CONTENT_ID)) { - contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); - } - if (responseLine.startsWith(HTTP_VERSION_1_1)) { - subRespHeaderStartFound = true; - const tokens = responseLine.split(SPACE_DELIMITER); - deserializedSubResponse.status = parseInt(tokens[1]); - deserializedSubResponse.statusMessage = tokens.slice(2).join(SPACE_DELIMITER); - } - continue; - } - if (responseLine.trim() === "") { - if (!subRespHeaderEndFound) { - subRespHeaderEndFound = true; - } - continue; - } - if (!subRespHeaderEndFound) { - if (responseLine.indexOf(HTTP_HEADER_DELIMITER) === -1) { - throw new Error(`Invalid state: find non-empty line '${responseLine}' without HTTP header delimiter '${HTTP_HEADER_DELIMITER}'.`); - } - const tokens = responseLine.split(HTTP_HEADER_DELIMITER); - deserializedSubResponse.headers.set(tokens[0], tokens[1]); - if (tokens[0] === HeaderConstants.X_MS_ERROR_CODE) { - deserializedSubResponse.errorCode = tokens[1]; - subRespFailed = true; - } - } else { - if (!deserializedSubResponse.bodyAsText) { - deserializedSubResponse.bodyAsText = ""; - } - deserializedSubResponse.bodyAsText += responseLine; - } - } - if (contentId !== NOT_FOUND && Number.isInteger(contentId) && contentId >= 0 && contentId < this.subRequests.size && deserializedSubResponses[contentId] === void 0) { - deserializedSubResponse._request = this.subRequests.get(contentId); - deserializedSubResponses[contentId] = deserializedSubResponse; - } else { - logger2.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); - } - if (subRespFailed) { - subResponsesFailedCount++; - } else { - subResponsesSucceededCount++; - } - } - return { - subResponses: deserializedSubResponses, - subResponsesSucceededCount, - subResponsesFailedCount - }; + getBlobBatchClient() { + return new BlobBatchClient(this.url, this.pipeline); } }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/Mutex.js -var MutexLockStatus, Mutex; -var init_Mutex = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/Mutex.js"() { - (function(MutexLockStatus2) { - MutexLockStatus2[MutexLockStatus2["LOCKED"] = 0] = "LOCKED"; - MutexLockStatus2[MutexLockStatus2["UNLOCKED"] = 1] = "UNLOCKED"; - })(MutexLockStatus || (MutexLockStatus = {})); - Mutex = class { - /** - * Lock for a specific key. If the lock has been acquired by another customer, then - * will wait until getting the lock. - * - * @param key - lock key - */ - static async lock(key) { - return new Promise((resolve2) => { - if (this.keys[key] === void 0 || this.keys[key] === MutexLockStatus.UNLOCKED) { - this.keys[key] = MutexLockStatus.LOCKED; - resolve2(); - } else { - this.onUnlockEvent(key, () => { - this.keys[key] = MutexLockStatus.LOCKED; - resolve2(); - }); - } - }); +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/AccountSASPermissions.js +var AccountSASPermissions; +var init_AccountSASPermissions = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/AccountSASPermissions.js"() { + AccountSASPermissions = class _AccountSASPermissions { + constructor() { + this.read = false; + this.write = false; + this.delete = false; + this.deleteVersion = false; + this.list = false; + this.add = false; + this.create = false; + this.update = false; + this.process = false; + this.tag = false; + this.filter = false; + this.setImmutabilityPolicy = false; + this.permanentDelete = false; } /** - * Unlock a key. + * Parse initializes the AccountSASPermissions fields from a string. * - * @param key - + * @param permissions - */ - static async unlock(key) { - return new Promise((resolve2) => { - if (this.keys[key] === MutexLockStatus.LOCKED) { - this.emitUnlockEvent(key); - } - delete this.keys[key]; - resolve2(); - }); - } - static onUnlockEvent(key, handler) { - if (this.listeners[key] === void 0) { - this.listeners[key] = [handler]; - } else { - this.listeners[key].push(handler); - } - } - static emitUnlockEvent(key) { - if (this.listeners[key] !== void 0 && this.listeners[key].length > 0) { - const handler = this.listeners[key].shift(); - setImmediate(() => { - handler.call(this); - }); + static parse(permissions) { + const accountSASPermissions = new _AccountSASPermissions(); + for (const c2 of permissions) { + switch (c2) { + case "r": + accountSASPermissions.read = true; + break; + case "w": + accountSASPermissions.write = true; + break; + case "d": + accountSASPermissions.delete = true; + break; + case "x": + accountSASPermissions.deleteVersion = true; + break; + case "l": + accountSASPermissions.list = true; + break; + case "a": + accountSASPermissions.add = true; + break; + case "c": + accountSASPermissions.create = true; + break; + case "u": + accountSASPermissions.update = true; + break; + case "p": + accountSASPermissions.process = true; + break; + case "t": + accountSASPermissions.tag = true; + break; + case "f": + accountSASPermissions.filter = true; + break; + case "i": + accountSASPermissions.setImmutabilityPolicy = true; + break; + case "y": + accountSASPermissions.permanentDelete = true; + break; + default: + throw new RangeError(`Invalid permission character: ${c2}`); + } } - } - }; - Mutex.keys = {}; - Mutex.listeners = {}; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobBatch.js -var BlobBatch, InnerBatchRequest, BatchRequestAssemblePolicy, BatchRequestAssemblePolicyFactory, BatchHeaderFilterPolicy, BatchHeaderFilterPolicyFactory; -var init_BlobBatch = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobBatch.js"() { - init_src5(); - init_src4(); - init_AnonymousCredential(); - init_Clients(); - init_Mutex(); - init_Pipeline(); - init_utils_common(); - init_constants2(); - init_StorageSharedKeyCredential(); - init_tracing(); - BlobBatch = class { - constructor() { - this.batch = "batch"; - this.batchRequest = new InnerBatchRequest(); - } - /** - * Get the value of Content-Type for a batch request. - * The value must be multipart/mixed with a batch boundary. - * Example: multipart/mixed; boundary=batch_a81786c8-e301-4e42-a729-a32ca24ae252 - */ - getMultiPartContentType() { - return this.batchRequest.getMultipartContentType(); + return accountSASPermissions; } /** - * Get assembled HTTP request body for sub requests. + * Creates a {@link AccountSASPermissions} from a raw object which contains same keys as it + * and boolean values for them. + * + * @param permissionLike - */ - getHttpRequestBody() { - return this.batchRequest.getHttpRequestBody(); + static from(permissionLike) { + const accountSASPermissions = new _AccountSASPermissions(); + if (permissionLike.read) { + accountSASPermissions.read = true; + } + if (permissionLike.write) { + accountSASPermissions.write = true; + } + if (permissionLike.delete) { + accountSASPermissions.delete = true; + } + if (permissionLike.deleteVersion) { + accountSASPermissions.deleteVersion = true; + } + if (permissionLike.filter) { + accountSASPermissions.filter = true; + } + if (permissionLike.tag) { + accountSASPermissions.tag = true; + } + if (permissionLike.list) { + accountSASPermissions.list = true; + } + if (permissionLike.add) { + accountSASPermissions.add = true; + } + if (permissionLike.create) { + accountSASPermissions.create = true; + } + if (permissionLike.update) { + accountSASPermissions.update = true; + } + if (permissionLike.process) { + accountSASPermissions.process = true; + } + if (permissionLike.setImmutabilityPolicy) { + accountSASPermissions.setImmutabilityPolicy = true; + } + if (permissionLike.permanentDelete) { + accountSASPermissions.permanentDelete = true; + } + return accountSASPermissions; } /** - * Get sub requests that are added into the batch request. + * Produces the SAS permissions string for an Azure Storage account. + * Call this method to set AccountSASSignatureValues Permissions field. + * + * Using this method will guarantee the resource types are in + * an order accepted by the service. + * + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * */ - getSubRequests() { - return this.batchRequest.getSubRequests(); - } - async addSubRequestInternal(subRequest, assembleSubRequestFunc) { - await Mutex.lock(this.batch); - try { - this.batchRequest.preAddSubRequest(subRequest); - await assembleSubRequestFunc(); - this.batchRequest.postAddSubRequest(subRequest); - } finally { - await Mutex.unlock(this.batch); + toString() { + const permissions = []; + if (this.read) { + permissions.push("r"); } - } - setBatchType(batchType) { - if (!this.batchType) { - this.batchType = batchType; + if (this.write) { + permissions.push("w"); } - if (this.batchType !== batchType) { - throw new RangeError(`BlobBatch only supports one operation type per batch and it already is being used for ${this.batchType} operations.`); + if (this.delete) { + permissions.push("d"); } - } - async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { - let url2; - let credential; - if (typeof urlOrBlobClient === "string" && (isNode && credentialOrOptions instanceof StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential || isTokenCredential(credentialOrOptions))) { - url2 = urlOrBlobClient; - credential = credentialOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; - credential = urlOrBlobClient.credential; - options = credentialOrOptions; - } else { - throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); + if (this.deleteVersion) { + permissions.push("x"); } - if (!options) { - options = {}; + if (this.filter) { + permissions.push("f"); } - const { span, updatedOptions } = createSpan2("BatchDeleteRequest-addSubRequest", options); - try { - this.setBatchType("delete"); - await this.addSubRequestInternal({ - url: url2, - credential - }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).delete(updatedOptions); - }); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + if (this.tag) { + permissions.push("t"); } - } - async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { - let url2; - let credential; - let tier2; - if (typeof urlOrBlobClient === "string" && (isNode && credentialOrTier instanceof StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential || isTokenCredential(credentialOrTier))) { - url2 = urlOrBlobClient; - credential = credentialOrTier; - tier2 = tierOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; - credential = urlOrBlobClient.credential; - tier2 = credentialOrTier; - options = tierOrOptions; - } else { - throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); + if (this.list) { + permissions.push("l"); } - if (!options) { - options = {}; + if (this.add) { + permissions.push("a"); } - const { span, updatedOptions } = createSpan2("BatchSetTierRequest-addSubRequest", options); - try { - this.setBatchType("setAccessTier"); - await this.addSubRequestInternal({ - url: url2, - credential - }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).setAccessTier(tier2, updatedOptions); - }); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + if (this.create) { + permissions.push("c"); + } + if (this.update) { + permissions.push("u"); + } + if (this.process) { + permissions.push("p"); + } + if (this.setImmutabilityPolicy) { + permissions.push("i"); + } + if (this.permanentDelete) { + permissions.push("y"); } + return permissions.join(""); } }; - InnerBatchRequest = class { + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/AccountSASResourceTypes.js +var AccountSASResourceTypes; +var init_AccountSASResourceTypes = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/AccountSASResourceTypes.js"() { + AccountSASResourceTypes = class _AccountSASResourceTypes { constructor() { - this.operationCount = 0; - this.body = ""; - const tempGuid = generateUuid(); - this.boundary = `batch_${tempGuid}`; - this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`; - this.multipartContentType = `multipart/mixed; boundary=${this.boundary}`; - this.batchRequestEnding = `--${this.boundary}--`; - this.subRequests = /* @__PURE__ */ new Map(); + this.service = false; + this.container = false; + this.object = false; } /** - * Create pipeline to assemble sub requests. The idea here is to use existing - * credential and serialization/deserialization components, with additional policies to - * filter unnecessary headers, assemble sub requests into request's body - * and intercept request from going to wire. - * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used. + * Creates an {@link AccountSASResourceTypes} from the specified resource types string. This method will throw an + * Error if it encounters a character that does not correspond to a valid resource type. + * + * @param resourceTypes - */ - createPipeline(credential) { - const isAnonymousCreds = credential instanceof AnonymousCredential; - const policyFactoryLength = 3 + (isAnonymousCreds ? 0 : 1); - const factories = new Array(policyFactoryLength); - factories[0] = deserializationPolicy(); - factories[1] = new BatchHeaderFilterPolicyFactory(); - if (!isAnonymousCreds) { - factories[2] = isTokenCredential(credential) ? attachCredential(bearerTokenAuthenticationPolicy(credential, StorageOAuthScopes), credential) : credential; - } - factories[policyFactoryLength - 1] = new BatchRequestAssemblePolicyFactory(this); - return new Pipeline(factories, {}); - } - appendSubRequestToBody(request) { - this.body += [ - this.subRequestPrefix, - `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, - "", - `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` - // sub request start line with method - ].join(HTTP_LINE_ENDING); - for (const header of request.headers.headersArray()) { - this.body += `${header.name}: ${header.value}${HTTP_LINE_ENDING}`; + static parse(resourceTypes) { + const accountSASResourceTypes = new _AccountSASResourceTypes(); + for (const c2 of resourceTypes) { + switch (c2) { + case "s": + accountSASResourceTypes.service = true; + break; + case "c": + accountSASResourceTypes.container = true; + break; + case "o": + accountSASResourceTypes.object = true; + break; + default: + throw new RangeError(`Invalid resource type: ${c2}`); + } } - this.body += HTTP_LINE_ENDING; + return accountSASResourceTypes; } - preAddSubRequest(subRequest) { - if (this.operationCount >= BATCH_MAX_REQUEST) { - throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`); - } - const path15 = getURLPath(subRequest.url); - if (!path15 || path15 === "") { - throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); + /** + * Converts the given resource types to a string. + * + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * + */ + toString() { + const resourceTypes = []; + if (this.service) { + resourceTypes.push("s"); } - } - postAddSubRequest(subRequest) { - this.subRequests.set(this.operationCount, subRequest); - this.operationCount++; - } - // Return the http request body with assembling the ending line to the sub request body. - getHttpRequestBody() { - return `${this.body}${this.batchRequestEnding}${HTTP_LINE_ENDING}`; - } - getMultipartContentType() { - return this.multipartContentType; - } - getSubRequests() { - return this.subRequests; - } - }; - BatchRequestAssemblePolicy = class extends BaseRequestPolicy { - constructor(batchRequest, nextPolicy, options) { - super(nextPolicy, options); - this.dummyResponse = { - request: new WebResource(), - status: 200, - headers: new HttpHeaders() - }; - this.batchRequest = batchRequest; - } - async sendRequest(request) { - await this.batchRequest.appendSubRequestToBody(request); - return this.dummyResponse; - } - }; - BatchRequestAssemblePolicyFactory = class { - constructor(batchRequest) { - this.batchRequest = batchRequest; - } - create(nextPolicy, options) { - return new BatchRequestAssemblePolicy(this.batchRequest, nextPolicy, options); - } - }; - BatchHeaderFilterPolicy = class extends BaseRequestPolicy { - // The base class has a protected constructor. Adding a public one to enable constructing of this class. - /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/ - constructor(nextPolicy, options) { - super(nextPolicy, options); - } - async sendRequest(request) { - let xMsHeaderName = ""; - for (const header of request.headers.headersArray()) { - if (iEqual(header.name, HeaderConstants.X_MS_VERSION)) { - xMsHeaderName = header.name; - } + if (this.container) { + resourceTypes.push("c"); } - if (xMsHeaderName !== "") { - request.headers.remove(xMsHeaderName); + if (this.object) { + resourceTypes.push("o"); } - return this._nextPolicy.sendRequest(request); - } - }; - BatchHeaderFilterPolicyFactory = class { - create(nextPolicy, options) { - return new BatchHeaderFilterPolicy(nextPolicy, options); + return resourceTypes.join(""); } }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobBatchClient.js -var BlobBatchClient; -var init_BlobBatchClient = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobBatchClient.js"() { - init_BatchResponseParser(); - init_BatchUtils(); - init_BlobBatch(); - init_src4(); - init_tracing(); - init_operations(); - init_AnonymousCredential(); - init_storageClientContext(); - init_Pipeline(); - init_utils_common(); - BlobBatchClient = class { - constructor(url2, credentialOrPipeline, options) { - let pipeline; - if (isPipelineLike(credentialOrPipeline)) { - pipeline = credentialOrPipeline; - } else if (!credentialOrPipeline) { - pipeline = newPipeline(new AnonymousCredential(), options); - } else { - pipeline = newPipeline(credentialOrPipeline, options); - } - const storageClientContext = new StorageClientContext(url2, pipeline.toServiceClientOptions()); - const path15 = getURLPath(url2); - if (path15 && path15 !== "/") { - this.serviceOrContainerContext = new Container(storageClientContext); - } else { - this.serviceOrContainerContext = new Service(storageClientContext); - } +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/AccountSASServices.js +var AccountSASServices; +var init_AccountSASServices = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/AccountSASServices.js"() { + AccountSASServices = class _AccountSASServices { + constructor() { + this.blob = false; + this.file = false; + this.queue = false; + this.table = false; } /** - * Creates a {@link BlobBatch}. - * A BlobBatch represents an aggregated set of operations on blobs. + * Creates an {@link AccountSASServices} from the specified services string. This method will throw an + * Error if it encounters a character that does not correspond to a valid service. + * + * @param services - */ - createBatch() { - return new BlobBatch(); - } - async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) { - const batch = new BlobBatch(); - for (const urlOrBlobClient of urlsOrBlobClients) { - if (typeof urlOrBlobClient === "string") { - await batch.deleteBlob(urlOrBlobClient, credentialOrOptions, options); - } else { - await batch.deleteBlob(urlOrBlobClient, credentialOrOptions); - } - } - return this.submitBatch(batch); - } - async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, options) { - const batch = new BlobBatch(); - for (const urlOrBlobClient of urlsOrBlobClients) { - if (typeof urlOrBlobClient === "string") { - await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options); - } else { - await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions); + static parse(services) { + const accountSASServices = new _AccountSASServices(); + for (const c2 of services) { + switch (c2) { + case "b": + accountSASServices.blob = true; + break; + case "f": + accountSASServices.file = true; + break; + case "q": + accountSASServices.queue = true; + break; + case "t": + accountSASServices.table = true; + break; + default: + throw new RangeError(`Invalid service character: ${c2}`); } } - return this.submitBatch(batch); + return accountSASServices; } /** - * Submit batch request which consists of multiple subrequests. - * - * Get `blobBatchClient` and other details before running the snippets. - * `blobServiceClient.getBlobBatchClient()` gives the `blobBatchClient` - * - * Example usage: - * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.deleteBlob(urlInString0, credential0); - * await batchRequest.deleteBlob(urlInString1, credential1, { - * deleteSnapshots: "include" - * }); - * const batchResp = await blobBatchClient.submitBatch(batchRequest); - * console.log(batchResp.subResponsesSucceededCount); - * ``` - * - * Example using a lease: - * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.setBlobAccessTier(blockBlobClient0, "Cool"); - * await batchRequest.setBlobAccessTier(blockBlobClient1, "Cool", { - * conditions: { leaseId: leaseId } - * }); - * const batchResp = await blobBatchClient.submitBatch(batchRequest); - * console.log(batchResp.subResponsesSucceededCount); - * ``` - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * Converts the given services to a string. * - * @param batchRequest - A set of Delete or SetTier operations. - * @param options - */ - async submitBatch(batchRequest, options = {}) { - if (!batchRequest || batchRequest.getSubRequests().size === 0) { - throw new RangeError("Batch request should contain one or more sub requests."); + toString() { + const services = []; + if (this.blob) { + services.push("b"); } - const { span, updatedOptions } = createSpan2("BlobBatchClient-submitBatch", options); - try { - const batchRequestBody = batchRequest.getHttpRequestBody(); - const rawBatchResponse = await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign(Object.assign({}, options), convertTracingToRequestOptionsBase(updatedOptions))); - const batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); - const responseSummary = await batchResponseParser.parseBatchResponse(); - const res = { - _response: rawBatchResponse._response, - contentType: rawBatchResponse.contentType, - errorCode: rawBatchResponse.errorCode, - requestId: rawBatchResponse.requestId, - clientRequestId: rawBatchResponse.clientRequestId, - version: rawBatchResponse.version, - subResponses: responseSummary.subResponses, - subResponsesSucceededCount: responseSummary.subResponsesSucceededCount, - subResponsesFailedCount: responseSummary.subResponsesFailedCount - }; - return res; - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + if (this.table) { + services.push("t"); } + if (this.queue) { + services.push("q"); + } + if (this.file) { + services.push("f"); + } + return services.join(""); } }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/ContainerClient.js -var ContainerClient; -var init_ContainerClient = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/ContainerClient.js"() { +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js +function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyCredential) { + const version4 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; + if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version4 < "2020-08-04") { + throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); + } + if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.deleteVersion && version4 < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); + } + if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.permanentDelete && version4 < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when provided 'y' permission."); + } + if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.tag && version4 < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); + } + if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.filter && version4 < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission."); + } + if (accountSASSignatureValues.encryptionScope && version4 < "2020-12-06") { + throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); + } + const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); + const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); + const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); + let stringToSign; + if (version4 >= "2020-12-06") { + stringToSign = [ + sharedKeyCredential.accountName, + parsedPermissions, + parsedServices, + parsedResourceTypes, + accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", + truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), + accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", + version4, + accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", + "" + // Account SAS requires an additional newline character + ].join("\n"); + } else { + stringToSign = [ + sharedKeyCredential.accountName, + parsedPermissions, + parsedServices, + parsedResourceTypes, + accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", + truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), + accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", + version4, + "" + // Account SAS requires an additional newline character + ].join("\n"); + } + const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); + return new SASQueryParameters(version4, signature, parsedPermissions.toString(), parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, accountSASSignatureValues.encryptionScope); +} +var init_AccountSASSignatureValues = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js"() { + init_AccountSASPermissions(); + init_AccountSASResourceTypes(); + init_AccountSASServices(); + init_SasIPRange(); + init_SASQueryParameters(); + init_constants2(); + init_utils_common(); + } +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobServiceClient.js +var BlobServiceClient; +var init_BlobServiceClient = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobServiceClient.js"() { init_tslib_es6(); init_src5(); init_src4(); - init_AnonymousCredential(); - init_StorageSharedKeyCredential(); init_operations(); init_Pipeline(); - init_StorageClient(); - init_tracing(); + init_ContainerClient(); init_utils_common(); - init_BlobSASSignatureValues(); - init_BlobLeaseClient(); - init_Clients(); + init_StorageSharedKeyCredential(); + init_AnonymousCredential(); + init_src7(); + init_utils_common(); + init_tracing(); init_BlobBatchClient(); - ContainerClient = class extends StorageClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { + init_StorageClient(); + init_AccountSASPermissions(); + init_AccountSASSignatureValues(); + init_AccountSASServices(); + BlobServiceClient = class _BlobServiceClient extends StorageClient { + constructor(url2, credentialOrPipeline, options) { let pipeline; - let url2; - options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } else if (isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { - const containerName = credentialOrPipelineOrContainerName; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); - if (!options.proxyOptions) { - options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); - } - pipeline = newPipeline(sharedKeyCredential, options); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } else if (extractedCreds.kind === "SASConnString") { - url2 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); - } + if (isPipelineLike(credentialOrPipeline)) { + pipeline = credentialOrPipeline; + } else if (isNode && credentialOrPipeline instanceof StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential || isTokenCredential(credentialOrPipeline)) { + pipeline = newPipeline(credentialOrPipeline, options); } else { - throw new Error("Expecting non-empty strings for containerName parameter"); + pipeline = newPipeline(new AnonymousCredential(), options); } super(url2, pipeline); - this._containerName = this.getContainerNameFromUrl(); - this.containerContext = new Container(this.storageClientContext); - } - /** - * The name of the container. - */ - get containerName() { - return this._containerName; - } - /** - * Creates a new container under the specified account. If the container with - * the same name already exists, the operation fails. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container - * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata - * - * @param options - Options to Container Create operation. - * - * - * Example usage: - * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); - * const createContainerResponse = await containerClient.create(); - * console.log("Container was created successfully", createContainerResponse.requestId); - * ``` - */ - async create(options = {}) { - const { span, updatedOptions } = createSpan2("ContainerClient-create", options); - try { - return await this.containerContext.create(Object.assign(Object.assign({}, options), convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } - } - /** - * Creates a new container under the specified account. If the container with - * the same name already exists, it is not changed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container - * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata - * - * @param options - - */ - async createIfNotExists(options = {}) { - var _a2, _b; - const { span, updatedOptions } = createSpan2("ContainerClient-createIfNotExists", options); - try { - const res = await this.create(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } catch (e2) { - if (((_a2 = e2.details) === null || _a2 === void 0 ? void 0 : _a2.errorCode) === "ContainerAlreadyExists") { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: "Expected exception when creating a container only if it does not already exist." - }); - return Object.assign(Object.assign({ succeeded: false }, (_b = e2.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e2.response }); - } - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } + this.serviceContext = new Service(this.storageClientContext); } /** - * Returns true if the Azure container resource represented by this client exists; false otherwise. * - * NOTE: use this function with care since an existing container might be deleted by other clients or - * applications. Vice versa new containers with the same name might be added by other clients or - * applications after this function completes. + * Creates an instance of BlobServiceClient from connection string. * - * @param options - + * @param connectionString - Account connection string or a SAS connection string of an Azure storage account. + * [ Note - Account connection string can only be used in NODE.JS runtime. ] + * Account connection string example - + * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net` + * SAS connection string example - + * `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString` + * @param options - Optional. Options to configure the HTTP pipeline. */ - async exists(options = {}) { - const { span, updatedOptions } = createSpan2("ContainerClient-exists", options); - try { - await this.getProperties({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - }); - return true; - } catch (e2) { - if (e2.statusCode === 404) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: "Expected exception when checking container existence" - }); - return false; + static fromConnectionString(connectionString, options) { + options = options || {}; + const extractedCreds = extractConnectionStringParts(connectionString); + if (extractedCreds.kind === "AccountConnString") { + if (isNode) { + const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + if (!options.proxyOptions) { + options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + } + const pipeline = newPipeline(sharedKeyCredential, options); + return new _BlobServiceClient(extractedCreds.url, pipeline); + } else { + throw new Error("Account connection string is only supported in Node.js environment"); } - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + } else if (extractedCreds.kind === "SASConnString") { + const pipeline = newPipeline(new AnonymousCredential(), options); + return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); + } else { + throw new Error("Connection string must be either an Account connection string or a SAS connection string"); } } /** - * Creates a {@link BlobClient} - * - * @param blobName - A blob name - * @returns A new BlobClient object for the given blob name. - */ - getBlobClient(blobName) { - return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); - } - /** - * Creates an {@link AppendBlobClient} - * - * @param blobName - An append blob name - */ - getAppendBlobClient(blobName) { - return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); - } - /** - * Creates a {@link BlockBlobClient} - * - * @param blobName - A block blob name + * Creates a {@link ContainerClient} object * + * @param containerName - A container name + * @returns A new ContainerClient object for the given container name. * * Example usage: * * ```js - * const content = "Hello world!"; - * - * const blockBlobClient = containerClient.getBlockBlobClient(""); - * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); + * const containerClient = blobServiceClient.getContainerClient(""); * ``` */ - getBlockBlobClient(blobName) { - return new BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); - } - /** - * Creates a {@link PageBlobClient} - * - * @param blobName - A page blob name - */ - getPageBlobClient(blobName) { - return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); - } - /** - * Returns all user-defined metadata and system properties for the specified - * container. The data returned does not include the container's list of blobs. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties - * - * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if - * they originally contained uppercase characters. This differs from the metadata keys returned by - * the `listContainers` method of {@link BlobServiceClient} using the `includeMetadata` option, which - * will retain their original casing. - * - * @param options - Options to Container Get Properties operation. - */ - async getProperties(options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - const { span, updatedOptions } = createSpan2("ContainerClient-getProperties", options); - try { - return await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } - } - /** - * Marks the specified container for deletion. The container and any blobs - * contained within it are later deleted during garbage collection. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container - * - * @param options - Options to Container Delete operation. - */ - async delete(options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - const { span, updatedOptions } = createSpan2("ContainerClient-delete", options); - try { - return await this.containerContext.delete(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } + getContainerClient(containerName) { + return new ContainerClient(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); } /** - * Marks the specified container for deletion if it exists. The container and any blobs - * contained within it are later deleted during garbage collection. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container * - * @param options - Options to Container Delete operation. + * @param containerName - Name of the container to create. + * @param options - Options to configure Container Create operation. + * @returns Container creation response and the corresponding container client. */ - async deleteIfExists(options = {}) { - var _a2, _b; - const { span, updatedOptions } = createSpan2("ContainerClient-deleteIfExists", options); + async createContainer(containerName, options = {}) { + const { span, updatedOptions } = createSpan2("BlobServiceClient-createContainer", options); try { - const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + const containerClient = this.getContainerClient(containerName); + const containerCreateResponse = await containerClient.create(updatedOptions); + return { + containerClient, + containerCreateResponse + }; } catch (e2) { - if (((_a2 = e2.details) === null || _a2 === void 0 ? void 0 : _a2.errorCode) === "ContainerNotFound") { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: "Expected exception when deleting a container only if it exists." - }); - return Object.assign(Object.assign({ succeeded: false }, (_b = e2.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e2.response }); - } span.setStatus({ code: SpanStatusCode.ERROR, message: e2.message @@ -54198,27 +70118,17 @@ var init_ContainerClient = __esm({ } } /** - * Sets one or more user-defined name-value pairs for the specified container. - * - * If no option provided, or no metadata defined in the parameter, the container - * metadata will be removed. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata + * Deletes a Blob container. * - * @param metadata - Replace existing metadata with this value. - * If no value provided the existing metadata will be removed. - * @param options - Options to Container Set Metadata operation. + * @param containerName - Name of the container to delete. + * @param options - Options to configure Container Delete operation. + * @returns Container deletion response. */ - async setMetadata(metadata3, options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - if (options.conditions.ifUnmodifiedSince) { - throw new RangeError("the IfUnmodifiedSince must have their default values because they are ignored by the blob service"); - } - const { span, updatedOptions } = createSpan2("ContainerClient-setMetadata", options); + async deleteContainer(containerName, options = {}) { + const { span, updatedOptions } = createSpan2("BlobServiceClient-deleteContainer", options); try { - return await this.containerContext.setMetadata(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: metadata3, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions))); + const containerClient = this.getContainerClient(containerName); + return await containerClient.delete(updatedOptions); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -54230,54 +70140,24 @@ var init_ContainerClient = __esm({ } } /** - * Gets the permissions for the specified container. The permissions indicate - * whether container data may be accessed publicly. - * - * WARNING: JavaScript Date will potentially lose precision when parsing startsOn and expiresOn strings. - * For example, new Date("2018-12-31T03:44:23.8827891Z").toISOString() will get "2018-12-31T03:44:23.882Z". - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl + * Restore a previously deleted Blob container. + * This API is only functional if Container Soft Delete is enabled for the storage account associated with the container. * - * @param options - Options to Container Get Access Policy operation. + * @param deletedContainerName - Name of the previously deleted container. + * @param deletedContainerVersion - Version of the previously deleted container, used to uniquely identify the deleted container. + * @param options - Options to configure Container Restore operation. + * @returns Container deletion response. */ - async getAccessPolicy(options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - const { span, updatedOptions } = createSpan2("ContainerClient-getAccessPolicy", options); + async undeleteContainer(deletedContainerName2, deletedContainerVersion2, options = {}) { + const { span, updatedOptions } = createSpan2("BlobServiceClient-undeleteContainer", options); try { - const response = await this.containerContext.getAccessPolicy(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions))); - const res = { - _response: response._response, - blobPublicAccess: response.blobPublicAccess, - date: response.date, - etag: response.etag, - errorCode: response.errorCode, - lastModified: response.lastModified, - requestId: response.requestId, - clientRequestId: response.clientRequestId, - signedIdentifiers: [], - version: response.version - }; - for (const identifier of response) { - let accessPolicy = void 0; - if (identifier.accessPolicy) { - accessPolicy = { - permissions: identifier.accessPolicy.permissions - }; - if (identifier.accessPolicy.expiresOn) { - accessPolicy.expiresOn = new Date(identifier.accessPolicy.expiresOn); - } - if (identifier.accessPolicy.startsOn) { - accessPolicy.startsOn = new Date(identifier.accessPolicy.startsOn); - } - } - res.signedIdentifiers.push({ - accessPolicy, - id: identifier.id - }); - } - return res; + const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName2); + const containerContext = new Container(containerClient["storageClientContext"]); + const containerUndeleteResponse = await containerContext.restore(Object.assign({ + deletedContainerName: deletedContainerName2, + deletedContainerVersion: deletedContainerVersion2 + }, updatedOptions)); + return { containerClient, containerUndeleteResponse }; } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -54289,38 +70169,22 @@ var init_ContainerClient = __esm({ } } /** - * Sets the permissions for the specified container. The permissions indicate - * whether blobs in a container may be accessed publicly. - * - * When you set permissions for a container, the existing permissions are replaced. - * If no access or containerAcl provided, the existing container ACL will be - * removed. - * - * When you establish a stored access policy on a container, it may take up to 30 seconds to take effect. - * During this interval, a shared access signature that is associated with the stored access policy will - * fail with status code 403 (Forbidden), until the access policy becomes active. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl + * Rename an existing Blob Container. * - * @param access - The level of public access to data in the container. - * @param containerAcl - Array of elements each having a unique Id and details of the access policy. - * @param options - Options to Container Set Access Policy operation. + * @param sourceContainerName - The name of the source container. + * @param destinationContainerName - The new name of the container. + * @param options - Options to configure Container Rename operation. */ - async setAccessPolicy(access2, containerAcl2, options = {}) { - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan2("ContainerClient-setAccessPolicy", options); + /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */ + // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready. + async renameContainer(sourceContainerName2, destinationContainerName, options = {}) { + var _a2; + const { span, updatedOptions } = createSpan2("BlobServiceClient-renameContainer", options); try { - const acl = []; - for (const identifier of containerAcl2 || []) { - acl.push({ - accessPolicy: { - expiresOn: identifier.accessPolicy.expiresOn ? truncatedISO8061Date(identifier.accessPolicy.expiresOn) : "", - permissions: identifier.accessPolicy.permissions, - startsOn: identifier.accessPolicy.startsOn ? truncatedISO8061Date(identifier.accessPolicy.startsOn) : "" - }, - id: identifier.id - }); - } - return await this.containerContext.setAccessPolicy(Object.assign({ abortSignal: options.abortSignal, access: access2, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions))); + const containerClient = this.getContainerClient(destinationContainerName); + const containerContext = new Container(containerClient["storageClientContext"]); + const containerRenameResponse = await containerContext.rename(sourceContainerName2, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a2 = options.sourceCondition) === null || _a2 === void 0 ? void 0 : _a2.leaseId })); + return { containerClient, containerRenameResponse }; } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -54332,45 +70196,17 @@ var init_ContainerClient = __esm({ } } /** - * Get a {@link BlobLeaseClient} that manages leases on the container. - * - * @param proposeLeaseId - Initial proposed lease Id. - * @returns A new BlobLeaseClient object for managing leases on the container. - */ - getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); - } - /** - * Creates a new block blob, or updates the content of an existing block blob. - * - * Updating an existing block blob overwrites any existing metadata on the blob. - * Partial updates are not supported; the content of the existing blob is - * overwritten with the new content. To perform a partial update of a block blob's, - * use {@link BlockBlobClient.stageBlock} and {@link BlockBlobClient.commitBlockList}. - * - * This is a non-parallel uploading method, please use {@link BlockBlobClient.uploadFile}, - * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better - * performance with concurrency uploading. - * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * Gets the properties of a storage account’s Blob service, including properties + * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties * - * @param blobName - Name of the block blob to create or update. - * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function - * which returns a new Readable stream whose offset is from data source beginning. - * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a - * string including non non-Base64/Hex-encoded characters. - * @param options - Options to configure the Block Blob Upload operation. - * @returns Block Blob upload response data and the corresponding BlockBlobClient instance. + * @param options - Options to the Service Get Properties operation. + * @returns Response data for the Service Get Properties operation. */ - async uploadBlockBlob(blobName, body2, contentLength2, options = {}) { - const { span, updatedOptions } = createSpan2("ContainerClient-uploadBlockBlob", options); + async getProperties(options = {}) { + const { span, updatedOptions } = createSpan2("BlobServiceClient-getProperties", options); try { - const blockBlobClient = this.getBlockBlobClient(blobName); - const response = await blockBlobClient.upload(body2, contentLength2, updatedOptions); - return { - blockBlobClient, - response - }; + return await this.serviceContext.getProperties(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -54382,24 +70218,18 @@ var init_ContainerClient = __esm({ } } /** - * Marks the specified blob or snapshot for deletion. The blob is later deleted - * during garbage collection. Note that in order to delete a blob, you must delete - * all of its snapshots. You can delete both at the same time with the Delete - * Blob operation. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * Sets properties for a storage account’s Blob service endpoint, including properties + * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties * - * @param blobName - - * @param options - Options to Blob Delete operation. - * @returns Block blob deletion response data. + * @param properties - + * @param options - Options to the Service Set Properties operation. + * @returns Response data for the Service Set Properties operation. */ - async deleteBlob(blobName, options = {}) { - const { span, updatedOptions } = createSpan2("ContainerClient-deleteBlob", options); + async setProperties(properties, options = {}) { + const { span, updatedOptions } = createSpan2("BlobServiceClient-setProperties", options); try { - let blobClient = this.getBlobClient(blobName); - if (options.versionId) { - blobClient = blobClient.withVersion(options.versionId); - } - return await blobClient.delete(updatedOptions); + return await this.serviceContext.setProperties(properties, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -54411,24 +70241,18 @@ var init_ContainerClient = __esm({ } } /** - * listBlobFlatSegment returns a single segment of blobs starting from the - * specified Marker. Use an empty Marker to start enumeration from the beginning. - * After getting a segment, process it, and then call listBlobsFlatSegment again - * (passing the the previously-returned Marker) to get the next segment. - * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs + * Retrieves statistics related to replication for the Blob service. It is only + * available on the secondary location endpoint when read-access geo-redundant + * replication is enabled for the storage account. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-stats * - * @param marker - A string value that identifies the portion of the list to be returned with the next list operation. - * @param options - Options to Container List Blob Flat Segment operation. + * @param options - Options to the Service Get Statistics operation. + * @returns Response data for the Service Get Statistics operation. */ - async listBlobFlatSegment(marker2, options = {}) { - const { span, updatedOptions } = createSpan2("ContainerClient-listBlobFlatSegment", options); + async getStatistics(options = {}) { + const { span, updatedOptions } = createSpan2("BlobServiceClient-getStatistics", options); try { - const response = await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker: marker2 }, options), convertTracingToRequestOptionsBase(updatedOptions))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) }); - return blobItem; - }) }) }); - return wrappedResponse; + return await this.serviceContext.getStatistics(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -54440,29 +70264,19 @@ var init_ContainerClient = __esm({ } } /** - * listBlobHierarchySegment returns a single segment of blobs starting from - * the specified Marker. Use an empty Marker to start enumeration from the - * beginning. After getting a segment, process it, and then call listBlobsHierarchicalSegment - * again (passing the the previously-returned Marker) to get the next segment. - * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs + * The Get Account Information operation returns the sku name and account kind + * for the specified account. + * The Get Account Information operation is available on service versions beginning + * with version 2018-03-28. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information * - * @param delimiter - The character or string used to define the virtual hierarchy - * @param marker - A string value that identifies the portion of the list to be returned with the next list operation. - * @param options - Options to Container List Blob Hierarchy Segment operation. + * @param options - Options to the Service Get Account Info operation. + * @returns Response data for the Service Get Account Info operation. */ - async listBlobHierarchySegment(delimiter2, marker2, options = {}) { - var _a2; - const { span, updatedOptions } = createSpan2("ContainerClient-listBlobHierarchySegment", options); + async getAccountInfo(options = {}) { + const { span, updatedOptions } = createSpan2("BlobServiceClient-getAccountInfo", options); try { - const response = await this.containerContext.listBlobHierarchySegment(delimiter2, Object.assign(Object.assign({ marker: marker2 }, options), convertTracingToRequestOptionsBase(updatedOptions))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) }); - return blobItem; - }), blobPrefixes: (_a2 = response.segment.blobPrefixes) === null || _a2 === void 0 ? void 0 : _a2.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }) }) }); - return wrappedResponse; + return await this.serviceContext.getAccountInfo(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); } catch (e2) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -54474,387 +70288,37 @@ var init_ContainerClient = __esm({ } } /** - * Returns an AsyncIterableIterator for ContainerListBlobFlatSegmentResponse - * - * @param marker - A string value that identifies the portion of - * the list of blobs to be returned with the next listing operation. The - * operation returns the ContinuationToken value within the response body if the - * listing operation did not return all blobs remaining to be listed - * with the current page. The ContinuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to list blobs operation. - */ - listSegments(marker2, options = {}) { - return __asyncGenerator(this, arguments, function* listSegments_1() { - let listBlobsFlatSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsFlatSegmentResponse = yield __await(this.listBlobFlatSegment(marker2, options)); - marker2 = listBlobsFlatSegmentResponse.continuationToken; - yield yield __await(yield __await(listBlobsFlatSegmentResponse)); - } while (marker2); - } - }); - } - /** - * Returns an AsyncIterableIterator of {@link BlobItem} objects - * - * @param options - Options to list blobs operation. - */ - listItems(options = {}) { - return __asyncGenerator(this, arguments, function* listItems_1() { - var e_1, _a2; - let marker2; - try { - for (var _b = __asyncValues(this.listSegments(marker2, options)), _c; _c = yield __await(_b.next()), !_c.done; ) { - const listBlobsFlatSegmentResponse = _c.value; - yield __await(yield* __asyncDelegator(__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (_c && !_c.done && (_a2 = _b.return)) - yield __await(_a2.call(_b)); - } finally { - if (e_1) - throw e_1.error; - } - } - }); - } - /** - * Returns an async iterable iterator to list all the blobs - * under the specified account. - * - * .byPage() returns an async iterable iterator to list the blobs in pages. - * - * Example using `for await` syntax: - * - * ```js - * // Get the containerClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("");` - * let i = 1; - * for await (const blob of containerClient.listBlobsFlat()) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * let iter = containerClient.listBlobsFlat(); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let i = 1; - * let iterator = containerClient.listBlobsFlat().byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * - * // Prints 2 blob names - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * - * // Gets next marker - * let marker = response.continuationToken; - * - * // Passing next marker as continuationToken - * - * iterator = containerClient.listBlobsFlat().byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; - * - * // Prints 10 blob names - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` - * - * @param options - Options to list blobs. - * @returns An asyncIterableIterator that supports paging. - */ - listBlobsFlat(options = {}) { - const include2 = []; - if (options.includeCopy) { - include2.push("copy"); - } - if (options.includeDeleted) { - include2.push("deleted"); - } - if (options.includeMetadata) { - include2.push("metadata"); - } - if (options.includeSnapshots) { - include2.push("snapshots"); - } - if (options.includeVersions) { - include2.push("versions"); - } - if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); - } - if (options.includeTags) { - include2.push("tags"); - } - if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); - } - if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); - } - if (options.includeLegalHold) { - include2.push("legalhold"); - } - if (options.prefix === "") { - options.prefix = void 0; - } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItems(updatedOptions); - return { - /** - * The next method, part of the iteration protocol - */ - next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings2 = {}) => { - return this.listSegments(settings2.continuationToken, Object.assign({ maxPageSize: settings2.maxPageSize }, updatedOptions)); - } - }; - } - /** - * Returns an AsyncIterableIterator for ContainerListBlobHierarchySegmentResponse + * Returns a list of the containers under the specified account. + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2 * - * @param delimiter - The character or string used to define the virtual hierarchy * @param marker - A string value that identifies the portion of - * the list of blobs to be returned with the next listing operation. The - * operation returns the ContinuationToken value within the response body if the - * listing operation did not return all blobs remaining to be listed - * with the current page. The ContinuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to list blobs operation. - */ - listHierarchySegments(delimiter2, marker2, options = {}) { - return __asyncGenerator(this, arguments, function* listHierarchySegments_1() { - let listBlobsHierarchySegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsHierarchySegmentResponse = yield __await(this.listBlobHierarchySegment(delimiter2, marker2, options)); - marker2 = listBlobsHierarchySegmentResponse.continuationToken; - yield yield __await(yield __await(listBlobsHierarchySegmentResponse)); - } while (marker2); - } - }); - } - /** - * Returns an AsyncIterableIterator for {@link BlobPrefix} and {@link BlobItem} objects. - * - * @param delimiter - The character or string used to define the virtual hierarchy - * @param options - Options to list blobs operation. - */ - listItemsByHierarchy(delimiter2, options = {}) { - return __asyncGenerator(this, arguments, function* listItemsByHierarchy_1() { - var e_2, _a2; - let marker2; - try { - for (var _b = __asyncValues(this.listHierarchySegments(delimiter2, marker2, options)), _c; _c = yield __await(_b.next()), !_c.done; ) { - const listBlobsHierarchySegmentResponse = _c.value; - const segment = listBlobsHierarchySegmentResponse.segment; - if (segment.blobPrefixes) { - for (const prefix2 of segment.blobPrefixes) { - yield yield __await(Object.assign({ kind: "prefix" }, prefix2)); - } - } - for (const blob of segment.blobItems) { - yield yield __await(Object.assign({ kind: "blob" }, blob)); - } - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (_c && !_c.done && (_a2 = _b.return)) - yield __await(_a2.call(_b)); - } finally { - if (e_2) - throw e_2.error; - } - } - }); - } - /** - * Returns an async iterable iterator to list all the blobs by hierarchy. - * under the specified account. - * - * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages. - * - * Example using `for await` syntax: - * - * ```js - * for await (const item of containerClient.listBlobsByHierarchy("/")) { - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); - * } else { - * console.log(`\tBlobItem: name - ${item.name}`); - * } - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); - * let entity = await iter.next(); - * while (!entity.done) { - * let item = entity.value; - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); - * } else { - * console.log(`\tBlobItem: name - ${item.name}`); - * } - * entity = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * console.log("Listing blobs by hierarchy by page"); - * for await (const response of containerClient.listBlobsByHierarchy("/").byPage()) { - * const segment = response.segment; - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.name}`); - * } - * } - * for (const blob of response.segment.blobItems) { - * console.log(`\tBlobItem: name - ${blob.name}`); - * } - * } - * ``` - * - * Example using paging with a max page size: - * - * ```js - * console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size"); - * - * let i = 1; - * for await (const response of containerClient - * .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" }) - * .byPage({ maxPageSize: 2 })) { - * console.log(`Page ${i++}`); - * const segment = response.segment; - * - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.name}`); - * } - * } - * - * for (const blob of response.segment.blobItems) { - * console.log(`\tBlobItem: name - ${blob.name}`); - * } - * } - * ``` - * - * @param delimiter - The character or string used to define the virtual hierarchy - * @param options - Options to list blobs operation. + * the list of containers to be returned with the next listing operation. The + * operation returns the continuationToken value within the response body if the + * listing operation did not return all containers remaining to be listed + * with the current page. The continuationToken value can be used as the value for + * the marker parameter in a subsequent call to request the next page of list + * items. The marker value is opaque to the client. + * @param options - Options to the Service List Container Segment operation. + * @returns Response data for the Service List Container Segment operation. */ - listBlobsByHierarchy(delimiter2, options = {}) { - if (delimiter2 === "") { - throw new RangeError("delimiter should contain one or more characters"); - } - const include2 = []; - if (options.includeCopy) { - include2.push("copy"); - } - if (options.includeDeleted) { - include2.push("deleted"); - } - if (options.includeMetadata) { - include2.push("metadata"); - } - if (options.includeSnapshots) { - include2.push("snapshots"); - } - if (options.includeVersions) { - include2.push("versions"); - } - if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); - } - if (options.includeTags) { - include2.push("tags"); - } - if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); - } - if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); - } - if (options.includeLegalHold) { - include2.push("legalhold"); - } - if (options.prefix === "") { - options.prefix = void 0; + async listContainersSegment(marker2, options = {}) { + const { span, updatedOptions } = createSpan2("BlobServiceClient-listContainersSegment", options); + try { + return await this.serviceContext.listContainersSegment(Object.assign(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker: marker2 }, options), { include: typeof options.include === "string" ? [options.include] : options.include }), convertTracingToRequestOptionsBase(updatedOptions))); + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItemsByHierarchy(delimiter2, updatedOptions); - return { - /** - * The next method, part of the iteration protocol - */ - async next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings2 = {}) => { - return this.listHierarchySegments(delimiter2, settings2.continuationToken, Object.assign({ maxPageSize: settings2.maxPageSize }, updatedOptions)); - } - }; } - /** - * The Filter Blobs operation enables callers to list blobs in the container whose tags - * match a given search expression. + /** + * The Filter Blobs operation enables callers to list blobs across all containers whose tags + * match a given search expression. Filter blobs searches across all containers within a + * storage account but can be scoped within the expression to a single container. * * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. * The given expression must evaluate to true for a blob to be returned in the results. @@ -54870,9 +70334,9 @@ var init_ContainerClient = __esm({ * @param options - Options to find blobs by tags. */ async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - const { span, updatedOptions } = createSpan2("ContainerClient-findBlobsByTagsSegment", options); + const { span, updatedOptions } = createSpan2("BlobServiceClient-findBlobsByTagsSegment", options); try { - const response = await this.containerContext.filterBlobs(Object.assign({ abortSignal: options.abortSignal, where: tagFilterSqlExpression, marker: marker2, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions))); + const response = await this.serviceContext.filterBlobs(Object.assign({ abortSignal: options.abortSignal, where: tagFilterSqlExpression, marker: marker2, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions))); const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { var _a2; let tagValue = ""; @@ -54893,7 +70357,7 @@ var init_ContainerClient = __esm({ } } /** - * Returns an AsyncIterableIterator for ContainerFindBlobsByTagsSegmentResponse. + * Returns an AsyncIterableIterator for ServiceFindBlobsByTagsSegmentResponse. * * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. * The given expression must evaluate to true for a blob to be returned in the results. @@ -54932,38 +70396,40 @@ var init_ContainerClient = __esm({ */ findBlobsByTagsItems(tagFilterSqlExpression, options = {}) { return __asyncGenerator(this, arguments, function* findBlobsByTagsItems_1() { - var e_3, _a2; + var e_1, _a2; let marker2; try { - for (var _b = __asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _c; _c = yield __await(_b.next()), !_c.done; ) { - const segment = _c.value; + for (var _b2 = __asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _c2; _c2 = yield __await(_b2.next()), !_c2.done; ) { + const segment = _c2.value; yield __await(yield* __asyncDelegator(__asyncValues(segment.blobs))); } - } catch (e_3_1) { - e_3 = { error: e_3_1 }; + } catch (e_1_1) { + e_1 = { error: e_1_1 }; } finally { try { - if (_c && !_c.done && (_a2 = _b.return)) - yield __await(_a2.call(_b)); + if (_c2 && !_c2.done && (_a2 = _b2.return)) + yield __await(_a2.call(_b2)); } finally { - if (e_3) - throw e_3.error; + if (e_1) + throw e_1.error; } } }); } /** * Returns an async iterable iterator to find all blobs with specified tag - * under the specified container. + * under the specified account. * * .byPage() returns an async iterable iterator to list the blobs in pages. * + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * * Example using `for await` syntax: * * ```js * let i = 1; - * for await (const blob of containerClient.findBlobsByTags("tagkey='tagvalue'")) { - * console.log(`Blob ${i++}: ${blob.name}`); + * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) { + * console.log(`Blob ${i++}: ${container.name}`); * } * ``` * @@ -54971,7 +70437,7 @@ var init_ContainerClient = __esm({ * * ```js * let i = 1; - * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'"); + * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); * let blobItem = await iter.next(); * while (!blobItem.done) { * console.log(`Blob ${i++}: ${blobItem.value.name}`); @@ -54984,7 +70450,7 @@ var init_ContainerClient = __esm({ * ```js * // passing optional maxPageSize in the page settings * let i = 1; - * for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { + * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { * if (response.blobs) { * for (const blob of response.blobs) { * console.log(`Blob ${i++}: ${blob.name}`); @@ -54997,7 +70463,7 @@ var init_ContainerClient = __esm({ * * ```js * let i = 1; - * let iterator = containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 }); + * let iterator = blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; * * // Prints 2 blob names @@ -55010,7 +70476,7 @@ var init_ContainerClient = __esm({ * // Gets next marker * let marker = response.continuationToken; * // Passing next marker as continuationToken - * iterator = containerClient + * iterator = blobServiceClient * .findBlobsByTags("tagkey='tagvalue'") * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; @@ -55053,1287 +70519,1514 @@ var init_ContainerClient = __esm({ } }; } - getContainerNameFromUrl() { - let containerName; - try { - const parsedUrl = URLBuilder.parse(this.url); - if (parsedUrl.getHost().split(".")[1] === "blob") { - containerName = parsedUrl.getPath().split("/")[1]; - } else if (isIpEndpointStyle(parsedUrl)) { - containerName = parsedUrl.getPath().split("/")[2]; - } else { - containerName = parsedUrl.getPath().split("/")[1]; - } - containerName = decodeURIComponent(containerName); - if (!containerName) { - throw new Error("Provided containerName is invalid."); - } - return containerName; - } catch (error) { - throw new Error("Unable to extract containerName with provided information."); - } - } /** - * Only available for ContainerClient constructed with a shared key credential. - * - * Generates a Blob Container Service Shared Access Signature (SAS) URI based on the client properties - * and parameters passed in. The SAS is signed by the shared key credential of the client. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * Returns an AsyncIterableIterator for ServiceListContainersSegmentResponses * - * @param options - Optional parameters. - * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. + * @param marker - A string value that identifies the portion of + * the list of containers to be returned with the next listing operation. The + * operation returns the continuationToken value within the response body if the + * listing operation did not return all containers remaining to be listed + * with the current page. The continuationToken value can be used as the value for + * the marker parameter in a subsequent call to request the next page of list + * items. The marker value is opaque to the client. + * @param options - Options to list containers operation. */ - generateSasUrl(options) { - return new Promise((resolve2) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); + listSegments(marker2, options = {}) { + return __asyncGenerator(this, arguments, function* listSegments_1() { + let listContainersSegmentResponse; + if (!!marker2 || marker2 === void 0) { + do { + listContainersSegmentResponse = yield __await(this.listContainersSegment(marker2, options)); + listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; + marker2 = listContainersSegmentResponse.continuationToken; + yield yield __await(yield __await(listContainersSegmentResponse)); + } while (marker2); } - const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString(); - resolve2(appendToURLQuery(this.url, sas)); }); } /** - * Creates a BlobBatchClient object to conduct batch operations. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch - * - * @returns A new BlobBatchClient object for this container. - */ - getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); - } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/AccountSASPermissions.js -var AccountSASPermissions; -var init_AccountSASPermissions = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/AccountSASPermissions.js"() { - AccountSASPermissions = class _AccountSASPermissions { - constructor() { - this.read = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.add = false; - this.create = false; - this.update = false; - this.process = false; - this.tag = false; - this.filter = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - } - /** - * Parse initializes the AccountSASPermissions fields from a string. + * Returns an AsyncIterableIterator for Container Items * - * @param permissions - + * @param options - Options to list containers operation. */ - static parse(permissions) { - const accountSASPermissions = new _AccountSASPermissions(); - for (const c2 of permissions) { - switch (c2) { - case "r": - accountSASPermissions.read = true; - break; - case "w": - accountSASPermissions.write = true; - break; - case "d": - accountSASPermissions.delete = true; - break; - case "x": - accountSASPermissions.deleteVersion = true; - break; - case "l": - accountSASPermissions.list = true; - break; - case "a": - accountSASPermissions.add = true; - break; - case "c": - accountSASPermissions.create = true; - break; - case "u": - accountSASPermissions.update = true; - break; - case "p": - accountSASPermissions.process = true; - break; - case "t": - accountSASPermissions.tag = true; - break; - case "f": - accountSASPermissions.filter = true; - break; - case "i": - accountSASPermissions.setImmutabilityPolicy = true; - break; - case "y": - accountSASPermissions.permanentDelete = true; - break; - default: - throw new RangeError(`Invalid permission character: ${c2}`); + listItems(options = {}) { + return __asyncGenerator(this, arguments, function* listItems_1() { + var e_2, _a2; + let marker2; + try { + for (var _b2 = __asyncValues(this.listSegments(marker2, options)), _c2; _c2 = yield __await(_b2.next()), !_c2.done; ) { + const segment = _c2.value; + yield __await(yield* __asyncDelegator(__asyncValues(segment.containerItems))); + } + } catch (e_2_1) { + e_2 = { error: e_2_1 }; + } finally { + try { + if (_c2 && !_c2.done && (_a2 = _b2.return)) + yield __await(_a2.call(_b2)); + } finally { + if (e_2) + throw e_2.error; + } } - } - return accountSASPermissions; + }); } /** - * Creates a {@link AccountSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * Returns an async iterable iterator to list all the containers + * under the specified account. * - * @param permissionLike - - */ - static from(permissionLike) { - const accountSASPermissions = new _AccountSASPermissions(); - if (permissionLike.read) { - accountSASPermissions.read = true; - } - if (permissionLike.write) { - accountSASPermissions.write = true; - } - if (permissionLike.delete) { - accountSASPermissions.delete = true; - } - if (permissionLike.deleteVersion) { - accountSASPermissions.deleteVersion = true; - } - if (permissionLike.filter) { - accountSASPermissions.filter = true; - } - if (permissionLike.tag) { - accountSASPermissions.tag = true; - } - if (permissionLike.list) { - accountSASPermissions.list = true; - } - if (permissionLike.add) { - accountSASPermissions.add = true; - } - if (permissionLike.create) { - accountSASPermissions.create = true; - } - if (permissionLike.update) { - accountSASPermissions.update = true; - } - if (permissionLike.process) { - accountSASPermissions.process = true; - } - if (permissionLike.setImmutabilityPolicy) { - accountSASPermissions.setImmutabilityPolicy = true; - } - if (permissionLike.permanentDelete) { - accountSASPermissions.permanentDelete = true; - } - return accountSASPermissions; - } - /** - * Produces the SAS permissions string for an Azure Storage account. - * Call this method to set AccountSASSignatureValues Permissions field. + * .byPage() returns an async iterable iterator to list the containers in pages. * - * Using this method will guarantee the resource types are in - * an order accepted by the service. + * Example using `for await` syntax: * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * ```js + * let i = 1; + * for await (const container of blobServiceClient.listContainers()) { + * console.log(`Container ${i++}: ${container.name}`); + * } + * ``` + * + * Example using `iter.next()`: + * + * ```js + * let i = 1; + * const iter = blobServiceClient.listContainers(); + * let containerItem = await iter.next(); + * while (!containerItem.done) { + * console.log(`Container ${i++}: ${containerItem.value.name}`); + * containerItem = await iter.next(); + * } + * ``` + * + * Example using `byPage()`: + * + * ```js + * // passing optional maxPageSize in the page settings + * let i = 1; + * for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { + * if (response.containerItems) { + * for (const container of response.containerItems) { + * console.log(`Container ${i++}: ${container.name}`); + * } + * } + * } + * ``` + * + * Example using paging with a marker: + * + * ```js + * let i = 1; + * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 }); + * let response = (await iterator.next()).value; + * + * // Prints 2 container names + * if (response.containerItems) { + * for (const container of response.containerItems) { + * console.log(`Container ${i++}: ${container.name}`); + * } + * } + * + * // Gets next marker + * let marker = response.continuationToken; + * // Passing next marker as continuationToken + * iterator = blobServiceClient + * .listContainers() + * .byPage({ continuationToken: marker, maxPageSize: 10 }); + * response = (await iterator.next()).value; + * + * // Prints 10 container names + * if (response.containerItems) { + * for (const container of response.containerItems) { + * console.log(`Container ${i++}: ${container.name}`); + * } + * } + * ``` * + * @param options - Options to list containers. + * @returns An asyncIterableIterator that supports paging. */ - toString() { - const permissions = []; - if (this.read) { - permissions.push("r"); - } - if (this.write) { - permissions.push("w"); - } - if (this.delete) { - permissions.push("d"); - } - if (this.deleteVersion) { - permissions.push("x"); - } - if (this.filter) { - permissions.push("f"); - } - if (this.tag) { - permissions.push("t"); - } - if (this.list) { - permissions.push("l"); - } - if (this.add) { - permissions.push("a"); - } - if (this.create) { - permissions.push("c"); - } - if (this.update) { - permissions.push("u"); + listContainers(options = {}) { + if (options.prefix === "") { + options.prefix = void 0; } - if (this.process) { - permissions.push("p"); + const include2 = []; + if (options.includeDeleted) { + include2.push("deleted"); } - if (this.setImmutabilityPolicy) { - permissions.push("i"); + if (options.includeMetadata) { + include2.push("metadata"); } - if (this.permanentDelete) { - permissions.push("y"); + if (options.includeSystem) { + include2.push("system"); } - return permissions.join(""); - } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/AccountSASResourceTypes.js -var AccountSASResourceTypes; -var init_AccountSASResourceTypes = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/AccountSASResourceTypes.js"() { - AccountSASResourceTypes = class _AccountSASResourceTypes { - constructor() { - this.service = false; - this.container = false; - this.object = false; - } - /** - * Creates an {@link AccountSASResourceTypes} from the specified resource types string. This method will throw an - * Error if it encounters a character that does not correspond to a valid resource type. - * - * @param resourceTypes - - */ - static parse(resourceTypes) { - const accountSASResourceTypes = new _AccountSASResourceTypes(); - for (const c2 of resourceTypes) { - switch (c2) { - case "s": - accountSASResourceTypes.service = true; - break; - case "c": - accountSASResourceTypes.container = true; - break; - case "o": - accountSASResourceTypes.object = true; - break; - default: - throw new RangeError(`Invalid resource type: ${c2}`); + const listSegmentOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const iter = this.listItems(listSegmentOptions); + return { + /** + * The next method, part of the iteration protocol + */ + next() { + return iter.next(); + }, + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator]() { + return this; + }, + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings2 = {}) => { + return this.listSegments(settings2.continuationToken, Object.assign({ maxPageSize: settings2.maxPageSize }, listSegmentOptions)); } - } - return accountSASResourceTypes; + }; } /** - * Converts the given resource types to a string. + * ONLY AVAILABLE WHEN USING BEARER TOKEN AUTHENTICATION (TokenCredential). * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * Retrieves a user delegation key for the Blob service. This is only a valid operation when using + * bearer token authentication. + * + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-user-delegation-key * + * @param startsOn - The start time for the user delegation SAS. Must be within 7 days of the current time + * @param expiresOn - The end time for the user delegation SAS. Must be within 7 days of the current time */ - toString() { - const resourceTypes = []; - if (this.service) { - resourceTypes.push("s"); - } - if (this.container) { - resourceTypes.push("c"); - } - if (this.object) { - resourceTypes.push("o"); + async getUserDelegationKey(startsOn, expiresOn2, options = {}) { + const { span, updatedOptions } = createSpan2("BlobServiceClient-getUserDelegationKey", options); + try { + const response = await this.serviceContext.getUserDelegationKey({ + startsOn: truncatedISO8061Date(startsOn, false), + expiresOn: truncatedISO8061Date(expiresOn2, false) + }, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); + const userDelegationKey = { + signedObjectId: response.signedObjectId, + signedTenantId: response.signedTenantId, + signedStartsOn: new Date(response.signedStartsOn), + signedExpiresOn: new Date(response.signedExpiresOn), + signedService: response.signedService, + signedVersion: response.signedVersion, + value: response.value + }; + const res = Object.assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey); + return res; + } catch (e2) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e2.message + }); + throw e2; + } finally { + span.end(); } - return resourceTypes.join(""); - } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/AccountSASServices.js -var AccountSASServices; -var init_AccountSASServices = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/AccountSASServices.js"() { - AccountSASServices = class _AccountSASServices { - constructor() { - this.blob = false; - this.file = false; - this.queue = false; - this.table = false; } /** - * Creates an {@link AccountSASServices} from the specified services string. This method will throw an - * Error if it encounters a character that does not correspond to a valid service. + * Creates a BlobBatchClient object to conduct batch operations. * - * @param services - + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * + * @returns A new BlobBatchClient object for this service. */ - static parse(services) { - const accountSASServices = new _AccountSASServices(); - for (const c2 of services) { - switch (c2) { - case "b": - accountSASServices.blob = true; - break; - case "f": - accountSASServices.file = true; - break; - case "q": - accountSASServices.queue = true; - break; - case "t": - accountSASServices.table = true; - break; - default: - throw new RangeError(`Invalid service character: ${c2}`); - } - } - return accountSASServices; + getBlobBatchClient() { + return new BlobBatchClient(this.url, this.pipeline); } /** - * Converts the given services to a string. + * Only available for BlobServiceClient constructed with a shared key credential. + * + * Generates a Blob account Shared Access Signature (SAS) URI based on the client properties + * and parameters passed in. The SAS is signed by the shared key credential of the client. + * + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas * + * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided. + * @param permissions - Specifies the list of permissions to be associated with the SAS. + * @param resourceTypes - Specifies the resource types associated with the shared access signature. + * @param options - Optional parameters. + * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. */ - toString() { - const services = []; - if (this.blob) { - services.push("b"); - } - if (this.table) { - services.push("t"); - } - if (this.queue) { - services.push("q"); + generateAccountSasUrl(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { + if (!(this.credential instanceof StorageSharedKeyCredential)) { + throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential"); } - if (this.file) { - services.push("f"); + if (expiresOn2 === void 0) { + const now = /* @__PURE__ */ new Date(); + expiresOn2 = new Date(now.getTime() + 3600 * 1e3); } - return services.join(""); + const sas = generateAccountSASQueryParameters(Object.assign({ + permissions, + expiresOn: expiresOn2, + resourceTypes, + services: AccountSASServices.parse("b").toString() + }, options), this.credential).toString(); + return appendToURLQuery(this.url, sas); } }; } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js -function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyCredential) { - const version4 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version4 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.deleteVersion && version4 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.permanentDelete && version4 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when provided 'y' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.tag && version4 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.filter && version4 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission."); - } - if (accountSASSignatureValues.encryptionScope && version4 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BatchResponse.js +var init_BatchResponse = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BatchResponse.js"() { } - const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); - const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); - const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); - let stringToSign; - if (version4 >= "2020-12-06") { - stringToSign = [ - sharedKeyCredential.accountName, - parsedPermissions, - parsedServices, - parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", - accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", - version4, - accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", - "" - // Account SAS requires an additional newline character - ].join("\n"); - } else { - stringToSign = [ - sharedKeyCredential.accountName, - parsedPermissions, - parsedServices, - parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", - accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", - version4, - "" - // Account SAS requires an additional newline character - ].join("\n"); +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generatedModels.js +var KnownEncryptionAlgorithmType; +var init_generatedModels = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generatedModels.js"() { + (function(KnownEncryptionAlgorithmType2) { + KnownEncryptionAlgorithmType2["AES256"] = "AES256"; + })(KnownEncryptionAlgorithmType || (KnownEncryptionAlgorithmType = {})); } - const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); - return new SASQueryParameters(version4, signature, parsedPermissions.toString(), parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, accountSASSignatureValues.encryptionScope); -} -var init_AccountSASSignatureValues = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js"() { +}); + +// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/index.js +var src_exports2 = {}; +__export(src_exports2, { + AccountSASPermissions: () => AccountSASPermissions, + AccountSASResourceTypes: () => AccountSASResourceTypes, + AccountSASServices: () => AccountSASServices, + AnonymousCredential: () => AnonymousCredential, + AnonymousCredentialPolicy: () => AnonymousCredentialPolicy, + AppendBlobClient: () => AppendBlobClient, + BaseRequestPolicy: () => BaseRequestPolicy, + BlobBatch: () => BlobBatch, + BlobBatchClient: () => BlobBatchClient, + BlobClient: () => BlobClient, + BlobLeaseClient: () => BlobLeaseClient, + BlobSASPermissions: () => BlobSASPermissions, + BlobServiceClient: () => BlobServiceClient, + BlockBlobClient: () => BlockBlobClient, + BlockBlobTier: () => BlockBlobTier, + ContainerClient: () => ContainerClient, + ContainerSASPermissions: () => ContainerSASPermissions, + Credential: () => Credential, + CredentialPolicy: () => CredentialPolicy, + HttpHeaders: () => HttpHeaders, + KnownEncryptionAlgorithmType: () => KnownEncryptionAlgorithmType, + PageBlobClient: () => PageBlobClient, + Pipeline: () => Pipeline, + PremiumPageBlobTier: () => PremiumPageBlobTier, + RequestPolicyOptions: () => RequestPolicyOptions, + RestError: () => RestError, + SASProtocol: () => SASProtocol, + SASQueryParameters: () => SASQueryParameters, + StorageBlobAudience: () => StorageBlobAudience, + StorageBrowserPolicy: () => StorageBrowserPolicy, + StorageBrowserPolicyFactory: () => StorageBrowserPolicyFactory, + StorageOAuthScopes: () => StorageOAuthScopes, + StorageRetryPolicy: () => StorageRetryPolicy, + StorageRetryPolicyFactory: () => StorageRetryPolicyFactory, + StorageRetryPolicyType: () => StorageRetryPolicyType, + StorageSharedKeyCredential: () => StorageSharedKeyCredential, + StorageSharedKeyCredentialPolicy: () => StorageSharedKeyCredentialPolicy, + WebResource: () => WebResource, + deserializationPolicy: () => deserializationPolicy, + generateAccountSASQueryParameters: () => generateAccountSASQueryParameters, + generateBlobSASQueryParameters: () => generateBlobSASQueryParameters, + isPipelineLike: () => isPipelineLike, + logger: () => logger2, + newPipeline: () => newPipeline +}); +var init_src11 = __esm({ + "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/index.js"() { + init_src5(); + init_BlobServiceClient(); + init_Clients(); + init_ContainerClient(); + init_BlobLeaseClient(); init_AccountSASPermissions(); init_AccountSASResourceTypes(); init_AccountSASServices(); - init_SasIPRange(); + init_AccountSASSignatureValues(); + init_BlobBatch(); + init_BlobBatchClient(); + init_BatchResponse(); + init_BlobSASPermissions(); + init_BlobSASSignatureValues(); + init_StorageBrowserPolicyFactory(); + init_ContainerSASPermissions(); + init_AnonymousCredential(); + init_Credential(); + init_StorageSharedKeyCredential(); + init_models3(); + init_Pipeline(); + init_AnonymousCredentialPolicy(); + init_CredentialPolicy(); + init_StorageRetryPolicyFactory(); + init_StorageSharedKeyCredentialPolicy(); init_SASQueryParameters(); - init_constants2(); - init_utils_common(); + init_generatedModels(); + init_log3(); } }); -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobServiceClient.js -var BlobServiceClient; -var init_BlobServiceClient = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BlobServiceClient.js"() { - init_tslib_es6(); - init_src5(); - init_src4(); - init_operations(); - init_Pipeline(); - init_ContainerClient(); - init_utils_common(); - init_StorageSharedKeyCredential(); - init_AnonymousCredential(); - init_src7(); - init_utils_common(); - init_tracing(); - init_BlobBatchClient(); - init_StorageClient(); - init_AccountSASPermissions(); - init_AccountSASSignatureValues(); - init_AccountSASServices(); - BlobServiceClient = class _BlobServiceClient extends StorageClient { - constructor(url2, credentialOrPipeline, options) { - let pipeline; - if (isPipelineLike(credentialOrPipeline)) { - pipeline = credentialOrPipeline; - } else if (isNode && credentialOrPipeline instanceof StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential || isTokenCredential(credentialOrPipeline)) { - pipeline = newPipeline(credentialOrPipeline, options); - } else { - pipeline = newPipeline(new AnonymousCredential(), options); +// node_modules/@actions/cache/lib/internal/requestUtils.js +var require_requestUtils = __commonJS({ + "node_modules/@actions/cache/lib/internal/requestUtils.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + var desc = Object.getOwnPropertyDescriptor(m3, k2); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m3[k2]; + } }; + } + Object.defineProperty(o2, k22, desc); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve2) { + resolve2(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e2) { + reject(e2); + } } - super(url2, pipeline); - this.serviceContext = new Service(this.storageClientContext); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.retryHttpClientResponse = exports.retryTypedResponse = exports.retry = exports.isRetryableStatusCode = exports.isServerErrorStatusCode = exports.isSuccessStatusCode = void 0; + var core2 = __importStar(require_core()); + var http_client_1 = require_lib(); + var constants_1 = require_constants6(); + function isSuccessStatusCode(statusCode) { + if (!statusCode) { + return false; } - /** - * - * Creates an instance of BlobServiceClient from connection string. - * - * @param connectionString - Account connection string or a SAS connection string of an Azure storage account. - * [ Note - Account connection string can only be used in NODE.JS runtime. ] - * Account connection string example - - * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net` - * SAS connection string example - - * `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString` - * @param options - Optional. Options to configure the HTTP pipeline. - */ - static fromConnectionString(connectionString, options) { - options = options || {}; - const extractedCreds = extractConnectionStringParts(connectionString); - if (extractedCreds.kind === "AccountConnString") { - if (isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - if (!options.proxyOptions) { - options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + return statusCode >= 200 && statusCode < 300; + } + exports.isSuccessStatusCode = isSuccessStatusCode; + function isServerErrorStatusCode(statusCode) { + if (!statusCode) { + return true; + } + return statusCode >= 500; + } + exports.isServerErrorStatusCode = isServerErrorStatusCode; + function isRetryableStatusCode(statusCode) { + if (!statusCode) { + return false; + } + const retryableStatusCodes = [ + http_client_1.HttpCodes.BadGateway, + http_client_1.HttpCodes.ServiceUnavailable, + http_client_1.HttpCodes.GatewayTimeout + ]; + return retryableStatusCodes.includes(statusCode); + } + exports.isRetryableStatusCode = isRetryableStatusCode; + function sleep(milliseconds) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve2) => setTimeout(resolve2, milliseconds)); + }); + } + function retry3(name2, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay3 = constants_1.DefaultRetryDelay, onError = void 0) { + return __awaiter(this, void 0, void 0, function* () { + let errorMessage = ""; + let attempt = 1; + while (attempt <= maxAttempts) { + let response = void 0; + let statusCode = void 0; + let isRetryable = false; + try { + response = yield method(); + } catch (error) { + if (onError) { + response = onError(error); } - const pipeline = newPipeline(sharedKeyCredential, options); - return new _BlobServiceClient(extractedCreds.url, pipeline); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); + isRetryable = true; + errorMessage = error.message; } - } else if (extractedCreds.kind === "SASConnString") { - const pipeline = newPipeline(new AnonymousCredential(), options); - return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); + if (response) { + statusCode = getStatusCode(response); + if (!isServerErrorStatusCode(statusCode)) { + return response; + } + } + if (statusCode) { + isRetryable = isRetryableStatusCode(statusCode); + errorMessage = `Cache service responded with ${statusCode}`; + } + core2.debug(`${name2} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + if (!isRetryable) { + core2.debug(`${name2} - Error is not retryable`); + break; + } + yield sleep(delay3); + attempt++; + } + throw Error(`${name2} failed: ${errorMessage}`); + }); + } + exports.retry = retry3; + function retryTypedResponse(name2, method, maxAttempts = constants_1.DefaultRetryAttempts, delay3 = constants_1.DefaultRetryDelay) { + return __awaiter(this, void 0, void 0, function* () { + return yield retry3( + name2, + method, + (response) => response.statusCode, + maxAttempts, + delay3, + // If the error object contains the statusCode property, extract it and return + // an TypedResponse so it can be processed by the retry logic. + (error) => { + if (error instanceof http_client_1.HttpClientError) { + return { + statusCode: error.statusCode, + result: null, + headers: {}, + error + }; + } else { + return void 0; + } + } + ); + }); + } + exports.retryTypedResponse = retryTypedResponse; + function retryHttpClientResponse(name2, method, maxAttempts = constants_1.DefaultRetryAttempts, delay3 = constants_1.DefaultRetryDelay) { + return __awaiter(this, void 0, void 0, function* () { + return yield retry3(name2, method, (response) => response.message.statusCode, maxAttempts, delay3); + }); + } + exports.retryHttpClientResponse = retryHttpClientResponse; + } +}); + +// node_modules/@actions/cache/lib/internal/downloadUtils.js +var require_downloadUtils = __commonJS({ + "node_modules/@actions/cache/lib/internal/downloadUtils.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + var desc = Object.getOwnPropertyDescriptor(m3, k2); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m3[k2]; + } }; + } + Object.defineProperty(o2, k22, desc); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve2) { + resolve2(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.downloadCacheStorageSDK = exports.downloadCacheHttpClientConcurrent = exports.downloadCacheHttpClient = exports.DownloadProgress = void 0; + var core2 = __importStar(require_core()); + var http_client_1 = require_lib(); + var storage_blob_1 = (init_src11(), __toCommonJS(src_exports2)); + var buffer = __importStar(__require("buffer")); + var fs3 = __importStar(__require("fs")); + var stream = __importStar(__require("stream")); + var util3 = __importStar(__require("util")); + var utils = __importStar(require_cacheUtils()); + var constants_1 = require_constants6(); + var requestUtils_1 = require_requestUtils(); + var abort_controller_1 = (init_abort_controller(), __toCommonJS(abort_controller_exports)); + function pipeResponseToStream(response, output) { + return __awaiter(this, void 0, void 0, function* () { + const pipeline = util3.promisify(stream.pipeline); + yield pipeline(response.message, output); + }); + } + var DownloadProgress = class { + constructor(contentLength2) { + this.contentLength = contentLength2; + this.segmentIndex = 0; + this.segmentSize = 0; + this.segmentOffset = 0; + this.receivedBytes = 0; + this.displayedComplete = false; + this.startTime = Date.now(); + } + /** + * Progress to the next segment. Only call this method when the previous segment + * is complete. + * + * @param segmentSize the length of the next segment + */ + nextSegment(segmentSize) { + this.segmentOffset = this.segmentOffset + this.segmentSize; + this.segmentIndex = this.segmentIndex + 1; + this.segmentSize = segmentSize; + this.receivedBytes = 0; + core2.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); } /** - * Creates a {@link ContainerClient} object - * - * @param containerName - A container name - * @returns A new ContainerClient object for the given container name. - * - * Example usage: + * Sets the number of bytes received for the current segment. * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); - * ``` + * @param receivedBytes the number of bytes received */ - getContainerClient(containerName) { - return new ContainerClient(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); + setReceivedBytes(receivedBytes) { + this.receivedBytes = receivedBytes; } /** - * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container - * - * @param containerName - Name of the container to create. - * @param options - Options to configure Container Create operation. - * @returns Container creation response and the corresponding container client. + * Returns the total number of bytes transferred. */ - async createContainer(containerName, options = {}) { - const { span, updatedOptions } = createSpan2("BlobServiceClient-createContainer", options); - try { - const containerClient = this.getContainerClient(containerName); - const containerCreateResponse = await containerClient.create(updatedOptions); - return { - containerClient, - containerCreateResponse - }; - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } + getTransferredBytes() { + return this.segmentOffset + this.receivedBytes; } /** - * Deletes a Blob container. - * - * @param containerName - Name of the container to delete. - * @param options - Options to configure Container Delete operation. - * @returns Container deletion response. + * Returns true if the download is complete. */ - async deleteContainer(containerName, options = {}) { - const { span, updatedOptions } = createSpan2("BlobServiceClient-deleteContainer", options); - try { - const containerClient = this.getContainerClient(containerName); - return await containerClient.delete(updatedOptions); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } + isDone() { + return this.getTransferredBytes() === this.contentLength; } /** - * Restore a previously deleted Blob container. - * This API is only functional if Container Soft Delete is enabled for the storage account associated with the container. - * - * @param deletedContainerName - Name of the previously deleted container. - * @param deletedContainerVersion - Version of the previously deleted container, used to uniquely identify the deleted container. - * @param options - Options to configure Container Restore operation. - * @returns Container deletion response. + * Prints the current download stats. Once the download completes, this will print one + * last line and then stop. */ - async undeleteContainer(deletedContainerName2, deletedContainerVersion2, options = {}) { - const { span, updatedOptions } = createSpan2("BlobServiceClient-undeleteContainer", options); - try { - const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName2); - const containerContext = new Container(containerClient["storageClientContext"]); - const containerUndeleteResponse = await containerContext.restore(Object.assign({ - deletedContainerName: deletedContainerName2, - deletedContainerVersion: deletedContainerVersion2 - }, updatedOptions)); - return { containerClient, containerUndeleteResponse }; - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + display() { + if (this.displayedComplete) { + return; + } + const transferredBytes = this.segmentOffset + this.receivedBytes; + const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); + const elapsedTime = Date.now() - this.startTime; + const downloadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); + core2.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); + if (this.isDone()) { + this.displayedComplete = true; } } /** - * Rename an existing Blob Container. - * - * @param sourceContainerName - The name of the source container. - * @param destinationContainerName - The new name of the container. - * @param options - Options to configure Container Rename operation. + * Returns a function used to handle TransferProgressEvents. */ - /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */ - // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready. - async renameContainer(sourceContainerName2, destinationContainerName, options = {}) { - var _a2; - const { span, updatedOptions } = createSpan2("BlobServiceClient-renameContainer", options); - try { - const containerClient = this.getContainerClient(destinationContainerName); - const containerContext = new Container(containerClient["storageClientContext"]); - const containerRenameResponse = await containerContext.rename(sourceContainerName2, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a2 = options.sourceCondition) === null || _a2 === void 0 ? void 0 : _a2.leaseId })); - return { containerClient, containerRenameResponse }; - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } + onProgress() { + return (progress) => { + this.setReceivedBytes(progress.loadedBytes); + }; } /** - * Gets the properties of a storage account’s Blob service, including properties - * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * Starts the timer that displays the stats. * - * @param options - Options to the Service Get Properties operation. - * @returns Response data for the Service Get Properties operation. + * @param delayInMs the delay between each write */ - async getProperties(options = {}) { - const { span, updatedOptions } = createSpan2("BlobServiceClient-getProperties", options); - try { - return await this.serviceContext.getProperties(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); - } + startDisplayTimer(delayInMs = 1e3) { + const displayCallback = () => { + this.display(); + if (!this.isDone()) { + this.timeoutHandle = setTimeout(displayCallback, delayInMs); + } + }; + this.timeoutHandle = setTimeout(displayCallback, delayInMs); } /** - * Sets properties for a storage account’s Blob service endpoint, including properties - * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties - * - * @param properties - - * @param options - Options to the Service Set Properties operation. - * @returns Response data for the Service Set Properties operation. + * Stops the timer that displays the stats. As this typically indicates the download + * is complete, this will display one last line, unless the last line has already + * been written. */ - async setProperties(properties, options = {}) { - const { span, updatedOptions } = createSpan2("BlobServiceClient-setProperties", options); + stopDisplayTimer() { + if (this.timeoutHandle) { + clearTimeout(this.timeoutHandle); + this.timeoutHandle = void 0; + } + this.display(); + } + }; + exports.DownloadProgress = DownloadProgress; + function downloadCacheHttpClient(archiveLocation, archivePath) { + return __awaiter(this, void 0, void 0, function* () { + const writeStream = fs3.createWriteStream(archivePath); + const httpClient = new http_client_1.HttpClient("actions/cache"); + const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter(this, void 0, void 0, function* () { + return httpClient.get(archiveLocation); + })); + downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { + downloadResponse.message.destroy(); + core2.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); + }); + yield pipeResponseToStream(downloadResponse, writeStream); + const contentLengthHeader = downloadResponse.message.headers["content-length"]; + if (contentLengthHeader) { + const expectedLength = parseInt(contentLengthHeader); + const actualLength = utils.getArchiveFileSizeInBytes(archivePath); + if (actualLength !== expectedLength) { + throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`); + } + } else { + core2.debug("Unable to validate download, no Content-Length header"); + } + }); + } + exports.downloadCacheHttpClient = downloadCacheHttpClient; + function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { + var _a2; + return __awaiter(this, void 0, void 0, function* () { + const archiveDescriptor = yield fs3.promises.open(archivePath, "w"); + const httpClient = new http_client_1.HttpClient("actions/cache", void 0, { + socketTimeout: options.timeoutInMs, + keepAlive: true + }); try { - return await this.serviceContext.setProperties(properties, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message + const res = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCacheMetadata", () => __awaiter(this, void 0, void 0, function* () { + return yield httpClient.request("HEAD", archiveLocation, null, {}); + })); + const lengthHeader = res.message.headers["content-length"]; + if (lengthHeader === void 0 || lengthHeader === null) { + throw new Error("Content-Length not found on blob response"); + } + const length = parseInt(lengthHeader); + if (Number.isNaN(length)) { + throw new Error(`Could not interpret Content-Length: ${length}`); + } + const downloads = []; + const blockSize = 4 * 1024 * 1024; + for (let offset = 0; offset < length; offset += blockSize) { + const count = Math.min(blockSize, length - offset); + downloads.push({ + offset, + promiseGetter: () => __awaiter(this, void 0, void 0, function* () { + return yield downloadSegmentRetry(httpClient, archiveLocation, offset, count); + }) + }); + } + downloads.reverse(); + let actives = 0; + let bytesDownloaded = 0; + const progress = new DownloadProgress(length); + progress.startDisplayTimer(); + const progressFn = progress.onProgress(); + const activeDownloads = []; + let nextDownload; + const waitAndWrite = () => __awaiter(this, void 0, void 0, function* () { + const segment = yield Promise.race(Object.values(activeDownloads)); + yield archiveDescriptor.write(segment.buffer, 0, segment.count, segment.offset); + actives--; + delete activeDownloads[segment.offset]; + bytesDownloaded += segment.count; + progressFn({ loadedBytes: bytesDownloaded }); }); - throw e2; + while (nextDownload = downloads.pop()) { + activeDownloads[nextDownload.offset] = nextDownload.promiseGetter(); + actives++; + if (actives >= ((_a2 = options.downloadConcurrency) !== null && _a2 !== void 0 ? _a2 : 10)) { + yield waitAndWrite(); + } + } + while (actives > 0) { + yield waitAndWrite(); + } } finally { - span.end(); + httpClient.dispose(); + yield archiveDescriptor.close(); + } + }); + } + exports.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; + function downloadSegmentRetry(httpClient, archiveLocation, offset, count) { + return __awaiter(this, void 0, void 0, function* () { + const retries = 5; + let failures = 0; + while (true) { + try { + const timeout = 3e4; + const result = yield promiseWithTimeout(timeout, downloadSegment(httpClient, archiveLocation, offset, count)); + if (typeof result === "string") { + throw new Error("downloadSegmentRetry failed due to timeout"); + } + return result; + } catch (err) { + if (failures >= retries) { + throw err; + } + failures++; + } + } + }); + } + function downloadSegment(httpClient, archiveLocation, offset, count) { + return __awaiter(this, void 0, void 0, function* () { + const partRes = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCachePart", () => __awaiter(this, void 0, void 0, function* () { + return yield httpClient.get(archiveLocation, { + Range: `bytes=${offset}-${offset + count - 1}` + }); + })); + if (!partRes.readBodyBuffer) { + throw new Error("Expected HttpClientResponse to implement readBodyBuffer"); + } + return { + offset, + count, + buffer: yield partRes.readBodyBuffer() + }; + }); + } + function downloadCacheStorageSDK(archiveLocation, archivePath, options) { + var _a2; + return __awaiter(this, void 0, void 0, function* () { + const client = new storage_blob_1.BlockBlobClient(archiveLocation, void 0, { + retryOptions: { + // Override the timeout used when downloading each 4 MB chunk + // The default is 2 min / MB, which is way too slow + tryTimeoutInMs: options.timeoutInMs + } + }); + const properties = yield client.getProperties(); + const contentLength2 = (_a2 = properties.contentLength) !== null && _a2 !== void 0 ? _a2 : -1; + if (contentLength2 < 0) { + core2.debug("Unable to determine content length, downloading file with http-client..."); + yield downloadCacheHttpClient(archiveLocation, archivePath); + } else { + const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); + const downloadProgress = new DownloadProgress(contentLength2); + const fd = fs3.openSync(archivePath, "w"); + try { + downloadProgress.startDisplayTimer(); + const controller = new abort_controller_1.AbortController(); + const abortSignal = controller.signal; + while (!downloadProgress.isDone()) { + const segmentStart = downloadProgress.segmentOffset + downloadProgress.segmentSize; + const segmentSize = Math.min(maxSegmentSize, contentLength2 - segmentStart); + downloadProgress.nextSegment(segmentSize); + const result = yield promiseWithTimeout(options.segmentTimeoutInMs || 36e5, client.downloadToBuffer(segmentStart, segmentSize, { + abortSignal, + concurrency: options.downloadConcurrency, + onProgress: downloadProgress.onProgress() + })); + if (result === "timeout") { + controller.abort(); + throw new Error("Aborting cache download as the download time exceeded the timeout."); + } else if (Buffer.isBuffer(result)) { + fs3.writeFileSync(fd, result); + } + } + } finally { + downloadProgress.stopDisplayTimer(); + fs3.closeSync(fd); + } + } + }); + } + exports.downloadCacheStorageSDK = downloadCacheStorageSDK; + var promiseWithTimeout = (timeoutMs, promise) => __awaiter(void 0, void 0, void 0, function* () { + let timeoutHandle; + const timeoutPromise = new Promise((resolve2) => { + timeoutHandle = setTimeout(() => resolve2("timeout"), timeoutMs); + }); + return Promise.race([promise, timeoutPromise]).then((result) => { + clearTimeout(timeoutHandle); + return result; + }); + }); + } +}); + +// node_modules/@actions/cache/lib/options.js +var require_options = __commonJS({ + "node_modules/@actions/cache/lib/options.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + var desc = Object.getOwnPropertyDescriptor(m3, k2); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m3[k2]; + } }; + } + Object.defineProperty(o2, k22, desc); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getDownloadOptions = exports.getUploadOptions = void 0; + var core2 = __importStar(require_core()); + function getUploadOptions(copy) { + const result = { + uploadConcurrency: 4, + uploadChunkSize: 32 * 1024 * 1024 + }; + if (copy) { + if (typeof copy.uploadConcurrency === "number") { + result.uploadConcurrency = copy.uploadConcurrency; + } + if (typeof copy.uploadChunkSize === "number") { + result.uploadChunkSize = copy.uploadChunkSize; + } + } + core2.debug(`Upload concurrency: ${result.uploadConcurrency}`); + core2.debug(`Upload chunk size: ${result.uploadChunkSize}`); + return result; + } + exports.getUploadOptions = getUploadOptions; + function getDownloadOptions(copy) { + const result = { + useAzureSdk: false, + concurrentBlobDownloads: true, + downloadConcurrency: 8, + timeoutInMs: 3e4, + segmentTimeoutInMs: 6e5, + lookupOnly: false + }; + if (copy) { + if (typeof copy.useAzureSdk === "boolean") { + result.useAzureSdk = copy.useAzureSdk; + } + if (typeof copy.concurrentBlobDownloads === "boolean") { + result.concurrentBlobDownloads = copy.concurrentBlobDownloads; + } + if (typeof copy.downloadConcurrency === "number") { + result.downloadConcurrency = copy.downloadConcurrency; } + if (typeof copy.timeoutInMs === "number") { + result.timeoutInMs = copy.timeoutInMs; + } + if (typeof copy.segmentTimeoutInMs === "number") { + result.segmentTimeoutInMs = copy.segmentTimeoutInMs; + } + if (typeof copy.lookupOnly === "boolean") { + result.lookupOnly = copy.lookupOnly; + } + } + const segmentDownloadTimeoutMins = process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]; + if (segmentDownloadTimeoutMins && !isNaN(Number(segmentDownloadTimeoutMins)) && isFinite(Number(segmentDownloadTimeoutMins))) { + result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1e3; + } + core2.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core2.debug(`Download concurrency: ${result.downloadConcurrency}`); + core2.debug(`Request timeout (ms): ${result.timeoutInMs}`); + core2.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); + core2.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); + core2.debug(`Lookup only: ${result.lookupOnly}`); + return result; + } + exports.getDownloadOptions = getDownloadOptions; + } +}); + +// node_modules/@actions/cache/lib/internal/cacheHttpClient.js +var require_cacheHttpClient = __commonJS({ + "node_modules/@actions/cache/lib/internal/cacheHttpClient.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + var desc = Object.getOwnPropertyDescriptor(m3, k2); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m3[k2]; + } }; + } + Object.defineProperty(o2, k22, desc); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve2) { + resolve2(value); + }); } - /** - * Retrieves statistics related to replication for the Blob service. It is only - * available on the secondary location endpoint when read-access geo-redundant - * replication is enabled for the storage account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-stats - * - * @param options - Options to the Service Get Statistics operation. - * @returns Response data for the Service Get Statistics operation. - */ - async getStatistics(options = {}) { - const { span, updatedOptions } = createSpan2("BlobServiceClient-getStatistics", options); - try { - return await this.serviceContext.getStatistics(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + return new (P2 || (P2 = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e2) { + reject(e2); + } } - } - /** - * The Get Account Information operation returns the sku name and account kind - * for the specified account. - * The Get Account Information operation is available on service versions beginning - * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information - * - * @param options - Options to the Service Get Account Info operation. - * @returns Response data for the Service Get Account Info operation. - */ - async getAccountInfo(options = {}) { - const { span, updatedOptions } = createSpan2("BlobServiceClient-getAccountInfo", options); - try { - return await this.serviceContext.getAccountInfo(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); + } } - } - /** - * Returns a list of the containers under the specified account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2 - * - * @param marker - A string value that identifies the portion of - * the list of containers to be returned with the next listing operation. The - * operation returns the continuationToken value within the response body if the - * listing operation did not return all containers remaining to be listed - * with the current page. The continuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to the Service List Container Segment operation. - * @returns Response data for the Service List Container Segment operation. - */ - async listContainersSegment(marker2, options = {}) { - const { span, updatedOptions } = createSpan2("BlobServiceClient-listContainersSegment", options); - try { - return await this.serviceContext.listContainersSegment(Object.assign(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker: marker2 }, options), { include: typeof options.include === "string" ? [options.include] : options.include }), convertTracingToRequestOptionsBase(updatedOptions))); - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.saveCache = exports.reserveCache = exports.downloadCache = exports.getCacheEntry = exports.getCacheVersion = void 0; + var core2 = __importStar(require_core()); + var http_client_1 = require_lib(); + var auth_1 = require_auth(); + var crypto5 = __importStar(__require("crypto")); + var fs3 = __importStar(__require("fs")); + var url_1 = __require("url"); + var utils = __importStar(require_cacheUtils()); + var downloadUtils_1 = require_downloadUtils(); + var options_1 = require_options(); + var requestUtils_1 = require_requestUtils(); + var versionSalt = "1.0"; + function getCacheApiUrl(resource) { + const baseUrl = process.env["ACTIONS_CACHE_URL"] || ""; + if (!baseUrl) { + throw new Error("Cache Service Url not found, unable to restore cache."); } - /** - * The Filter Blobs operation enables callers to list blobs across all containers whose tags - * match a given search expression. Filter blobs searches across all containers within a - * storage account but can be scoped within the expression to a single container. - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param marker - A string value that identifies the portion of - * the list of blobs to be returned with the next listing operation. The - * operation returns the continuationToken value within the response body if the - * listing operation did not return all blobs remaining to be listed - * with the current page. The continuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to find blobs by tags. - */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - const { span, updatedOptions } = createSpan2("BlobServiceClient-findBlobsByTagsSegment", options); - try { - const response = await this.serviceContext.filterBlobs(Object.assign({ abortSignal: options.abortSignal, where: tagFilterSqlExpression, marker: marker2, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a2; - let tagValue = ""; - if (((_a2 = blob.tags) === null || _a2 === void 0 ? void 0 : _a2.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); - return wrappedResponse; - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + const url2 = `${baseUrl}_apis/artifactcache/${resource}`; + core2.debug(`Resource Url: ${url2}`); + return url2; + } + function createAcceptHeader(type3, apiVersion) { + return `${type3};api-version=${apiVersion}`; + } + function getRequestOptions() { + const requestOptions = { + headers: { + Accept: createAcceptHeader("application/json", "6.0-preview.1") } + }; + return requestOptions; + } + function createHttpClient() { + const token = process.env["ACTIONS_RUNTIME_TOKEN"] || ""; + const bearerCredentialHandler = new auth_1.BearerCredentialHandler(token); + return new http_client_1.HttpClient("actions/cache", [bearerCredentialHandler], getRequestOptions()); + } + function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { + const components = paths; + if (compressionMethod) { + components.push(compressionMethod); } - /** - * Returns an AsyncIterableIterator for ServiceFindBlobsByTagsSegmentResponse. - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param marker - A string value that identifies the portion of - * the list of blobs to be returned with the next listing operation. The - * operation returns the continuationToken value within the response body if the - * listing operation did not return all blobs remaining to be listed - * with the current page. The continuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to find blobs by tags. - */ - findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options = {}) { - return __asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1() { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield __await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield __await(response); - } while (marker2); - } - }); + if (process.platform === "win32" && !enableCrossOsArchive) { + components.push("windows-only"); } - /** - * Returns an AsyncIterableIterator for blobs. - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param options - Options to findBlobsByTagsItems. - */ - findBlobsByTagsItems(tagFilterSqlExpression, options = {}) { - return __asyncGenerator(this, arguments, function* findBlobsByTagsItems_1() { - var e_1, _a2; - let marker2; - try { - for (var _b = __asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _c; _c = yield __await(_b.next()), !_c.done; ) { - const segment = _c.value; - yield __await(yield* __asyncDelegator(__asyncValues(segment.blobs))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (_c && !_c.done && (_a2 = _b.return)) - yield __await(_a2.call(_b)); - } finally { - if (e_1) - throw e_1.error; + components.push(versionSalt); + return crypto5.createHash("sha256").update(components.join("|")).digest("hex"); + } + exports.getCacheVersion = getCacheVersion; + function getCacheEntry(keys, paths, options) { + return __awaiter(this, void 0, void 0, function* () { + const httpClient = createHttpClient(); + const version4 = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive); + const resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version4}`; + const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter(this, void 0, void 0, function* () { + return httpClient.getJson(getCacheApiUrl(resource)); + })); + if (response.statusCode === 204) { + if (core2.isDebug()) { + yield printCachesListForDiagnostics(keys[0], httpClient, version4); + } + return null; + } + if (!(0, requestUtils_1.isSuccessStatusCode)(response.statusCode)) { + throw new Error(`Cache service responded with ${response.statusCode}`); + } + const cacheResult = response.result; + const cacheDownloadUrl = cacheResult === null || cacheResult === void 0 ? void 0 : cacheResult.archiveLocation; + if (!cacheDownloadUrl) { + throw new Error("Cache not found."); + } + core2.setSecret(cacheDownloadUrl); + core2.debug(`Cache Result:`); + core2.debug(JSON.stringify(cacheResult)); + return cacheResult; + }); + } + exports.getCacheEntry = getCacheEntry; + function printCachesListForDiagnostics(key, httpClient, version4) { + return __awaiter(this, void 0, void 0, function* () { + const resource = `caches?key=${encodeURIComponent(key)}`; + const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter(this, void 0, void 0, function* () { + return httpClient.getJson(getCacheApiUrl(resource)); + })); + if (response.statusCode === 200) { + const cacheListResult = response.result; + const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount; + if (totalCount && totalCount > 0) { + core2.debug(`No matching cache found for cache key '${key}', version '${version4} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key +Other caches with similar key:`); + for (const cacheEntry of (cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.artifactCaches) || []) { + core2.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); } } - }); - } - /** - * Returns an async iterable iterator to find all blobs with specified tag - * under the specified account. - * - * .byPage() returns an async iterable iterator to list the blobs in pages. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties - * - * Example using `for await` syntax: - * - * ```js - * let i = 1; - * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) { - * console.log(`Blob ${i++}: ${container.name}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let i = 1; - * let iterator = blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * - * // Prints 2 blob names - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * - * // Gets next marker - * let marker = response.continuationToken; - * // Passing next marker as continuationToken - * iterator = blobServiceClient - * .findBlobsByTags("tagkey='tagvalue'") - * .byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; - * - * // Prints blob names - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * ``` - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param options - Options to find blobs by tags. - */ - findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); - const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); - return { - /** - * The next method, part of the iteration protocol - */ - next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings2 = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings2.continuationToken, Object.assign({ maxPageSize: settings2.maxPageSize }, listSegmentOptions)); + } + }); + } + function downloadCache(archiveLocation, archivePath, options) { + return __awaiter(this, void 0, void 0, function* () { + const archiveUrl = new url_1.URL(archiveLocation); + const downloadOptions = (0, options_1.getDownloadOptions)(options); + if (archiveUrl.hostname.endsWith(".blob.core.windows.net")) { + if (downloadOptions.useAzureSdk) { + yield (0, downloadUtils_1.downloadCacheStorageSDK)(archiveLocation, archivePath, downloadOptions); + } else if (downloadOptions.concurrentBlobDownloads) { + yield (0, downloadUtils_1.downloadCacheHttpClientConcurrent)(archiveLocation, archivePath, downloadOptions); + } else { + yield (0, downloadUtils_1.downloadCacheHttpClient)(archiveLocation, archivePath); } + } else { + yield (0, downloadUtils_1.downloadCacheHttpClient)(archiveLocation, archivePath); + } + }); + } + exports.downloadCache = downloadCache; + function reserveCache(key, paths, options) { + return __awaiter(this, void 0, void 0, function* () { + const httpClient = createHttpClient(); + const version4 = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive); + const reserveCacheRequest = { + key, + version: version4, + cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize + }; + const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter(this, void 0, void 0, function* () { + return httpClient.postJson(getCacheApiUrl("caches"), reserveCacheRequest); + })); + return response; + }); + } + exports.reserveCache = reserveCache; + function getContentRange(start, end) { + return `bytes ${start}-${end}/*`; + } + function uploadChunk(httpClient, resourceUrl, openStream, start, end) { + return __awaiter(this, void 0, void 0, function* () { + core2.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); + const additionalHeaders = { + "Content-Type": "application/octet-stream", + "Content-Range": getContentRange(start, end) }; + const uploadChunkResponse = yield (0, requestUtils_1.retryHttpClientResponse)(`uploadChunk (start: ${start}, end: ${end})`, () => __awaiter(this, void 0, void 0, function* () { + return httpClient.sendStream("PATCH", resourceUrl, openStream(), additionalHeaders); + })); + if (!(0, requestUtils_1.isSuccessStatusCode)(uploadChunkResponse.message.statusCode)) { + throw new Error(`Cache service responded with ${uploadChunkResponse.message.statusCode} during upload chunk.`); + } + }); + } + function uploadFile(httpClient, cacheId, archivePath, options) { + return __awaiter(this, void 0, void 0, function* () { + const fileSize = utils.getArchiveFileSizeInBytes(archivePath); + const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); + const fd = fs3.openSync(archivePath, "r"); + const uploadOptions = (0, options_1.getUploadOptions)(options); + const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); + const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); + const parallelUploads = [...new Array(concurrency).keys()]; + core2.debug("Awaiting all uploads"); + let offset = 0; + try { + yield Promise.all(parallelUploads.map(() => __awaiter(this, void 0, void 0, function* () { + while (offset < fileSize) { + const chunkSize = Math.min(fileSize - offset, maxChunkSize); + const start = offset; + const end = offset + chunkSize - 1; + offset += maxChunkSize; + yield uploadChunk(httpClient, resourceUrl, () => fs3.createReadStream(archivePath, { + fd, + start, + end, + autoClose: false + }).on("error", (error) => { + throw new Error(`Cache upload failed because file read failed with ${error.message}`); + }), start, end); + } + }))); + } finally { + fs3.closeSync(fd); + } + return; + }); + } + function commitCache(httpClient, cacheId, filesize) { + return __awaiter(this, void 0, void 0, function* () { + const commitCacheRequest = { size: filesize }; + return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter(this, void 0, void 0, function* () { + return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest); + })); + }); + } + function saveCache3(cacheId, archivePath, options) { + return __awaiter(this, void 0, void 0, function* () { + const httpClient = createHttpClient(); + core2.debug("Upload cache"); + yield uploadFile(httpClient, cacheId, archivePath, options); + core2.debug("Commiting cache"); + const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); + core2.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); + const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize); + if (!(0, requestUtils_1.isSuccessStatusCode)(commitCacheResponse.statusCode)) { + throw new Error(`Cache service responded with ${commitCacheResponse.statusCode} during commit cache.`); + } + core2.info("Cache saved successfully"); + }); + } + exports.saveCache = saveCache3; + } +}); + +// node_modules/@actions/cache/lib/internal/tar.js +var require_tar = __commonJS({ + "node_modules/@actions/cache/lib/internal/tar.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + var desc = Object.getOwnPropertyDescriptor(m3, k2); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m3[k2]; + } }; + } + Object.defineProperty(o2, k22, desc); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); } - /** - * Returns an AsyncIterableIterator for ServiceListContainersSegmentResponses - * - * @param marker - A string value that identifies the portion of - * the list of containers to be returned with the next listing operation. The - * operation returns the continuationToken value within the response body if the - * listing operation did not return all containers remaining to be listed - * with the current page. The continuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to list containers operation. - */ - listSegments(marker2, options = {}) { - return __asyncGenerator(this, arguments, function* listSegments_1() { - let listContainersSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listContainersSegmentResponse = yield __await(this.listContainersSegment(marker2, options)); - listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; - marker2 = listContainersSegmentResponse.continuationToken; - yield yield __await(yield __await(listContainersSegmentResponse)); - } while (marker2); - } + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve2) { + resolve2(value); }); } - /** - * Returns an AsyncIterableIterator for Container Items - * - * @param options - Options to list containers operation. - */ - listItems(options = {}) { - return __asyncGenerator(this, arguments, function* listItems_1() { - var e_2, _a2; - let marker2; + return new (P2 || (P2 = Promise))(function(resolve2, reject) { + function fulfilled(value) { try { - for (var _b = __asyncValues(this.listSegments(marker2, options)), _c; _c = yield __await(_b.next()), !_c.done; ) { - const segment = _c.value; - yield __await(yield* __asyncDelegator(__asyncValues(segment.containerItems))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (_c && !_c.done && (_a2 = _b.return)) - yield __await(_a2.call(_b)); - } finally { - if (e_2) - throw e_2.error; - } + step(generator.next(value)); + } catch (e2) { + reject(e2); } - }); - } - /** - * Returns an async iterable iterator to list all the containers - * under the specified account. - * - * .byPage() returns an async iterable iterator to list the containers in pages. - * - * Example using `for await` syntax: - * - * ```js - * let i = 1; - * for await (const container of blobServiceClient.listContainers()) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * const iter = blobServiceClient.listContainers(); - * let containerItem = await iter.next(); - * while (!containerItem.done) { - * console.log(`Container ${i++}: ${containerItem.value.name}`); - * containerItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let i = 1; - * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * - * // Prints 2 container names - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * } - * - * // Gets next marker - * let marker = response.continuationToken; - * // Passing next marker as continuationToken - * iterator = blobServiceClient - * .listContainers() - * .byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; - * - * // Prints 10 container names - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * } - * ``` - * - * @param options - Options to list containers. - * @returns An asyncIterableIterator that supports paging. - */ - listContainers(options = {}) { - if (options.prefix === "") { - options.prefix = void 0; } - const include2 = []; - if (options.includeDeleted) { - include2.push("deleted"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); + } } - if (options.includeMetadata) { - include2.push("metadata"); + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - if (options.includeSystem) { - include2.push("system"); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createTar = exports.extractTar = exports.listTar = void 0; + var exec_1 = require_exec(); + var io2 = __importStar(require_io()); + var fs_1 = __require("fs"); + var path14 = __importStar(__require("path")); + var utils = __importStar(require_cacheUtils()); + var constants_1 = require_constants6(); + var IS_WINDOWS = process.platform === "win32"; + function getTarPath() { + return __awaiter(this, void 0, void 0, function* () { + switch (process.platform) { + case "win32": { + const gnuTar = yield utils.getGnuTarPathOnWindows(); + const systemTar = constants_1.SystemTarPathOnWindows; + if (gnuTar) { + return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; + } else if ((0, fs_1.existsSync)(systemTar)) { + return { path: systemTar, type: constants_1.ArchiveToolType.BSD }; + } + break; + } + case "darwin": { + const gnuTar = yield io2.which("gtar", false); + if (gnuTar) { + return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; + } else { + return { + path: yield io2.which("tar", true), + type: constants_1.ArchiveToolType.BSD + }; + } + } + default: + break; } - const listSegmentOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItems(listSegmentOptions); return { - /** - * The next method, part of the iteration protocol - */ - next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings2 = {}) => { - return this.listSegments(settings2.continuationToken, Object.assign({ maxPageSize: settings2.maxPageSize }, listSegmentOptions)); - } + path: yield io2.which("tar", true), + type: constants_1.ArchiveToolType.GNU }; - } - /** - * ONLY AVAILABLE WHEN USING BEARER TOKEN AUTHENTICATION (TokenCredential). - * - * Retrieves a user delegation key for the Blob service. This is only a valid operation when using - * bearer token authentication. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-user-delegation-key - * - * @param startsOn - The start time for the user delegation SAS. Must be within 7 days of the current time - * @param expiresOn - The end time for the user delegation SAS. Must be within 7 days of the current time - */ - async getUserDelegationKey(startsOn, expiresOn2, options = {}) { - const { span, updatedOptions } = createSpan2("BlobServiceClient-getUserDelegationKey", options); - try { - const response = await this.serviceContext.getUserDelegationKey({ - startsOn: truncatedISO8061Date(startsOn, false), - expiresOn: truncatedISO8061Date(expiresOn2, false) - }, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); - const userDelegationKey = { - signedObjectId: response.signedObjectId, - signedTenantId: response.signedTenantId, - signedStartsOn: new Date(response.signedStartsOn), - signedExpiresOn: new Date(response.signedExpiresOn), - signedService: response.signedService, - signedVersion: response.signedVersion, - value: response.value - }; - const res = Object.assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey); - return res; - } catch (e2) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e2.message - }); - throw e2; - } finally { - span.end(); + }); + } + function getTarArgs(tarPath, compressionMethod, type3, archivePath = "") { + return __awaiter(this, void 0, void 0, function* () { + const args = [`"${tarPath.path}"`]; + const cacheFileName = utils.getCacheFileName(compressionMethod); + const tarFile = "cache.tar"; + const workingDirectory = getWorkingDirectory(); + const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; + switch (type3) { + case "create": + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path14.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path14.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path14.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + break; + case "extract": + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path14.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path14.sep}`, "g"), "/")); + break; + case "list": + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path14.sep}`, "g"), "/"), "-P"); + break; } - } - /** - * Creates a BlobBatchClient object to conduct batch operations. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch - * - * @returns A new BlobBatchClient object for this service. - */ - getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); - } - /** - * Only available for BlobServiceClient constructed with a shared key credential. - * - * Generates a Blob account Shared Access Signature (SAS) URI based on the client properties - * and parameters passed in. The SAS is signed by the shared key credential of the client. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas - * - * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided. - * @param permissions - Specifies the list of permissions to be associated with the SAS. - * @param resourceTypes - Specifies the resource types associated with the shared access signature. - * @param options - Optional parameters. - * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. - */ - generateAccountSasUrl(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential"); + if (tarPath.type === constants_1.ArchiveToolType.GNU) { + switch (process.platform) { + case "win32": + args.push("--force-local"); + break; + case "darwin": + args.push("--delay-directory-restore"); + break; + } } - if (expiresOn2 === void 0) { - const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + return args; + }); + } + function getCommands(compressionMethod, type3, archivePath = "") { + return __awaiter(this, void 0, void 0, function* () { + let args; + const tarPath = yield getTarPath(); + const tarArgs = yield getTarArgs(tarPath, compressionMethod, type3, archivePath); + const compressionArgs = type3 !== "create" ? yield getDecompressionProgram(tarPath, compressionMethod, archivePath) : yield getCompressionProgram(tarPath, compressionMethod); + const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; + if (BSD_TAR_ZSTD && type3 !== "create") { + args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; + } else { + args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; } - const sas = generateAccountSASQueryParameters(Object.assign({ - permissions, - expiresOn: expiresOn2, - resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).toString(); - return appendToURLQuery(this.url, sas); - } - }; - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BatchResponse.js -var init_BatchResponse = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/BatchResponse.js"() { - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generatedModels.js -var KnownEncryptionAlgorithmType; -var init_generatedModels = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generatedModels.js"() { - (function(KnownEncryptionAlgorithmType2) { - KnownEncryptionAlgorithmType2["AES256"] = "AES256"; - })(KnownEncryptionAlgorithmType || (KnownEncryptionAlgorithmType = {})); - } -}); - -// node_modules/@azure/storage-blob/dist-esm/storage-blob/src/index.js -var src_exports2 = {}; -__export(src_exports2, { - AccountSASPermissions: () => AccountSASPermissions, - AccountSASResourceTypes: () => AccountSASResourceTypes, - AccountSASServices: () => AccountSASServices, - AnonymousCredential: () => AnonymousCredential, - AnonymousCredentialPolicy: () => AnonymousCredentialPolicy, - AppendBlobClient: () => AppendBlobClient, - BaseRequestPolicy: () => BaseRequestPolicy, - BlobBatch: () => BlobBatch, - BlobBatchClient: () => BlobBatchClient, - BlobClient: () => BlobClient, - BlobLeaseClient: () => BlobLeaseClient, - BlobSASPermissions: () => BlobSASPermissions, - BlobServiceClient: () => BlobServiceClient, - BlockBlobClient: () => BlockBlobClient, - BlockBlobTier: () => BlockBlobTier, - ContainerClient: () => ContainerClient, - ContainerSASPermissions: () => ContainerSASPermissions, - Credential: () => Credential, - CredentialPolicy: () => CredentialPolicy, - HttpHeaders: () => HttpHeaders, - KnownEncryptionAlgorithmType: () => KnownEncryptionAlgorithmType, - PageBlobClient: () => PageBlobClient, - Pipeline: () => Pipeline, - PremiumPageBlobTier: () => PremiumPageBlobTier, - RequestPolicyOptions: () => RequestPolicyOptions, - RestError: () => RestError, - SASProtocol: () => SASProtocol, - SASQueryParameters: () => SASQueryParameters, - StorageBlobAudience: () => StorageBlobAudience, - StorageBrowserPolicy: () => StorageBrowserPolicy, - StorageBrowserPolicyFactory: () => StorageBrowserPolicyFactory, - StorageOAuthScopes: () => StorageOAuthScopes, - StorageRetryPolicy: () => StorageRetryPolicy, - StorageRetryPolicyFactory: () => StorageRetryPolicyFactory, - StorageRetryPolicyType: () => StorageRetryPolicyType, - StorageSharedKeyCredential: () => StorageSharedKeyCredential, - StorageSharedKeyCredentialPolicy: () => StorageSharedKeyCredentialPolicy, - WebResource: () => WebResource, - deserializationPolicy: () => deserializationPolicy, - generateAccountSASQueryParameters: () => generateAccountSASQueryParameters, - generateBlobSASQueryParameters: () => generateBlobSASQueryParameters, - isPipelineLike: () => isPipelineLike, - logger: () => logger2, - newPipeline: () => newPipeline -}); -var init_src11 = __esm({ - "node_modules/@azure/storage-blob/dist-esm/storage-blob/src/index.js"() { - init_src5(); - init_BlobServiceClient(); - init_Clients(); - init_ContainerClient(); - init_BlobLeaseClient(); - init_AccountSASPermissions(); - init_AccountSASResourceTypes(); - init_AccountSASServices(); - init_AccountSASSignatureValues(); - init_BlobBatch(); - init_BlobBatchClient(); - init_BatchResponse(); - init_BlobSASPermissions(); - init_BlobSASSignatureValues(); - init_StorageBrowserPolicyFactory(); - init_ContainerSASPermissions(); - init_AnonymousCredential(); - init_Credential(); - init_StorageSharedKeyCredential(); - init_models3(); - init_Pipeline(); - init_AnonymousCredentialPolicy(); - init_CredentialPolicy(); - init_StorageRetryPolicyFactory(); - init_StorageSharedKeyCredentialPolicy(); - init_SASQueryParameters(); - init_generatedModels(); - init_log3(); + if (BSD_TAR_ZSTD) { + return args; + } + return [args.join(" ")]; + }); + } + function getWorkingDirectory() { + var _a2; + return (_a2 = process.env["GITHUB_WORKSPACE"]) !== null && _a2 !== void 0 ? _a2 : process.cwd(); + } + function getDecompressionProgram(tarPath, compressionMethod, archivePath) { + return __awaiter(this, void 0, void 0, function* () { + const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; + switch (compressionMethod) { + case constants_1.CompressionMethod.Zstd: + return BSD_TAR_ZSTD ? [ + "zstd -d --long=30 --force -o", + constants_1.TarFilename, + archivePath.replace(new RegExp(`\\${path14.sep}`, "g"), "/") + ] : [ + "--use-compress-program", + IS_WINDOWS ? '"zstd -d --long=30"' : "unzstd --long=30" + ]; + case constants_1.CompressionMethod.ZstdWithoutLong: + return BSD_TAR_ZSTD ? [ + "zstd -d --force -o", + constants_1.TarFilename, + archivePath.replace(new RegExp(`\\${path14.sep}`, "g"), "/") + ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; + default: + return ["-z"]; + } + }); + } + function getCompressionProgram(tarPath, compressionMethod) { + return __awaiter(this, void 0, void 0, function* () { + const cacheFileName = utils.getCacheFileName(compressionMethod); + const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; + switch (compressionMethod) { + case constants_1.CompressionMethod.Zstd: + return BSD_TAR_ZSTD ? [ + "zstd -T0 --long=30 --force -o", + cacheFileName.replace(new RegExp(`\\${path14.sep}`, "g"), "/"), + constants_1.TarFilename + ] : [ + "--use-compress-program", + IS_WINDOWS ? '"zstd -T0 --long=30"' : "zstdmt --long=30" + ]; + case constants_1.CompressionMethod.ZstdWithoutLong: + return BSD_TAR_ZSTD ? [ + "zstd -T0 --force -o", + cacheFileName.replace(new RegExp(`\\${path14.sep}`, "g"), "/"), + constants_1.TarFilename + ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; + default: + return ["-z"]; + } + }); + } + function execCommands(commands, cwd) { + return __awaiter(this, void 0, void 0, function* () { + for (const command of commands) { + try { + yield (0, exec_1.exec)(command, void 0, { + cwd, + env: Object.assign(Object.assign({}, process.env), { MSYS: "winsymlinks:nativestrict" }) + }); + } catch (error) { + throw new Error(`${command.split(" ")[0]} failed with error: ${error === null || error === void 0 ? void 0 : error.message}`); + } + } + }); + } + function listTar(archivePath, compressionMethod) { + return __awaiter(this, void 0, void 0, function* () { + const commands = yield getCommands(compressionMethod, "list", archivePath); + yield execCommands(commands); + }); + } + exports.listTar = listTar; + function extractTar2(archivePath, compressionMethod) { + return __awaiter(this, void 0, void 0, function* () { + const workingDirectory = getWorkingDirectory(); + yield io2.mkdirP(workingDirectory); + const commands = yield getCommands(compressionMethod, "extract", archivePath); + yield execCommands(commands); + }); + } + exports.extractTar = extractTar2; + function createTar(archiveFolder, sourceDirectories, compressionMethod) { + return __awaiter(this, void 0, void 0, function* () { + (0, fs_1.writeFileSync)(path14.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + const commands = yield getCommands(compressionMethod, "create"); + yield execCommands(commands, archiveFolder); + }); + } + exports.createTar = createTar; } }); -// node_modules/@actions/cache/lib/internal/requestUtils.js -var require_requestUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/requestUtils.js"(exports) { +// node_modules/@actions/cache/lib/cache.js +var require_cache2 = __commonJS({ + "node_modules/@actions/cache/lib/cache.js"(exports) { "use strict"; var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { if (k22 === void 0) @@ -56395,129 +72088,483 @@ var require_requestUtils = __commonJS({ }); }; Object.defineProperty(exports, "__esModule", { value: true }); - exports.retryHttpClientResponse = exports.retryTypedResponse = exports.retry = exports.isRetryableStatusCode = exports.isServerErrorStatusCode = exports.isSuccessStatusCode = void 0; + exports.saveCache = exports.restoreCache = exports.isFeatureAvailable = exports.ReserveCacheError = exports.ValidationError = void 0; var core2 = __importStar(require_core()); - var http_client_1 = require_lib(); - var constants_1 = require_constants2(); - function isSuccessStatusCode(statusCode) { - if (!statusCode) { - return false; + var path14 = __importStar(__require("path")); + var utils = __importStar(require_cacheUtils()); + var cacheHttpClient = __importStar(require_cacheHttpClient()); + var tar_1 = require_tar(); + var ValidationError = class _ValidationError extends Error { + constructor(message) { + super(message); + this.name = "ValidationError"; + Object.setPrototypeOf(this, _ValidationError.prototype); } - return statusCode >= 200 && statusCode < 300; - } - exports.isSuccessStatusCode = isSuccessStatusCode; - function isServerErrorStatusCode(statusCode) { - if (!statusCode) { - return true; + }; + exports.ValidationError = ValidationError; + var ReserveCacheError2 = class _ReserveCacheError extends Error { + constructor(message) { + super(message); + this.name = "ReserveCacheError"; + Object.setPrototypeOf(this, _ReserveCacheError.prototype); + } + }; + exports.ReserveCacheError = ReserveCacheError2; + function checkPaths(paths) { + if (!paths || paths.length === 0) { + throw new ValidationError(`Path Validation Error: At least one directory or file path is required`); } - return statusCode >= 500; } - exports.isServerErrorStatusCode = isServerErrorStatusCode; - function isRetryableStatusCode(statusCode) { - if (!statusCode) { - return false; + function checkKey(key) { + if (key.length > 512) { + throw new ValidationError(`Key Validation Error: ${key} cannot be larger than 512 characters.`); + } + const regex = /^[^,]*$/; + if (!regex.test(key)) { + throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`); } - const retryableStatusCodes = [ - http_client_1.HttpCodes.BadGateway, - http_client_1.HttpCodes.ServiceUnavailable, - http_client_1.HttpCodes.GatewayTimeout - ]; - return retryableStatusCodes.includes(statusCode); } - exports.isRetryableStatusCode = isRetryableStatusCode; - function sleep(milliseconds) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve2) => setTimeout(resolve2, milliseconds)); - }); + function isFeatureAvailable() { + return !!process.env["ACTIONS_CACHE_URL"]; } - function retry3(name2, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay3 = constants_1.DefaultRetryDelay, onError = void 0) { + exports.isFeatureAvailable = isFeatureAvailable; + function restoreCache3(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { return __awaiter(this, void 0, void 0, function* () { - let errorMessage = ""; - let attempt = 1; - while (attempt <= maxAttempts) { - let response = void 0; - let statusCode = void 0; - let isRetryable = false; + checkPaths(paths); + restoreKeys = restoreKeys || []; + const keys = [primaryKey, ...restoreKeys]; + core2.debug("Resolved Keys:"); + core2.debug(JSON.stringify(keys)); + if (keys.length > 10) { + throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); + } + for (const key of keys) { + checkKey(key); + } + const compressionMethod = yield utils.getCompressionMethod(); + let archivePath = ""; + try { + const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { + compressionMethod, + enableCrossOsArchive + }); + if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { + return void 0; + } + if (options === null || options === void 0 ? void 0 : options.lookupOnly) { + core2.info("Lookup only - skipping download"); + return cacheEntry.cacheKey; + } + archivePath = path14.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core2.debug(`Archive Path: ${archivePath}`); + yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); + if (core2.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core2.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + yield (0, tar_1.extractTar)(archivePath, compressionMethod); + core2.info("Cache restored successfully"); + return cacheEntry.cacheKey; + } catch (error) { + const typedError = error; + if (typedError.name === ValidationError.name) { + throw error; + } else { + core2.warning(`Failed to restore: ${error.message}`); + } + } finally { try { - response = yield method(); + yield utils.unlinkFile(archivePath); } catch (error) { - if (onError) { - response = onError(error); - } - isRetryable = true; - errorMessage = error.message; + core2.debug(`Failed to delete archive: ${error}`); } - if (response) { - statusCode = getStatusCode(response); - if (!isServerErrorStatusCode(statusCode)) { - return response; - } + } + return void 0; + }); + } + exports.restoreCache = restoreCache3; + function saveCache3(paths, key, options, enableCrossOsArchive = false) { + var _a2, _b2, _c2, _d2, _e2; + return __awaiter(this, void 0, void 0, function* () { + checkPaths(paths); + checkKey(key); + const compressionMethod = yield utils.getCompressionMethod(); + let cacheId = -1; + const cachePaths = yield utils.resolvePaths(paths); + core2.debug("Cache Paths:"); + core2.debug(`${JSON.stringify(cachePaths)}`); + if (cachePaths.length === 0) { + throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); + } + const archiveFolder = yield utils.createTempDirectory(); + const archivePath = path14.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core2.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core2.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); } - if (statusCode) { - isRetryable = isRetryableStatusCode(statusCode); - errorMessage = `Cache service responded with ${statusCode}`; + const fileSizeLimit = 10 * 1024 * 1024 * 1024; + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core2.debug(`File Size: ${archiveFileSize}`); + if (archiveFileSize > fileSizeLimit && !utils.isGhes()) { + throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); } - core2.debug(`${name2} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); - if (!isRetryable) { - core2.debug(`${name2} - Error is not retryable`); - break; + core2.debug("Reserving Cache"); + const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { + compressionMethod, + enableCrossOsArchive, + cacheSize: archiveFileSize + }); + if ((_a2 = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a2 === void 0 ? void 0 : _a2.cacheId) { + cacheId = (_b2 = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _b2 === void 0 ? void 0 : _b2.cacheId; + } else if ((reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.statusCode) === 400) { + throw new Error((_d2 = (_c2 = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _c2 === void 0 ? void 0 : _c2.message) !== null && _d2 !== void 0 ? _d2 : `Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the data cap limit, not saving cache.`); + } else { + throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e2 = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e2 === void 0 ? void 0 : _e2.message}`); + } + core2.debug(`Saving Cache (ID: ${cacheId})`); + yield cacheHttpClient.saveCache(cacheId, archivePath, options); + } catch (error) { + const typedError = error; + if (typedError.name === ValidationError.name) { + throw error; + } else if (typedError.name === ReserveCacheError2.name) { + core2.info(`Failed to save: ${typedError.message}`); + } else { + core2.warning(`Failed to save: ${typedError.message}`); + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error) { + core2.debug(`Failed to delete archive: ${error}`); } - yield sleep(delay3); - attempt++; } - throw Error(`${name2} failed: ${errorMessage}`); + return cacheId; }); } - exports.retry = retry3; - function retryTypedResponse(name2, method, maxAttempts = constants_1.DefaultRetryAttempts, delay3 = constants_1.DefaultRetryDelay) { - return __awaiter(this, void 0, void 0, function* () { - return yield retry3( - name2, - method, - (response) => response.statusCode, - maxAttempts, - delay3, - // If the error object contains the statusCode property, extract it and return - // an TypedResponse so it can be processed by the retry logic. - (error) => { - if (error instanceof http_client_1.HttpClientError) { - return { - statusCode: error.statusCode, - result: null, - headers: {}, - error - }; + exports.saveCache = saveCache3; + } +}); + +// node_modules/@actions/glob/lib/internal-glob-options-helper.js +var require_internal_glob_options_helper2 = __commonJS({ + "node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getOptions = void 0; + var core2 = __importStar(require_core()); + function getOptions(copy) { + const result = { + followSymbolicLinks: true, + implicitDescendants: true, + matchDirectories: true, + omitBrokenSymbolicLinks: true + }; + if (copy) { + if (typeof copy.followSymbolicLinks === "boolean") { + result.followSymbolicLinks = copy.followSymbolicLinks; + core2.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + } + if (typeof copy.implicitDescendants === "boolean") { + result.implicitDescendants = copy.implicitDescendants; + core2.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.matchDirectories === "boolean") { + result.matchDirectories = copy.matchDirectories; + core2.debug(`matchDirectories '${result.matchDirectories}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === "boolean") { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core2.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + } + } + return result; + } + exports.getOptions = getOptions; + } +}); + +// node_modules/@actions/glob/lib/internal-path-helper.js +var require_internal_path_helper2 = __commonJS({ + "node_modules/@actions/glob/lib/internal-path-helper.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; + }; + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.safeTrimTrailingSeparator = exports.normalizeSeparators = exports.hasRoot = exports.hasAbsoluteRoot = exports.ensureAbsoluteRoot = exports.dirname = void 0; + var path14 = __importStar(__require("path")); + var assert_1 = __importDefault(__require("assert")); + var IS_WINDOWS = process.platform === "win32"; + function dirname(p2) { + p2 = safeTrimTrailingSeparator(p2); + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p2)) { + return p2; + } + let result = path14.dirname(p2); + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); + } + return result; + } + exports.dirname = dirname; + function ensureAbsoluteRoot(root, itemPath) { + assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); + assert_1.default(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`); + if (hasAbsoluteRoot(itemPath)) { + return itemPath; + } + if (IS_WINDOWS) { + if (itemPath.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)) { + let cwd = process.cwd(); + assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); + if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) { + if (itemPath.length === 2) { + return `${itemPath[0]}:\\${cwd.substr(3)}`; } else { - return void 0; + if (!cwd.endsWith("\\")) { + cwd += "\\"; + } + return `${itemPath[0]}:\\${cwd.substr(3)}${itemPath.substr(2)}`; } + } else { + return `${itemPath[0]}:\\${itemPath.substr(2)}`; } - ); - }); + } else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) { + const cwd = process.cwd(); + assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); + return `${cwd[0]}:\\${itemPath.substr(1)}`; + } + } + assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { + } else { + root += path14.sep; + } + return root + itemPath; } - exports.retryTypedResponse = retryTypedResponse; - function retryHttpClientResponse(name2, method, maxAttempts = constants_1.DefaultRetryAttempts, delay3 = constants_1.DefaultRetryDelay) { - return __awaiter(this, void 0, void 0, function* () { - return yield retry3(name2, method, (response) => response.message.statusCode, maxAttempts, delay3); - }); + exports.ensureAbsoluteRoot = ensureAbsoluteRoot; + function hasAbsoluteRoot(itemPath) { + assert_1.default(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`); + itemPath = normalizeSeparators(itemPath); + if (IS_WINDOWS) { + return itemPath.startsWith("\\\\") || /^[A-Z]:\\/i.test(itemPath); + } + return itemPath.startsWith("/"); + } + exports.hasAbsoluteRoot = hasAbsoluteRoot; + function hasRoot(itemPath) { + assert_1.default(itemPath, `isRooted parameter 'itemPath' must not be empty`); + itemPath = normalizeSeparators(itemPath); + if (IS_WINDOWS) { + return itemPath.startsWith("\\") || /^[A-Z]:/i.test(itemPath); + } + return itemPath.startsWith("/"); + } + exports.hasRoot = hasRoot; + function normalizeSeparators(p2) { + p2 = p2 || ""; + if (IS_WINDOWS) { + p2 = p2.replace(/\//g, "\\"); + const isUnc = /^\\\\+[^\\]/.test(p2); + return (isUnc ? "\\" : "") + p2.replace(/\\\\+/g, "\\"); + } + return p2.replace(/\/\/+/g, "/"); + } + exports.normalizeSeparators = normalizeSeparators; + function safeTrimTrailingSeparator(p2) { + if (!p2) { + return ""; + } + p2 = normalizeSeparators(p2); + if (!p2.endsWith(path14.sep)) { + return p2; + } + if (p2 === path14.sep) { + return p2; + } + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p2)) { + return p2; + } + return p2.substr(0, p2.length - 1); + } + exports.safeTrimTrailingSeparator = safeTrimTrailingSeparator; + } +}); + +// node_modules/@actions/glob/lib/internal-match-kind.js +var require_internal_match_kind2 = __commonJS({ + "node_modules/@actions/glob/lib/internal-match-kind.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MatchKind = void 0; + var MatchKind; + (function(MatchKind2) { + MatchKind2[MatchKind2["None"] = 0] = "None"; + MatchKind2[MatchKind2["Directory"] = 1] = "Directory"; + MatchKind2[MatchKind2["File"] = 2] = "File"; + MatchKind2[MatchKind2["All"] = 3] = "All"; + })(MatchKind = exports.MatchKind || (exports.MatchKind = {})); + } +}); + +// node_modules/@actions/glob/lib/internal-pattern-helper.js +var require_internal_pattern_helper2 = __commonJS({ + "node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); + } : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) + __createBinding(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.partialMatch = exports.match = exports.getSearchPaths = void 0; + var pathHelper = __importStar(require_internal_path_helper2()); + var internal_match_kind_1 = require_internal_match_kind2(); + var IS_WINDOWS = process.platform === "win32"; + function getSearchPaths(patterns) { + patterns = patterns.filter((x2) => !x2.negate); + const searchPathMap = {}; + for (const pattern of patterns) { + const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; + searchPathMap[key] = "candidate"; + } + const result = []; + for (const pattern of patterns) { + const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; + if (searchPathMap[key] === "included") { + continue; + } + let foundAncestor = false; + let tempKey = key; + let parent = pathHelper.dirname(tempKey); + while (parent !== tempKey) { + if (searchPathMap[parent]) { + foundAncestor = true; + break; + } + tempKey = parent; + parent = pathHelper.dirname(tempKey); + } + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = "included"; + } + } + return result; + } + exports.getSearchPaths = getSearchPaths; + function match(patterns, itemPath) { + let result = internal_match_kind_1.MatchKind.None; + for (const pattern of patterns) { + if (pattern.negate) { + result &= ~pattern.match(itemPath); + } else { + result |= pattern.match(itemPath); + } + } + return result; + } + exports.match = match; + function partialMatch(patterns, itemPath) { + return patterns.some((x2) => !x2.negate && x2.partialMatch(itemPath)); } - exports.retryHttpClientResponse = retryHttpClientResponse; + exports.partialMatch = partialMatch; } }); -// node_modules/@actions/cache/lib/internal/downloadUtils.js -var require_downloadUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/downloadUtils.js"(exports) { +// node_modules/@actions/glob/lib/internal-path.js +var require_internal_path2 = __commonJS({ + "node_modules/@actions/glob/lib/internal-path.js"(exports) { "use strict"; var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { if (k22 === void 0) k22 = k2; - var desc = Object.getOwnPropertyDescriptor(m3, k2); - if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m3[k2]; - } }; - } - Object.defineProperty(o2, k22, desc); + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); } : function(o2, m3, k2, k22) { if (k22 === void 0) k22 = k2; @@ -56534,355 +72581,92 @@ var require_downloadUtils = __commonJS({ var result = {}; if (mod != null) { for (var k2 in mod) - if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) __createBinding(result, mod, k2); } __setModuleDefault(result, mod); return result; }; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve2) { - resolve2(value); - }); - } - return new (P2 || (P2 = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e2) { - reject(e2); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e2) { - reject(e2); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); - exports.downloadCacheStorageSDK = exports.downloadCacheHttpClientConcurrent = exports.downloadCacheHttpClient = exports.DownloadProgress = void 0; - var core2 = __importStar(require_core()); - var http_client_1 = require_lib(); - var storage_blob_1 = (init_src11(), __toCommonJS(src_exports2)); - var buffer = __importStar(__require("buffer")); - var fs3 = __importStar(__require("fs")); - var stream = __importStar(__require("stream")); - var util3 = __importStar(__require("util")); - var utils = __importStar(require_cacheUtils()); - var constants_1 = require_constants2(); - var requestUtils_1 = require_requestUtils(); - var abort_controller_1 = (init_abort_controller(), __toCommonJS(abort_controller_exports)); - function pipeResponseToStream(response, output) { - return __awaiter(this, void 0, void 0, function* () { - const pipeline = util3.promisify(stream.pipeline); - yield pipeline(response.message, output); - }); - } - var DownloadProgress = class { - constructor(contentLength2) { - this.contentLength = contentLength2; - this.segmentIndex = 0; - this.segmentSize = 0; - this.segmentOffset = 0; - this.receivedBytes = 0; - this.displayedComplete = false; - this.startTime = Date.now(); - } - /** - * Progress to the next segment. Only call this method when the previous segment - * is complete. - * - * @param segmentSize the length of the next segment - */ - nextSegment(segmentSize) { - this.segmentOffset = this.segmentOffset + this.segmentSize; - this.segmentIndex = this.segmentIndex + 1; - this.segmentSize = segmentSize; - this.receivedBytes = 0; - core2.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); - } - /** - * Sets the number of bytes received for the current segment. - * - * @param receivedBytes the number of bytes received - */ - setReceivedBytes(receivedBytes) { - this.receivedBytes = receivedBytes; - } - /** - * Returns the total number of bytes transferred. - */ - getTransferredBytes() { - return this.segmentOffset + this.receivedBytes; - } - /** - * Returns true if the download is complete. - */ - isDone() { - return this.getTransferredBytes() === this.contentLength; - } - /** - * Prints the current download stats. Once the download completes, this will print one - * last line and then stop. - */ - display() { - if (this.displayedComplete) { - return; - } - const transferredBytes = this.segmentOffset + this.receivedBytes; - const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); - const elapsedTime = Date.now() - this.startTime; - const downloadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core2.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); - if (this.isDone()) { - this.displayedComplete = true; - } - } - /** - * Returns a function used to handle TransferProgressEvents. - */ - onProgress() { - return (progress) => { - this.setReceivedBytes(progress.loadedBytes); - }; - } - /** - * Starts the timer that displays the stats. - * - * @param delayInMs the delay between each write - */ - startDisplayTimer(delayInMs = 1e3) { - const displayCallback = () => { - this.display(); - if (!this.isDone()) { - this.timeoutHandle = setTimeout(displayCallback, delayInMs); - } - }; - this.timeoutHandle = setTimeout(displayCallback, delayInMs); - } + exports.Path = void 0; + var path14 = __importStar(__require("path")); + var pathHelper = __importStar(require_internal_path_helper2()); + var assert_1 = __importDefault(__require("assert")); + var IS_WINDOWS = process.platform === "win32"; + var Path = class { /** - * Stops the timer that displays the stats. As this typically indicates the download - * is complete, this will display one last line, unless the last line has already - * been written. + * Constructs a Path + * @param itemPath Path or array of segments */ - stopDisplayTimer() { - if (this.timeoutHandle) { - clearTimeout(this.timeoutHandle); - this.timeoutHandle = void 0; - } - this.display(); - } - }; - exports.DownloadProgress = DownloadProgress; - function downloadCacheHttpClient(archiveLocation, archivePath) { - return __awaiter(this, void 0, void 0, function* () { - const writeStream = fs3.createWriteStream(archivePath); - const httpClient = new http_client_1.HttpClient("actions/cache"); - const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter(this, void 0, void 0, function* () { - return httpClient.get(archiveLocation); - })); - downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { - downloadResponse.message.destroy(); - core2.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); - }); - yield pipeResponseToStream(downloadResponse, writeStream); - const contentLengthHeader = downloadResponse.message.headers["content-length"]; - if (contentLengthHeader) { - const expectedLength = parseInt(contentLengthHeader); - const actualLength = utils.getArchiveFileSizeInBytes(archivePath); - if (actualLength !== expectedLength) { - throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`); - } - } else { - core2.debug("Unable to validate download, no Content-Length header"); - } - }); - } - exports.downloadCacheHttpClient = downloadCacheHttpClient; - function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { - var _a2; - return __awaiter(this, void 0, void 0, function* () { - const archiveDescriptor = yield fs3.promises.open(archivePath, "w"); - const httpClient = new http_client_1.HttpClient("actions/cache", void 0, { - socketTimeout: options.timeoutInMs, - keepAlive: true - }); - try { - const res = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCacheMetadata", () => __awaiter(this, void 0, void 0, function* () { - return yield httpClient.request("HEAD", archiveLocation, null, {}); - })); - const lengthHeader = res.message.headers["content-length"]; - if (lengthHeader === void 0 || lengthHeader === null) { - throw new Error("Content-Length not found on blob response"); - } - const length = parseInt(lengthHeader); - if (Number.isNaN(length)) { - throw new Error(`Could not interpret Content-Length: ${length}`); - } - const downloads = []; - const blockSize = 4 * 1024 * 1024; - for (let offset = 0; offset < length; offset += blockSize) { - const count = Math.min(blockSize, length - offset); - downloads.push({ - offset, - promiseGetter: () => __awaiter(this, void 0, void 0, function* () { - return yield downloadSegmentRetry(httpClient, archiveLocation, offset, count); - }) - }); - } - downloads.reverse(); - let actives = 0; - let bytesDownloaded = 0; - const progress = new DownloadProgress(length); - progress.startDisplayTimer(); - const progressFn = progress.onProgress(); - const activeDownloads = []; - let nextDownload; - const waitAndWrite = () => __awaiter(this, void 0, void 0, function* () { - const segment = yield Promise.race(Object.values(activeDownloads)); - yield archiveDescriptor.write(segment.buffer, 0, segment.count, segment.offset); - actives--; - delete activeDownloads[segment.offset]; - bytesDownloaded += segment.count; - progressFn({ loadedBytes: bytesDownloaded }); - }); - while (nextDownload = downloads.pop()) { - activeDownloads[nextDownload.offset] = nextDownload.promiseGetter(); - actives++; - if (actives >= ((_a2 = options.downloadConcurrency) !== null && _a2 !== void 0 ? _a2 : 10)) { - yield waitAndWrite(); + constructor(itemPath) { + this.segments = []; + if (typeof itemPath === "string") { + assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + if (!pathHelper.hasRoot(itemPath)) { + this.segments = itemPath.split(path14.sep); + } else { + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + const basename = path14.basename(remaining); + this.segments.unshift(basename); + remaining = dir; + dir = pathHelper.dirname(remaining); } + this.segments.unshift(remaining); } - while (actives > 0) { - yield waitAndWrite(); - } - } finally { - httpClient.dispose(); - yield archiveDescriptor.close(); - } - }); - } - exports.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; - function downloadSegmentRetry(httpClient, archiveLocation, offset, count) { - return __awaiter(this, void 0, void 0, function* () { - const retries = 5; - let failures = 0; - while (true) { - try { - const timeout = 3e4; - const result = yield promiseWithTimeout(timeout, downloadSegment(httpClient, archiveLocation, offset, count)); - if (typeof result === "string") { - throw new Error("downloadSegmentRetry failed due to timeout"); - } - return result; - } catch (err) { - if (failures >= retries) { - throw err; + } else { + assert_1.default(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`); + for (let i2 = 0; i2 < itemPath.length; i2++) { + let segment = itemPath[i2]; + assert_1.default(segment, `Parameter 'itemPath' must not contain any empty segments`); + segment = pathHelper.normalizeSeparators(itemPath[i2]); + if (i2 === 0 && pathHelper.hasRoot(segment)) { + segment = pathHelper.safeTrimTrailingSeparator(segment); + assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); + this.segments.push(segment); + } else { + assert_1.default(!segment.includes(path14.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); } - failures++; } } - }); - } - function downloadSegment(httpClient, archiveLocation, offset, count) { - return __awaiter(this, void 0, void 0, function* () { - const partRes = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCachePart", () => __awaiter(this, void 0, void 0, function* () { - return yield httpClient.get(archiveLocation, { - Range: `bytes=${offset}-${offset + count - 1}` - }); - })); - if (!partRes.readBodyBuffer) { - throw new Error("Expected HttpClientResponse to implement readBodyBuffer"); - } - return { - offset, - count, - buffer: yield partRes.readBodyBuffer() - }; - }); - } - function downloadCacheStorageSDK(archiveLocation, archivePath, options) { - var _a2; - return __awaiter(this, void 0, void 0, function* () { - const client = new storage_blob_1.BlockBlobClient(archiveLocation, void 0, { - retryOptions: { - // Override the timeout used when downloading each 4 MB chunk - // The default is 2 min / MB, which is way too slow - tryTimeoutInMs: options.timeoutInMs - } - }); - const properties = yield client.getProperties(); - const contentLength2 = (_a2 = properties.contentLength) !== null && _a2 !== void 0 ? _a2 : -1; - if (contentLength2 < 0) { - core2.debug("Unable to determine content length, downloading file with http-client..."); - yield downloadCacheHttpClient(archiveLocation, archivePath); - } else { - const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); - const downloadProgress = new DownloadProgress(contentLength2); - const fd = fs3.openSync(archivePath, "w"); - try { - downloadProgress.startDisplayTimer(); - const controller = new abort_controller_1.AbortController(); - const abortSignal = controller.signal; - while (!downloadProgress.isDone()) { - const segmentStart = downloadProgress.segmentOffset + downloadProgress.segmentSize; - const segmentSize = Math.min(maxSegmentSize, contentLength2 - segmentStart); - downloadProgress.nextSegment(segmentSize); - const result = yield promiseWithTimeout(options.segmentTimeoutInMs || 36e5, client.downloadToBuffer(segmentStart, segmentSize, { - abortSignal, - concurrency: options.downloadConcurrency, - onProgress: downloadProgress.onProgress() - })); - if (result === "timeout") { - controller.abort(); - throw new Error("Aborting cache download as the download time exceeded the timeout."); - } else if (Buffer.isBuffer(result)) { - fs3.writeFileSync(fd, result); - } - } - } finally { - downloadProgress.stopDisplayTimer(); - fs3.closeSync(fd); + } + /** + * Converts the path to it's string representation + */ + toString() { + let result = this.segments[0]; + let skipSlash = result.endsWith(path14.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + for (let i2 = 1; i2 < this.segments.length; i2++) { + if (skipSlash) { + skipSlash = false; + } else { + result += path14.sep; } + result += this.segments[i2]; } - }); - } - exports.downloadCacheStorageSDK = downloadCacheStorageSDK; - var promiseWithTimeout = (timeoutMs, promise) => __awaiter(void 0, void 0, void 0, function* () { - let timeoutHandle; - const timeoutPromise = new Promise((resolve2) => { - timeoutHandle = setTimeout(() => resolve2("timeout"), timeoutMs); - }); - return Promise.race([promise, timeoutPromise]).then((result) => { - clearTimeout(timeoutHandle); return result; - }); - }); + } + }; + exports.Path = Path; } }); -// node_modules/@actions/cache/lib/options.js -var require_options = __commonJS({ - "node_modules/@actions/cache/lib/options.js"(exports) { +// node_modules/@actions/glob/lib/internal-pattern.js +var require_internal_pattern2 = __commonJS({ + "node_modules/@actions/glob/lib/internal-pattern.js"(exports) { "use strict"; var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { if (k22 === void 0) k22 = k2; - var desc = Object.getOwnPropertyDescriptor(m3, k2); - if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m3[k2]; - } }; - } - Object.defineProperty(o2, k22, desc); + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); } : function(o2, m3, k2, k22) { if (k22 === void 0) k22 = k2; @@ -56899,92 +72683,212 @@ var require_options = __commonJS({ var result = {}; if (mod != null) { for (var k2 in mod) - if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) __createBinding(result, mod, k2); } __setModuleDefault(result, mod); return result; }; + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; Object.defineProperty(exports, "__esModule", { value: true }); - exports.getDownloadOptions = exports.getUploadOptions = void 0; - var core2 = __importStar(require_core()); - function getUploadOptions(copy) { - const result = { - uploadConcurrency: 4, - uploadChunkSize: 32 * 1024 * 1024 - }; - if (copy) { - if (typeof copy.uploadConcurrency === "number") { - result.uploadConcurrency = copy.uploadConcurrency; + exports.Pattern = void 0; + var os3 = __importStar(__require("os")); + var path14 = __importStar(__require("path")); + var pathHelper = __importStar(require_internal_path_helper2()); + var assert_1 = __importDefault(__require("assert")); + var minimatch_1 = require_minimatch(); + var internal_match_kind_1 = require_internal_match_kind2(); + var internal_path_1 = require_internal_path2(); + var IS_WINDOWS = process.platform === "win32"; + var Pattern = class _Pattern { + constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) { + this.negate = false; + let pattern; + if (typeof patternOrNegate === "string") { + pattern = patternOrNegate.trim(); + } else { + segments = segments || []; + assert_1.default(segments.length, `Parameter 'segments' must not empty`); + const root = _Pattern.getLiteral(segments[0]); + assert_1.default(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`); + pattern = new internal_path_1.Path(segments).toString().trim(); + if (patternOrNegate) { + pattern = `!${pattern}`; + } } - if (typeof copy.uploadChunkSize === "number") { - result.uploadChunkSize = copy.uploadChunkSize; + while (pattern.startsWith("!")) { + this.negate = !this.negate; + pattern = pattern.substr(1).trim(); } + pattern = _Pattern.fixupPattern(pattern, homedir); + this.segments = new internal_path_1.Path(pattern).segments; + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path14.sep); + pattern = pathHelper.safeTrimTrailingSeparator(pattern); + let foundGlob = false; + const searchSegments = this.segments.map((x2) => _Pattern.getLiteral(x2)).filter((x2) => !foundGlob && !(foundGlob = x2 === "")); + this.searchPath = new internal_path_1.Path(searchSegments).toString(); + this.rootRegExp = new RegExp(_Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? "i" : ""); + this.isImplicitPattern = isImplicitPattern; + const minimatchOptions = { + dot: true, + nobrace: true, + nocase: IS_WINDOWS, + nocomment: true, + noext: true, + nonegate: true + }; + pattern = IS_WINDOWS ? pattern.replace(/\\/g, "/") : pattern; + this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); } - core2.debug(`Upload concurrency: ${result.uploadConcurrency}`); - core2.debug(`Upload chunk size: ${result.uploadChunkSize}`); - return result; - } - exports.getUploadOptions = getUploadOptions; - function getDownloadOptions(copy) { - const result = { - useAzureSdk: false, - concurrentBlobDownloads: true, - downloadConcurrency: 8, - timeoutInMs: 3e4, - segmentTimeoutInMs: 6e5, - lookupOnly: false - }; - if (copy) { - if (typeof copy.useAzureSdk === "boolean") { - result.useAzureSdk = copy.useAzureSdk; - } - if (typeof copy.concurrentBlobDownloads === "boolean") { - result.concurrentBlobDownloads = copy.concurrentBlobDownloads; + /** + * Matches the pattern against the specified path + */ + match(itemPath) { + if (this.segments[this.segments.length - 1] === "**") { + itemPath = pathHelper.normalizeSeparators(itemPath); + if (!itemPath.endsWith(path14.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path14.sep}`; + } + } else { + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); } - if (typeof copy.downloadConcurrency === "number") { - result.downloadConcurrency = copy.downloadConcurrency; + if (this.minimatch.match(itemPath)) { + return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All; } - if (typeof copy.timeoutInMs === "number") { - result.timeoutInMs = copy.timeoutInMs; + return internal_match_kind_1.MatchKind.None; + } + /** + * Indicates whether the pattern may match descendants of the specified path + */ + partialMatch(itemPath) { + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + if (pathHelper.dirname(itemPath) === itemPath) { + return this.rootRegExp.test(itemPath); } - if (typeof copy.segmentTimeoutInMs === "number") { - result.segmentTimeoutInMs = copy.segmentTimeoutInMs; + return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); + } + /** + * Escapes glob patterns within a path + */ + static globEscape(s2) { + return (IS_WINDOWS ? s2 : s2.replace(/\\/g, "\\\\")).replace(/(\[)(?=[^/]+\])/g, "[[]").replace(/\?/g, "[?]").replace(/\*/g, "[*]"); + } + /** + * Normalizes slashes and ensures absolute root + */ + static fixupPattern(pattern, homedir) { + assert_1.default(pattern, "pattern cannot be empty"); + const literalSegments = new internal_path_1.Path(pattern).segments.map((x2) => _Pattern.getLiteral(x2)); + assert_1.default(literalSegments.every((x2, i2) => (x2 !== "." || i2 === 0) && x2 !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); + assert_1.default(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); + pattern = pathHelper.normalizeSeparators(pattern); + if (pattern === "." || pattern.startsWith(`.${path14.sep}`)) { + pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); + } else if (pattern === "~" || pattern.startsWith(`~${path14.sep}`)) { + homedir = homedir || os3.homedir(); + assert_1.default(homedir, "Unable to determine HOME directory"); + assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = _Pattern.globEscape(homedir) + pattern.substr(1); + } else if (IS_WINDOWS && (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\]/i))) { + let root = pathHelper.ensureAbsoluteRoot("C:\\dummy-root", pattern.substr(0, 2)); + if (pattern.length > 2 && !root.endsWith("\\")) { + root += "\\"; + } + pattern = _Pattern.globEscape(root) + pattern.substr(2); + } else if (IS_WINDOWS && (pattern === "\\" || pattern.match(/^\\[^\\]/))) { + let root = pathHelper.ensureAbsoluteRoot("C:\\dummy-root", "\\"); + if (!root.endsWith("\\")) { + root += "\\"; + } + pattern = _Pattern.globEscape(root) + pattern.substr(1); + } else { + pattern = pathHelper.ensureAbsoluteRoot(_Pattern.globEscape(process.cwd()), pattern); } - if (typeof copy.lookupOnly === "boolean") { - result.lookupOnly = copy.lookupOnly; + return pathHelper.normalizeSeparators(pattern); + } + /** + * Attempts to unescape a pattern segment to create a literal path segment. + * Otherwise returns empty string. + */ + static getLiteral(segment) { + let literal = ""; + for (let i2 = 0; i2 < segment.length; i2++) { + const c2 = segment[i2]; + if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { + literal += segment[++i2]; + continue; + } else if (c2 === "*" || c2 === "?") { + return ""; + } else if (c2 === "[" && i2 + 1 < segment.length) { + let set2 = ""; + let closed = -1; + for (let i22 = i2 + 1; i22 < segment.length; i22++) { + const c22 = segment[i22]; + if (c22 === "\\" && !IS_WINDOWS && i22 + 1 < segment.length) { + set2 += segment[++i22]; + continue; + } else if (c22 === "]") { + closed = i22; + break; + } else { + set2 += c22; + } + } + if (closed >= 0) { + if (set2.length > 1) { + return ""; + } + if (set2) { + literal += set2; + i2 = closed; + continue; + } + } + } + literal += c2; } + return literal; } - const segmentDownloadTimeoutMins = process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]; - if (segmentDownloadTimeoutMins && !isNaN(Number(segmentDownloadTimeoutMins)) && isFinite(Number(segmentDownloadTimeoutMins))) { - result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1e3; + /** + * Escapes regexp special characters + * https://javascript.info/regexp-escaping + */ + static regExpEscape(s2) { + return s2.replace(/[[\\^$.|?*+()]/g, "\\$&"); } - core2.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core2.debug(`Download concurrency: ${result.downloadConcurrency}`); - core2.debug(`Request timeout (ms): ${result.timeoutInMs}`); - core2.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); - core2.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); - core2.debug(`Lookup only: ${result.lookupOnly}`); - return result; - } - exports.getDownloadOptions = getDownloadOptions; + }; + exports.Pattern = Pattern; } }); -// node_modules/@actions/cache/lib/internal/cacheHttpClient.js -var require_cacheHttpClient = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheHttpClient.js"(exports) { +// node_modules/@actions/glob/lib/internal-search-state.js +var require_internal_search_state2 = __commonJS({ + "node_modules/@actions/glob/lib/internal-search-state.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SearchState = void 0; + var SearchState = class { + constructor(path14, level) { + this.path = path14; + this.level = level; + } + }; + exports.SearchState = SearchState; + } +}); + +// node_modules/@actions/glob/lib/internal-globber.js +var require_internal_globber2 = __commonJS({ + "node_modules/@actions/glob/lib/internal-globber.js"(exports) { "use strict"; var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { if (k22 === void 0) k22 = k2; - var desc = Object.getOwnPropertyDescriptor(m3, k2); - if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m3[k2]; - } }; - } - Object.defineProperty(o2, k22, desc); + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); } : function(o2, m3, k2, k22) { if (k22 === void 0) k22 = k2; @@ -57001,7 +72905,7 @@ var require_cacheHttpClient = __commonJS({ var result = {}; if (mod != null) { for (var k2 in mod) - if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) __createBinding(result, mod, k2); } __setModuleDefault(result, mod); @@ -57034,231 +72938,231 @@ var require_cacheHttpClient = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; + var __asyncValues2 = exports && exports.__asyncValues || function(o2) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m3 = o2[Symbol.asyncIterator], i2; + return m3 ? m3.call(o2) : (o2 = typeof __values === "function" ? __values(o2) : o2[Symbol.iterator](), i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { + return this; + }, i2); + function verb(n2) { + i2[n2] = o2[n2] && function(v2) { + return new Promise(function(resolve2, reject) { + v2 = o2[n2](v2), settle(resolve2, reject, v2.done, v2.value); + }); + }; + } + function settle(resolve2, reject, d2, v2) { + Promise.resolve(v2).then(function(v6) { + resolve2({ value: v6, done: d2 }); + }, reject); + } + }; + var __await2 = exports && exports.__await || function(v2) { + return this instanceof __await2 ? (this.v = v2, this) : new __await2(v2); + }; + var __asyncGenerator2 = exports && exports.__asyncGenerator || function(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var g2 = generator.apply(thisArg, _arguments || []), i2, q2 = []; + return i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { + return this; + }, i2; + function verb(n2) { + if (g2[n2]) + i2[n2] = function(v2) { + return new Promise(function(a2, b2) { + q2.push([n2, v2, a2, b2]) > 1 || resume(n2, v2); + }); + }; + } + function resume(n2, v2) { + try { + step(g2[n2](v2)); + } catch (e2) { + settle(q2[0][3], e2); + } + } + function step(r2) { + r2.value instanceof __await2 ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q2[0][2], r2); + } + function fulfill(value) { + resume("next", value); + } + function reject(value) { + resume("throw", value); + } + function settle(f2, v2) { + if (f2(v2), q2.shift(), q2.length) + resume(q2[0][0], q2[0][1]); + } + }; Object.defineProperty(exports, "__esModule", { value: true }); - exports.saveCache = exports.reserveCache = exports.downloadCache = exports.getCacheEntry = exports.getCacheVersion = void 0; + exports.DefaultGlobber = void 0; var core2 = __importStar(require_core()); - var http_client_1 = require_lib(); - var auth_1 = require_auth(); - var crypto5 = __importStar(__require("crypto")); var fs3 = __importStar(__require("fs")); - var url_1 = __require("url"); - var utils = __importStar(require_cacheUtils()); - var downloadUtils_1 = require_downloadUtils(); - var options_1 = require_options(); - var requestUtils_1 = require_requestUtils(); - var versionSalt = "1.0"; - function getCacheApiUrl(resource) { - const baseUrl = process.env["ACTIONS_CACHE_URL"] || ""; - if (!baseUrl) { - throw new Error("Cache Service Url not found, unable to restore cache."); + var globOptionsHelper = __importStar(require_internal_glob_options_helper2()); + var path14 = __importStar(__require("path")); + var patternHelper = __importStar(require_internal_pattern_helper2()); + var internal_match_kind_1 = require_internal_match_kind2(); + var internal_pattern_1 = require_internal_pattern2(); + var internal_search_state_1 = require_internal_search_state2(); + var IS_WINDOWS = process.platform === "win32"; + var DefaultGlobber = class _DefaultGlobber { + constructor(options) { + this.patterns = []; + this.searchPaths = []; + this.options = globOptionsHelper.getOptions(options); } - const url2 = `${baseUrl}_apis/artifactcache/${resource}`; - core2.debug(`Resource Url: ${url2}`); - return url2; - } - function createAcceptHeader(type3, apiVersion) { - return `${type3};api-version=${apiVersion}`; - } - function getRequestOptions() { - const requestOptions = { - headers: { - Accept: createAcceptHeader("application/json", "6.0-preview.1") - } - }; - return requestOptions; - } - function createHttpClient() { - const token = process.env["ACTIONS_RUNTIME_TOKEN"] || ""; - const bearerCredentialHandler = new auth_1.BearerCredentialHandler(token); - return new http_client_1.HttpClient("actions/cache", [bearerCredentialHandler], getRequestOptions()); - } - function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { - const components = paths; - if (compressionMethod) { - components.push(compressionMethod); + getSearchPaths() { + return this.searchPaths.slice(); } - if (process.platform === "win32" && !enableCrossOsArchive) { - components.push("windows-only"); + glob() { + var e_1, _a2; + return __awaiter(this, void 0, void 0, function* () { + const result = []; + try { + for (var _b2 = __asyncValues2(this.globGenerator()), _c2; _c2 = yield _b2.next(), !_c2.done; ) { + const itemPath = _c2.value; + result.push(itemPath); + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (_c2 && !_c2.done && (_a2 = _b2.return)) + yield _a2.call(_b2); + } finally { + if (e_1) + throw e_1.error; + } + } + return result; + }); } - components.push(versionSalt); - return crypto5.createHash("sha256").update(components.join("|")).digest("hex"); - } - exports.getCacheVersion = getCacheVersion; - function getCacheEntry(keys, paths, options) { - return __awaiter(this, void 0, void 0, function* () { - const httpClient = createHttpClient(); - const version4 = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive); - const resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version4}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter(this, void 0, void 0, function* () { - return httpClient.getJson(getCacheApiUrl(resource)); - })); - if (response.statusCode === 204) { - if (core2.isDebug()) { - yield printCachesListForDiagnostics(keys[0], httpClient, version4); + globGenerator() { + return __asyncGenerator2(this, arguments, function* globGenerator_1() { + const options = globOptionsHelper.getOptions(this.options); + const patterns = []; + for (const pattern of this.patterns) { + patterns.push(pattern); + if (options.implicitDescendants && (pattern.trailingSeparator || pattern.segments[pattern.segments.length - 1] !== "**")) { + patterns.push(new internal_pattern_1.Pattern(pattern.negate, true, pattern.segments.concat("**"))); + } } - return null; - } - if (!(0, requestUtils_1.isSuccessStatusCode)(response.statusCode)) { - throw new Error(`Cache service responded with ${response.statusCode}`); - } - const cacheResult = response.result; - const cacheDownloadUrl = cacheResult === null || cacheResult === void 0 ? void 0 : cacheResult.archiveLocation; - if (!cacheDownloadUrl) { - throw new Error("Cache not found."); - } - core2.setSecret(cacheDownloadUrl); - core2.debug(`Cache Result:`); - core2.debug(JSON.stringify(cacheResult)); - return cacheResult; - }); - } - exports.getCacheEntry = getCacheEntry; - function printCachesListForDiagnostics(key, httpClient, version4) { - return __awaiter(this, void 0, void 0, function* () { - const resource = `caches?key=${encodeURIComponent(key)}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter(this, void 0, void 0, function* () { - return httpClient.getJson(getCacheApiUrl(resource)); - })); - if (response.statusCode === 200) { - const cacheListResult = response.result; - const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount; - if (totalCount && totalCount > 0) { - core2.debug(`No matching cache found for cache key '${key}', version '${version4} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key -Other caches with similar key:`); - for (const cacheEntry of (cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.artifactCaches) || []) { - core2.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core2.debug(`Search path '${searchPath}'`); + try { + yield __await2(fs3.promises.lstat(searchPath)); + } catch (err) { + if (err.code === "ENOENT") { + continue; + } + throw err; } + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); } - } - }); - } - function downloadCache(archiveLocation, archivePath, options) { - return __awaiter(this, void 0, void 0, function* () { - const archiveUrl = new url_1.URL(archiveLocation); - const downloadOptions = (0, options_1.getDownloadOptions)(options); - if (archiveUrl.hostname.endsWith(".blob.core.windows.net")) { - if (downloadOptions.useAzureSdk) { - yield (0, downloadUtils_1.downloadCacheStorageSDK)(archiveLocation, archivePath, downloadOptions); - } else if (downloadOptions.concurrentBlobDownloads) { - yield (0, downloadUtils_1.downloadCacheHttpClientConcurrent)(archiveLocation, archivePath, downloadOptions); + const traversalChain = []; + while (stack.length) { + const item = stack.pop(); + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !partialMatch) { + continue; + } + const stats = yield __await2( + _DefaultGlobber.stat(item, options, traversalChain) + // Broken symlink, or symlink cycle detected, or no longer exists + ); + if (!stats) { + continue; + } + if (stats.isDirectory()) { + if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { + yield yield __await2(item.path); + } else if (!partialMatch) { + continue; + } + const childLevel = item.level + 1; + const childItems = (yield __await2(fs3.promises.readdir(item.path))).map((x2) => new internal_search_state_1.SearchState(path14.join(item.path, x2), childLevel)); + stack.push(...childItems.reverse()); + } else if (match & internal_match_kind_1.MatchKind.File) { + yield yield __await2(item.path); + } + } + }); + } + /** + * Constructs a DefaultGlobber + */ + static create(patterns, options) { + return __awaiter(this, void 0, void 0, function* () { + const result = new _DefaultGlobber(options); + if (IS_WINDOWS) { + patterns = patterns.replace(/\r\n/g, "\n"); + patterns = patterns.replace(/\r/g, "\n"); + } + const lines = patterns.split("\n").map((x2) => x2.trim()); + for (const line of lines) { + if (!line || line.startsWith("#")) { + continue; + } else { + result.patterns.push(new internal_pattern_1.Pattern(line)); + } + } + result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns)); + return result; + }); + } + static stat(item, options, traversalChain) { + return __awaiter(this, void 0, void 0, function* () { + let stats; + if (options.followSymbolicLinks) { + try { + stats = yield fs3.promises.stat(item.path); + } catch (err) { + if (err.code === "ENOENT") { + if (options.omitBrokenSymbolicLinks) { + core2.debug(`Broken symlink '${item.path}'`); + return void 0; + } + throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); + } + throw err; + } } else { - yield (0, downloadUtils_1.downloadCacheHttpClient)(archiveLocation, archivePath); + stats = yield fs3.promises.lstat(item.path); } - } else { - yield (0, downloadUtils_1.downloadCacheHttpClient)(archiveLocation, archivePath); - } - }); - } - exports.downloadCache = downloadCache; - function reserveCache(key, paths, options) { - return __awaiter(this, void 0, void 0, function* () { - const httpClient = createHttpClient(); - const version4 = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive); - const reserveCacheRequest = { - key, - version: version4, - cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize - }; - const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter(this, void 0, void 0, function* () { - return httpClient.postJson(getCacheApiUrl("caches"), reserveCacheRequest); - })); - return response; - }); - } - exports.reserveCache = reserveCache; - function getContentRange(start, end) { - return `bytes ${start}-${end}/*`; - } - function uploadChunk(httpClient, resourceUrl, openStream, start, end) { - return __awaiter(this, void 0, void 0, function* () { - core2.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); - const additionalHeaders = { - "Content-Type": "application/octet-stream", - "Content-Range": getContentRange(start, end) - }; - const uploadChunkResponse = yield (0, requestUtils_1.retryHttpClientResponse)(`uploadChunk (start: ${start}, end: ${end})`, () => __awaiter(this, void 0, void 0, function* () { - return httpClient.sendStream("PATCH", resourceUrl, openStream(), additionalHeaders); - })); - if (!(0, requestUtils_1.isSuccessStatusCode)(uploadChunkResponse.message.statusCode)) { - throw new Error(`Cache service responded with ${uploadChunkResponse.message.statusCode} during upload chunk.`); - } - }); - } - function uploadFile(httpClient, cacheId, archivePath, options) { - return __awaiter(this, void 0, void 0, function* () { - const fileSize = utils.getArchiveFileSizeInBytes(archivePath); - const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); - const fd = fs3.openSync(archivePath, "r"); - const uploadOptions = (0, options_1.getUploadOptions)(options); - const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); - const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); - const parallelUploads = [...new Array(concurrency).keys()]; - core2.debug("Awaiting all uploads"); - let offset = 0; - try { - yield Promise.all(parallelUploads.map(() => __awaiter(this, void 0, void 0, function* () { - while (offset < fileSize) { - const chunkSize = Math.min(fileSize - offset, maxChunkSize); - const start = offset; - const end = offset + chunkSize - 1; - offset += maxChunkSize; - yield uploadChunk(httpClient, resourceUrl, () => fs3.createReadStream(archivePath, { - fd, - start, - end, - autoClose: false - }).on("error", (error) => { - throw new Error(`Cache upload failed because file read failed with ${error.message}`); - }), start, end); + if (stats.isDirectory() && options.followSymbolicLinks) { + const realPath = yield fs3.promises.realpath(item.path); + while (traversalChain.length >= item.level) { + traversalChain.pop(); } - }))); - } finally { - fs3.closeSync(fd); - } - return; - }); - } - function commitCache(httpClient, cacheId, filesize) { - return __awaiter(this, void 0, void 0, function* () { - const commitCacheRequest = { size: filesize }; - return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter(this, void 0, void 0, function* () { - return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest); - })); - }); - } - function saveCache3(cacheId, archivePath, options) { - return __awaiter(this, void 0, void 0, function* () { - const httpClient = createHttpClient(); - core2.debug("Upload cache"); - yield uploadFile(httpClient, cacheId, archivePath, options); - core2.debug("Commiting cache"); - const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); - core2.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); - const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize); - if (!(0, requestUtils_1.isSuccessStatusCode)(commitCacheResponse.statusCode)) { - throw new Error(`Cache service responded with ${commitCacheResponse.statusCode} during commit cache.`); - } - core2.info("Cache saved successfully"); - }); - } - exports.saveCache = saveCache3; + if (traversalChain.some((x2) => x2 === realPath)) { + core2.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return void 0; + } + traversalChain.push(realPath); + } + return stats; + }); + } + }; + exports.DefaultGlobber = DefaultGlobber; } }); -// node_modules/@actions/cache/lib/internal/tar.js -var require_tar = __commonJS({ - "node_modules/@actions/cache/lib/internal/tar.js"(exports) { +// node_modules/@actions/glob/lib/internal-hash-files.js +var require_internal_hash_files = __commonJS({ + "node_modules/@actions/glob/lib/internal-hash-files.js"(exports) { "use strict"; var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { if (k22 === void 0) k22 = k2; - var desc = Object.getOwnPropertyDescriptor(m3, k2); - if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m3[k2]; - } }; - } - Object.defineProperty(o2, k22, desc); + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); } : function(o2, m3, k2, k22) { if (k22 === void 0) k22 = k2; @@ -57275,7 +73179,7 @@ var require_tar = __commonJS({ var result = {}; if (mod != null) { for (var k2 in mod) - if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) + if (k2 !== "default" && Object.hasOwnProperty.call(mod, k2)) __createBinding(result, mod, k2); } __setModuleDefault(result, mod); @@ -57308,227 +73212,93 @@ var require_tar = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; + var __asyncValues2 = exports && exports.__asyncValues || function(o2) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m3 = o2[Symbol.asyncIterator], i2; + return m3 ? m3.call(o2) : (o2 = typeof __values === "function" ? __values(o2) : o2[Symbol.iterator](), i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { + return this; + }, i2); + function verb(n2) { + i2[n2] = o2[n2] && function(v2) { + return new Promise(function(resolve2, reject) { + v2 = o2[n2](v2), settle(resolve2, reject, v2.done, v2.value); + }); + }; + } + function settle(resolve2, reject, d2, v2) { + Promise.resolve(v2).then(function(v6) { + resolve2({ value: v6, done: d2 }); + }, reject); + } + }; Object.defineProperty(exports, "__esModule", { value: true }); - exports.createTar = exports.extractTar = exports.listTar = void 0; - var exec_1 = require_exec(); - var io2 = __importStar(require_io()); - var fs_1 = __require("fs"); - var path15 = __importStar(__require("path")); - var utils = __importStar(require_cacheUtils()); - var constants_1 = require_constants2(); - var IS_WINDOWS = process.platform === "win32"; - function getTarPath() { + exports.hashFiles = void 0; + var crypto5 = __importStar(__require("crypto")); + var core2 = __importStar(require_core()); + var fs3 = __importStar(__require("fs")); + var stream = __importStar(__require("stream")); + var util3 = __importStar(__require("util")); + var path14 = __importStar(__require("path")); + function hashFiles(globber, currentWorkspace, verbose = false) { + var e_1, _a2; + var _b2; return __awaiter(this, void 0, void 0, function* () { - switch (process.platform) { - case "win32": { - const gnuTar = yield utils.getGnuTarPathOnWindows(); - const systemTar = constants_1.SystemTarPathOnWindows; - if (gnuTar) { - return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; - } else if ((0, fs_1.existsSync)(systemTar)) { - return { path: systemTar, type: constants_1.ArchiveToolType.BSD }; + const writeDelegate = verbose ? core2.info : core2.debug; + let hasMatch = false; + const githubWorkspace = currentWorkspace ? currentWorkspace : (_b2 = process.env["GITHUB_WORKSPACE"]) !== null && _b2 !== void 0 ? _b2 : process.cwd(); + const result = crypto5.createHash("sha256"); + let count = 0; + try { + for (var _c2 = __asyncValues2(globber.globGenerator()), _d2; _d2 = yield _c2.next(), !_d2.done; ) { + const file = _d2.value; + writeDelegate(file); + if (!file.startsWith(`${githubWorkspace}${path14.sep}`)) { + writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); + continue; } - break; - } - case "darwin": { - const gnuTar = yield io2.which("gtar", false); - if (gnuTar) { - return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; - } else { - return { - path: yield io2.which("tar", true), - type: constants_1.ArchiveToolType.BSD - }; + if (fs3.statSync(file).isDirectory()) { + writeDelegate(`Skip directory '${file}'.`); + continue; + } + const hash = crypto5.createHash("sha256"); + const pipeline = util3.promisify(stream.pipeline); + yield pipeline(fs3.createReadStream(file), hash); + result.write(hash.digest()); + count++; + if (!hasMatch) { + hasMatch = true; } } - default: - break; - } - return { - path: yield io2.which("tar", true), - type: constants_1.ArchiveToolType.GNU - }; - }); - } - function getTarArgs(tarPath, compressionMethod, type3, archivePath = "") { - return __awaiter(this, void 0, void 0, function* () { - const args = [`"${tarPath.path}"`]; - const cacheFileName = utils.getCacheFileName(compressionMethod); - const tarFile = "cache.tar"; - const workingDirectory = getWorkingDirectory(); - const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; - switch (type3) { - case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path15.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path15.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path15.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); - break; - case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path15.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path15.sep}`, "g"), "/")); - break; - case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path15.sep}`, "g"), "/"), "-P"); - break; - } - if (tarPath.type === constants_1.ArchiveToolType.GNU) { - switch (process.platform) { - case "win32": - args.push("--force-local"); - break; - case "darwin": - args.push("--delay-directory-restore"); - break; + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (_d2 && !_d2.done && (_a2 = _c2.return)) + yield _a2.call(_c2); + } finally { + if (e_1) + throw e_1.error; } } - return args; - }); - } - function getCommands(compressionMethod, type3, archivePath = "") { - return __awaiter(this, void 0, void 0, function* () { - let args; - const tarPath = yield getTarPath(); - const tarArgs = yield getTarArgs(tarPath, compressionMethod, type3, archivePath); - const compressionArgs = type3 !== "create" ? yield getDecompressionProgram(tarPath, compressionMethod, archivePath) : yield getCompressionProgram(tarPath, compressionMethod); - const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; - if (BSD_TAR_ZSTD && type3 !== "create") { - args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; + result.end(); + if (hasMatch) { + writeDelegate(`Found ${count} files to hash.`); + return result.digest("hex"); } else { - args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; - } - if (BSD_TAR_ZSTD) { - return args; - } - return [args.join(" ")]; - }); - } - function getWorkingDirectory() { - var _a2; - return (_a2 = process.env["GITHUB_WORKSPACE"]) !== null && _a2 !== void 0 ? _a2 : process.cwd(); - } - function getDecompressionProgram(tarPath, compressionMethod, archivePath) { - return __awaiter(this, void 0, void 0, function* () { - const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; - switch (compressionMethod) { - case constants_1.CompressionMethod.Zstd: - return BSD_TAR_ZSTD ? [ - "zstd -d --long=30 --force -o", - constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path15.sep}`, "g"), "/") - ] : [ - "--use-compress-program", - IS_WINDOWS ? '"zstd -d --long=30"' : "unzstd --long=30" - ]; - case constants_1.CompressionMethod.ZstdWithoutLong: - return BSD_TAR_ZSTD ? [ - "zstd -d --force -o", - constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path15.sep}`, "g"), "/") - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; - default: - return ["-z"]; - } - }); - } - function getCompressionProgram(tarPath, compressionMethod) { - return __awaiter(this, void 0, void 0, function* () { - const cacheFileName = utils.getCacheFileName(compressionMethod); - const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; - switch (compressionMethod) { - case constants_1.CompressionMethod.Zstd: - return BSD_TAR_ZSTD ? [ - "zstd -T0 --long=30 --force -o", - cacheFileName.replace(new RegExp(`\\${path15.sep}`, "g"), "/"), - constants_1.TarFilename - ] : [ - "--use-compress-program", - IS_WINDOWS ? '"zstd -T0 --long=30"' : "zstdmt --long=30" - ]; - case constants_1.CompressionMethod.ZstdWithoutLong: - return BSD_TAR_ZSTD ? [ - "zstd -T0 --force -o", - cacheFileName.replace(new RegExp(`\\${path15.sep}`, "g"), "/"), - constants_1.TarFilename - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; - default: - return ["-z"]; - } - }); - } - function execCommands(commands, cwd) { - return __awaiter(this, void 0, void 0, function* () { - for (const command of commands) { - try { - yield (0, exec_1.exec)(command, void 0, { - cwd, - env: Object.assign(Object.assign({}, process.env), { MSYS: "winsymlinks:nativestrict" }) - }); - } catch (error) { - throw new Error(`${command.split(" ")[0]} failed with error: ${error === null || error === void 0 ? void 0 : error.message}`); - } + writeDelegate(`No matches found for glob`); + return ""; } }); } - function listTar(archivePath, compressionMethod) { - return __awaiter(this, void 0, void 0, function* () { - const commands = yield getCommands(compressionMethod, "list", archivePath); - yield execCommands(commands); - }); - } - exports.listTar = listTar; - function extractTar2(archivePath, compressionMethod) { - return __awaiter(this, void 0, void 0, function* () { - const workingDirectory = getWorkingDirectory(); - yield io2.mkdirP(workingDirectory); - const commands = yield getCommands(compressionMethod, "extract", archivePath); - yield execCommands(commands); - }); - } - exports.extractTar = extractTar2; - function createTar(archiveFolder, sourceDirectories, compressionMethod) { - return __awaiter(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path15.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); - const commands = yield getCommands(compressionMethod, "create"); - yield execCommands(commands, archiveFolder); - }); - } - exports.createTar = createTar; + exports.hashFiles = hashFiles; } }); -// node_modules/@actions/cache/lib/cache.js -var require_cache = __commonJS({ - "node_modules/@actions/cache/lib/cache.js"(exports) { +// node_modules/@actions/glob/lib/glob.js +var require_glob2 = __commonJS({ + "node_modules/@actions/glob/lib/glob.js"(exports) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - var desc = Object.getOwnPropertyDescriptor(m3, k2); - if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m3[k2]; - } }; - } - Object.defineProperty(o2, k22, desc); - } : function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - o2[k22] = m3[k2]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v2) { - Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); - } : function(o2, v2) { - o2["default"] = v2; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k2 in mod) - if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) - __createBinding(result, mod, k2); - } - __setModuleDefault(result, mod); - return result; - }; var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) { function adopt(value) { return value instanceof P2 ? value : new P2(function(resolve2) { @@ -57557,164 +73327,26 @@ var require_cache = __commonJS({ }); }; Object.defineProperty(exports, "__esModule", { value: true }); - exports.saveCache = exports.restoreCache = exports.isFeatureAvailable = exports.ReserveCacheError = exports.ValidationError = void 0; - var core2 = __importStar(require_core()); - var path15 = __importStar(__require("path")); - var utils = __importStar(require_cacheUtils()); - var cacheHttpClient = __importStar(require_cacheHttpClient()); - var tar_1 = require_tar(); - var ValidationError = class _ValidationError extends Error { - constructor(message) { - super(message); - this.name = "ValidationError"; - Object.setPrototypeOf(this, _ValidationError.prototype); - } - }; - exports.ValidationError = ValidationError; - var ReserveCacheError2 = class _ReserveCacheError extends Error { - constructor(message) { - super(message); - this.name = "ReserveCacheError"; - Object.setPrototypeOf(this, _ReserveCacheError.prototype); - } - }; - exports.ReserveCacheError = ReserveCacheError2; - function checkPaths(paths) { - if (!paths || paths.length === 0) { - throw new ValidationError(`Path Validation Error: At least one directory or file path is required`); - } - } - function checkKey(key) { - if (key.length > 512) { - throw new ValidationError(`Key Validation Error: ${key} cannot be larger than 512 characters.`); - } - const regex = /^[^,]*$/; - if (!regex.test(key)) { - throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`); - } - } - function isFeatureAvailable() { - return !!process.env["ACTIONS_CACHE_URL"]; - } - exports.isFeatureAvailable = isFeatureAvailable; - function restoreCache3(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { + exports.hashFiles = exports.create = void 0; + var internal_globber_1 = require_internal_globber2(); + var internal_hash_files_1 = require_internal_hash_files(); + function create(patterns, options) { return __awaiter(this, void 0, void 0, function* () { - checkPaths(paths); - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core2.debug("Resolved Keys:"); - core2.debug(JSON.stringify(keys)); - if (keys.length > 10) { - throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); - } - for (const key of keys) { - checkKey(key); - } - const compressionMethod = yield utils.getCompressionMethod(); - let archivePath = ""; - try { - const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { - compressionMethod, - enableCrossOsArchive - }); - if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { - return void 0; - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core2.info("Lookup only - skipping download"); - return cacheEntry.cacheKey; - } - archivePath = path15.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core2.debug(`Archive Path: ${archivePath}`); - yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); - if (core2.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core2.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core2.info("Cache restored successfully"); - return cacheEntry.cacheKey; - } catch (error) { - const typedError = error; - if (typedError.name === ValidationError.name) { - throw error; - } else { - core2.warning(`Failed to restore: ${error.message}`); - } - } finally { - try { - yield utils.unlinkFile(archivePath); - } catch (error) { - core2.debug(`Failed to delete archive: ${error}`); - } - } - return void 0; + return yield internal_globber_1.DefaultGlobber.create(patterns, options); }); } - exports.restoreCache = restoreCache3; - function saveCache3(paths, key, options, enableCrossOsArchive = false) { - var _a2, _b, _c, _d, _e2; + exports.create = create; + function hashFiles(patterns, currentWorkspace = "", options, verbose = false) { return __awaiter(this, void 0, void 0, function* () { - checkPaths(paths); - checkKey(key); - const compressionMethod = yield utils.getCompressionMethod(); - let cacheId = -1; - const cachePaths = yield utils.resolvePaths(paths); - core2.debug("Cache Paths:"); - core2.debug(`${JSON.stringify(cachePaths)}`); - if (cachePaths.length === 0) { - throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); - } - const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path15.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core2.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core2.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const fileSizeLimit = 10 * 1024 * 1024 * 1024; - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core2.debug(`File Size: ${archiveFileSize}`); - if (archiveFileSize > fileSizeLimit && !utils.isGhes()) { - throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); - } - core2.debug("Reserving Cache"); - const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { - compressionMethod, - enableCrossOsArchive, - cacheSize: archiveFileSize - }); - if ((_a2 = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a2 === void 0 ? void 0 : _a2.cacheId) { - cacheId = (_b = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _b === void 0 ? void 0 : _b.cacheId; - } else if ((reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.statusCode) === 400) { - throw new Error((_d = (_c = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : `Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the data cap limit, not saving cache.`); - } else { - throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e2 = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e2 === void 0 ? void 0 : _e2.message}`); - } - core2.debug(`Saving Cache (ID: ${cacheId})`); - yield cacheHttpClient.saveCache(cacheId, archivePath, options); - } catch (error) { - const typedError = error; - if (typedError.name === ValidationError.name) { - throw error; - } else if (typedError.name === ReserveCacheError2.name) { - core2.info(`Failed to save: ${typedError.message}`); - } else { - core2.warning(`Failed to save: ${typedError.message}`); - } - } finally { - try { - yield utils.unlinkFile(archivePath); - } catch (error) { - core2.debug(`Failed to delete archive: ${error}`); - } + let followSymbolicLinks = true; + if (options && typeof options.followSymbolicLinks === "boolean") { + followSymbolicLinks = options.followSymbolicLinks; } - return cacheId; + const globber = yield create(patterns, { followSymbolicLinks }); + return internal_hash_files_1.hashFiles(globber, currentWorkspace, verbose); }); } - exports.saveCache = saveCache3; + exports.hashFiles = hashFiles; } }); @@ -58034,7 +73666,7 @@ var require_tool_cache = __commonJS({ var fs3 = __importStar(__require("fs")); var mm = __importStar(require_manifest()); var os3 = __importStar(__require("os")); - var path15 = __importStar(__require("path")); + var path14 = __importStar(__require("path")); var httpm = __importStar(require_lib()); var semver2 = __importStar(require_semver2()); var stream = __importStar(__require("stream")); @@ -58056,8 +73688,8 @@ var require_tool_cache = __commonJS({ var userAgent = "actions/tool-cache"; function downloadTool2(url2, dest, auth, headers) { return __awaiter(this, void 0, void 0, function* () { - dest = dest || path15.join(_getTempDirectory(), v4_1.default()); - yield io2.mkdirP(path15.dirname(dest)); + dest = dest || path14.join(_getTempDirectory(), v4_1.default()); + yield io2.mkdirP(path14.dirname(dest)); core2.debug(`Downloading ${url2}`); core2.debug(`Destination ${dest}`); const maxAttempts = 3; @@ -58144,7 +73776,7 @@ var require_tool_cache = __commonJS({ process.chdir(originalCwd); } } else { - const escapedScript = path15.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); + const escapedScript = path14.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ""); const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, ""); const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`; @@ -58320,7 +73952,7 @@ var require_tool_cache = __commonJS({ } const destPath = yield _createToolPath(tool, version4, arch3); for (const itemName of fs3.readdirSync(sourceDir)) { - const s2 = path15.join(sourceDir, itemName); + const s2 = path14.join(sourceDir, itemName); yield io2.cp(s2, destPath, { recursive: true }); } _completeToolPath(tool, version4, arch3); @@ -58338,7 +73970,7 @@ var require_tool_cache = __commonJS({ throw new Error("sourceFile is not a file"); } const destFolder = yield _createToolPath(tool, version4, arch3); - const destPath = path15.join(destFolder, targetFile); + const destPath = path14.join(destFolder, targetFile); core2.debug(`destination file ${destPath}`); yield io2.cp(sourceFile, destPath); _completeToolPath(tool, version4, arch3); @@ -58362,7 +73994,7 @@ var require_tool_cache = __commonJS({ let toolPath = ""; if (versionSpec) { versionSpec = semver2.clean(versionSpec) || ""; - const cachePath = path15.join(_getCacheDirectory(), toolName, versionSpec, arch3); + const cachePath = path14.join(_getCacheDirectory(), toolName, versionSpec, arch3); core2.debug(`checking cache: ${cachePath}`); if (fs3.existsSync(cachePath) && fs3.existsSync(`${cachePath}.complete`)) { core2.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch3}`); @@ -58377,12 +74009,12 @@ var require_tool_cache = __commonJS({ function findAllVersions(toolName, arch3) { const versions = []; arch3 = arch3 || os3.arch(); - const toolPath = path15.join(_getCacheDirectory(), toolName); + const toolPath = path14.join(_getCacheDirectory(), toolName); if (fs3.existsSync(toolPath)) { const children2 = fs3.readdirSync(toolPath); for (const child of children2) { if (isExplicitVersion(child)) { - const fullPath = path15.join(toolPath, child, arch3 || ""); + const fullPath = path14.join(toolPath, child, arch3 || ""); if (fs3.existsSync(fullPath) && fs3.existsSync(`${fullPath}.complete`)) { versions.push(child); } @@ -58437,7 +74069,7 @@ var require_tool_cache = __commonJS({ function _createExtractFolder(dest) { return __awaiter(this, void 0, void 0, function* () { if (!dest) { - dest = path15.join(_getTempDirectory(), v4_1.default()); + dest = path14.join(_getTempDirectory(), v4_1.default()); } yield io2.mkdirP(dest); return dest; @@ -58445,7 +74077,7 @@ var require_tool_cache = __commonJS({ } function _createToolPath(tool, version4, arch3) { return __awaiter(this, void 0, void 0, function* () { - const folderPath = path15.join(_getCacheDirectory(), tool, semver2.clean(version4) || version4, arch3 || ""); + const folderPath = path14.join(_getCacheDirectory(), tool, semver2.clean(version4) || version4, arch3 || ""); core2.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io2.rmRF(folderPath); @@ -58455,7 +74087,7 @@ var require_tool_cache = __commonJS({ }); } function _completeToolPath(tool, version4, arch3) { - const folderPath = path15.join(_getCacheDirectory(), tool, semver2.clean(version4) || version4, arch3 || ""); + const folderPath = path14.join(_getCacheDirectory(), tool, semver2.clean(version4) || version4, arch3 || ""); const markerPath = `${folderPath}.complete`; fs3.writeFileSync(markerPath, ""); core2.debug("finished caching tool"); @@ -58551,6 +74183,10 @@ var require_deline = __commonJS({ } }); +// src/globals.ts +import { setDefaultResultOrder } from "node:dns"; +import { setDefaultAutoSelectFamily } from "node:net"; + // node_modules/@abraham/reflection/dist/index.js var Metadata = /* @__PURE__ */ new WeakMap(); function decorateProperty(decorators2, target, propertyKey, descriptor) { @@ -61132,6 +76768,10 @@ if (Symbol3) { } var descriptor; +// src/globals.ts +setDefaultResultOrder("ipv4first"); +setDefaultAutoSelectFamily(false); + // src/action/run/index.ts var import_core7 = __toESM(require_core(), 1); @@ -61139,12 +76779,784 @@ var import_core7 = __toESM(require_core(), 1); var import_core6 = __toESM(require_core(), 1); // src/action/cache.ts -var import_cache2 = __toESM(require_cache(), 1); +var import_cache2 = __toESM(require_cache2(), 1); var import_core2 = __toESM(require_core(), 1); -init_esm5(); import { createHash, randomUUID } from "node:crypto"; import { arch as arch2, platform } from "node:os"; -import { env as env2 } from "node:process"; +import { env } from "node:process"; + +// node_modules/class-transformer/esm5/enums/transformation-type.enum.js +var TransformationType; +(function(TransformationType2) { + TransformationType2[TransformationType2["PLAIN_TO_CLASS"] = 0] = "PLAIN_TO_CLASS"; + TransformationType2[TransformationType2["CLASS_TO_PLAIN"] = 1] = "CLASS_TO_PLAIN"; + TransformationType2[TransformationType2["CLASS_TO_CLASS"] = 2] = "CLASS_TO_CLASS"; +})(TransformationType || (TransformationType = {})); + +// node_modules/class-transformer/esm5/MetadataStorage.js +var MetadataStorage = ( + /** @class */ + function() { + function MetadataStorage2() { + this._typeMetadatas = /* @__PURE__ */ new Map(); + this._transformMetadatas = /* @__PURE__ */ new Map(); + this._exposeMetadatas = /* @__PURE__ */ new Map(); + this._excludeMetadatas = /* @__PURE__ */ new Map(); + this._ancestorsMap = /* @__PURE__ */ new Map(); + } + MetadataStorage2.prototype.addTypeMetadata = function(metadata3) { + if (!this._typeMetadatas.has(metadata3.target)) { + this._typeMetadatas.set(metadata3.target, /* @__PURE__ */ new Map()); + } + this._typeMetadatas.get(metadata3.target).set(metadata3.propertyName, metadata3); + }; + MetadataStorage2.prototype.addTransformMetadata = function(metadata3) { + if (!this._transformMetadatas.has(metadata3.target)) { + this._transformMetadatas.set(metadata3.target, /* @__PURE__ */ new Map()); + } + if (!this._transformMetadatas.get(metadata3.target).has(metadata3.propertyName)) { + this._transformMetadatas.get(metadata3.target).set(metadata3.propertyName, []); + } + this._transformMetadatas.get(metadata3.target).get(metadata3.propertyName).push(metadata3); + }; + MetadataStorage2.prototype.addExposeMetadata = function(metadata3) { + if (!this._exposeMetadatas.has(metadata3.target)) { + this._exposeMetadatas.set(metadata3.target, /* @__PURE__ */ new Map()); + } + this._exposeMetadatas.get(metadata3.target).set(metadata3.propertyName, metadata3); + }; + MetadataStorage2.prototype.addExcludeMetadata = function(metadata3) { + if (!this._excludeMetadatas.has(metadata3.target)) { + this._excludeMetadatas.set(metadata3.target, /* @__PURE__ */ new Map()); + } + this._excludeMetadatas.get(metadata3.target).set(metadata3.propertyName, metadata3); + }; + MetadataStorage2.prototype.findTransformMetadatas = function(target, propertyName, transformationType) { + return this.findMetadatas(this._transformMetadatas, target, propertyName).filter(function(metadata3) { + if (!metadata3.options) + return true; + if (metadata3.options.toClassOnly === true && metadata3.options.toPlainOnly === true) + return true; + if (metadata3.options.toClassOnly === true) { + return transformationType === TransformationType.CLASS_TO_CLASS || transformationType === TransformationType.PLAIN_TO_CLASS; + } + if (metadata3.options.toPlainOnly === true) { + return transformationType === TransformationType.CLASS_TO_PLAIN; + } + return true; + }); + }; + MetadataStorage2.prototype.findExcludeMetadata = function(target, propertyName) { + return this.findMetadata(this._excludeMetadatas, target, propertyName); + }; + MetadataStorage2.prototype.findExposeMetadata = function(target, propertyName) { + return this.findMetadata(this._exposeMetadatas, target, propertyName); + }; + MetadataStorage2.prototype.findExposeMetadataByCustomName = function(target, name2) { + return this.getExposedMetadatas(target).find(function(metadata3) { + return metadata3.options && metadata3.options.name === name2; + }); + }; + MetadataStorage2.prototype.findTypeMetadata = function(target, propertyName) { + return this.findMetadata(this._typeMetadatas, target, propertyName); + }; + MetadataStorage2.prototype.getStrategy = function(target) { + var excludeMap = this._excludeMetadatas.get(target); + var exclude = excludeMap && excludeMap.get(void 0); + var exposeMap = this._exposeMetadatas.get(target); + var expose = exposeMap && exposeMap.get(void 0); + if (exclude && expose || !exclude && !expose) + return "none"; + return exclude ? "excludeAll" : "exposeAll"; + }; + MetadataStorage2.prototype.getExposedMetadatas = function(target) { + return this.getMetadata(this._exposeMetadatas, target); + }; + MetadataStorage2.prototype.getExcludedMetadatas = function(target) { + return this.getMetadata(this._excludeMetadatas, target); + }; + MetadataStorage2.prototype.getExposedProperties = function(target, transformationType) { + return this.getExposedMetadatas(target).filter(function(metadata3) { + if (!metadata3.options) + return true; + if (metadata3.options.toClassOnly === true && metadata3.options.toPlainOnly === true) + return true; + if (metadata3.options.toClassOnly === true) { + return transformationType === TransformationType.CLASS_TO_CLASS || transformationType === TransformationType.PLAIN_TO_CLASS; + } + if (metadata3.options.toPlainOnly === true) { + return transformationType === TransformationType.CLASS_TO_PLAIN; + } + return true; + }).map(function(metadata3) { + return metadata3.propertyName; + }); + }; + MetadataStorage2.prototype.getExcludedProperties = function(target, transformationType) { + return this.getExcludedMetadatas(target).filter(function(metadata3) { + if (!metadata3.options) + return true; + if (metadata3.options.toClassOnly === true && metadata3.options.toPlainOnly === true) + return true; + if (metadata3.options.toClassOnly === true) { + return transformationType === TransformationType.CLASS_TO_CLASS || transformationType === TransformationType.PLAIN_TO_CLASS; + } + if (metadata3.options.toPlainOnly === true) { + return transformationType === TransformationType.CLASS_TO_PLAIN; + } + return true; + }).map(function(metadata3) { + return metadata3.propertyName; + }); + }; + MetadataStorage2.prototype.clear = function() { + this._typeMetadatas.clear(); + this._exposeMetadatas.clear(); + this._excludeMetadatas.clear(); + this._ancestorsMap.clear(); + }; + MetadataStorage2.prototype.getMetadata = function(metadatas, target) { + var metadataFromTargetMap = metadatas.get(target); + var metadataFromTarget; + if (metadataFromTargetMap) { + metadataFromTarget = Array.from(metadataFromTargetMap.values()).filter(function(meta) { + return meta.propertyName !== void 0; + }); + } + var metadataFromAncestors = []; + for (var _i = 0, _a2 = this.getAncestors(target); _i < _a2.length; _i++) { + var ancestor = _a2[_i]; + var ancestorMetadataMap = metadatas.get(ancestor); + if (ancestorMetadataMap) { + var metadataFromAncestor = Array.from(ancestorMetadataMap.values()).filter(function(meta) { + return meta.propertyName !== void 0; + }); + metadataFromAncestors.push.apply(metadataFromAncestors, metadataFromAncestor); + } + } + return metadataFromAncestors.concat(metadataFromTarget || []); + }; + MetadataStorage2.prototype.findMetadata = function(metadatas, target, propertyName) { + var metadataFromTargetMap = metadatas.get(target); + if (metadataFromTargetMap) { + var metadataFromTarget = metadataFromTargetMap.get(propertyName); + if (metadataFromTarget) { + return metadataFromTarget; + } + } + for (var _i = 0, _a2 = this.getAncestors(target); _i < _a2.length; _i++) { + var ancestor = _a2[_i]; + var ancestorMetadataMap = metadatas.get(ancestor); + if (ancestorMetadataMap) { + var ancestorResult = ancestorMetadataMap.get(propertyName); + if (ancestorResult) { + return ancestorResult; + } + } + } + return void 0; + }; + MetadataStorage2.prototype.findMetadatas = function(metadatas, target, propertyName) { + var metadataFromTargetMap = metadatas.get(target); + var metadataFromTarget; + if (metadataFromTargetMap) { + metadataFromTarget = metadataFromTargetMap.get(propertyName); + } + var metadataFromAncestorsTarget = []; + for (var _i = 0, _a2 = this.getAncestors(target); _i < _a2.length; _i++) { + var ancestor = _a2[_i]; + var ancestorMetadataMap = metadatas.get(ancestor); + if (ancestorMetadataMap) { + if (ancestorMetadataMap.has(propertyName)) { + metadataFromAncestorsTarget.push.apply(metadataFromAncestorsTarget, ancestorMetadataMap.get(propertyName)); + } + } + } + return metadataFromAncestorsTarget.slice().reverse().concat((metadataFromTarget || []).slice().reverse()); + }; + MetadataStorage2.prototype.getAncestors = function(target) { + if (!target) + return []; + if (!this._ancestorsMap.has(target)) { + var ancestors = []; + for (var baseClass = Object.getPrototypeOf(target.prototype.constructor); typeof baseClass.prototype !== "undefined"; baseClass = Object.getPrototypeOf(baseClass.prototype.constructor)) { + ancestors.push(baseClass); + } + this._ancestorsMap.set(target, ancestors); + } + return this._ancestorsMap.get(target); + }; + return MetadataStorage2; + }() +); + +// node_modules/class-transformer/esm5/storage.js +var defaultMetadataStorage = new MetadataStorage(); + +// node_modules/class-transformer/esm5/utils/get-global.util.js +function getGlobal2() { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof global !== "undefined") { + return global; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof self !== "undefined") { + return self; + } +} + +// node_modules/class-transformer/esm5/utils/is-promise.util.js +function isPromise(p2) { + return p2 !== null && typeof p2 === "object" && typeof p2.then === "function"; +} + +// node_modules/class-transformer/esm5/TransformOperationExecutor.js +var __spreadArray5 = function(to2, from, pack) { + if (pack || arguments.length === 2) + for (var i2 = 0, l2 = from.length, ar2; i2 < l2; i2++) { + if (ar2 || !(i2 in from)) { + if (!ar2) + ar2 = Array.prototype.slice.call(from, 0, i2); + ar2[i2] = from[i2]; + } + } + return to2.concat(ar2 || Array.prototype.slice.call(from)); +}; +function instantiateArrayType(arrayType) { + var array = new arrayType(); + if (!(array instanceof Set) && !("push" in array)) { + return []; + } + return array; +} +var TransformOperationExecutor = ( + /** @class */ + function() { + function TransformOperationExecutor2(transformationType, options) { + this.transformationType = transformationType; + this.options = options; + this.recursionStack = /* @__PURE__ */ new Set(); + } + TransformOperationExecutor2.prototype.transform = function(source, value, targetType, arrayType, isMap, level) { + var _this = this; + if (level === void 0) { + level = 0; + } + if (Array.isArray(value) || value instanceof Set) { + var newValue_1 = arrayType && this.transformationType === TransformationType.PLAIN_TO_CLASS ? instantiateArrayType(arrayType) : []; + value.forEach(function(subValue, index) { + var subSource = source ? source[index] : void 0; + if (!_this.options.enableCircularCheck || !_this.isCircular(subValue)) { + var realTargetType = void 0; + if (typeof targetType !== "function" && targetType && targetType.options && targetType.options.discriminator && targetType.options.discriminator.property && targetType.options.discriminator.subTypes) { + if (_this.transformationType === TransformationType.PLAIN_TO_CLASS) { + realTargetType = targetType.options.discriminator.subTypes.find(function(subType) { + return subType.name === subValue[targetType.options.discriminator.property]; + }); + var options = { newObject: newValue_1, object: subValue, property: void 0 }; + var newType = targetType.typeFunction(options); + realTargetType === void 0 ? realTargetType = newType : realTargetType = realTargetType.value; + if (!targetType.options.keepDiscriminatorProperty) + delete subValue[targetType.options.discriminator.property]; + } + if (_this.transformationType === TransformationType.CLASS_TO_CLASS) { + realTargetType = subValue.constructor; + } + if (_this.transformationType === TransformationType.CLASS_TO_PLAIN) { + subValue[targetType.options.discriminator.property] = targetType.options.discriminator.subTypes.find(function(subType) { + return subType.value === subValue.constructor; + }).name; + } + } else { + realTargetType = targetType; + } + var value_1 = _this.transform(subSource, subValue, realTargetType, void 0, subValue instanceof Map, level + 1); + if (newValue_1 instanceof Set) { + newValue_1.add(value_1); + } else { + newValue_1.push(value_1); + } + } else if (_this.transformationType === TransformationType.CLASS_TO_CLASS) { + if (newValue_1 instanceof Set) { + newValue_1.add(subValue); + } else { + newValue_1.push(subValue); + } + } + }); + return newValue_1; + } else if (targetType === String && !isMap) { + if (value === null || value === void 0) + return value; + return String(value); + } else if (targetType === Number && !isMap) { + if (value === null || value === void 0) + return value; + return Number(value); + } else if (targetType === Boolean && !isMap) { + if (value === null || value === void 0) + return value; + return Boolean(value); + } else if ((targetType === Date || value instanceof Date) && !isMap) { + if (value instanceof Date) { + return new Date(value.valueOf()); + } + if (value === null || value === void 0) + return value; + return new Date(value); + } else if (!!getGlobal2().Buffer && (targetType === Buffer || value instanceof Buffer) && !isMap) { + if (value === null || value === void 0) + return value; + return Buffer.from(value); + } else if (isPromise(value) && !isMap) { + return new Promise(function(resolve2, reject) { + value.then(function(data) { + return resolve2(_this.transform(void 0, data, targetType, void 0, void 0, level + 1)); + }, reject); + }); + } else if (!isMap && value !== null && typeof value === "object" && typeof value.then === "function") { + return value; + } else if (typeof value === "object" && value !== null) { + if (!targetType && value.constructor !== Object) + if (!Array.isArray(value) && value.constructor === Array) { + } else { + targetType = value.constructor; + } + if (!targetType && source) + targetType = source.constructor; + if (this.options.enableCircularCheck) { + this.recursionStack.add(value); + } + var keys = this.getKeys(targetType, value, isMap); + var newValue = source ? source : {}; + if (!source && (this.transformationType === TransformationType.PLAIN_TO_CLASS || this.transformationType === TransformationType.CLASS_TO_CLASS)) { + if (isMap) { + newValue = /* @__PURE__ */ new Map(); + } else if (targetType) { + newValue = new targetType(); + } else { + newValue = {}; + } + } + var _loop_1 = function(key2) { + if (key2 === "__proto__" || key2 === "constructor") { + return "continue"; + } + var valueKey = key2; + var newValueKey = key2, propertyName = key2; + if (!this_1.options.ignoreDecorators && targetType) { + if (this_1.transformationType === TransformationType.PLAIN_TO_CLASS) { + var exposeMetadata = defaultMetadataStorage.findExposeMetadataByCustomName(targetType, key2); + if (exposeMetadata) { + propertyName = exposeMetadata.propertyName; + newValueKey = exposeMetadata.propertyName; + } + } else if (this_1.transformationType === TransformationType.CLASS_TO_PLAIN || this_1.transformationType === TransformationType.CLASS_TO_CLASS) { + var exposeMetadata = defaultMetadataStorage.findExposeMetadata(targetType, key2); + if (exposeMetadata && exposeMetadata.options && exposeMetadata.options.name) { + newValueKey = exposeMetadata.options.name; + } + } + } + var subValue = void 0; + if (this_1.transformationType === TransformationType.PLAIN_TO_CLASS) { + subValue = value[valueKey]; + } else { + if (value instanceof Map) { + subValue = value.get(valueKey); + } else if (value[valueKey] instanceof Function) { + subValue = value[valueKey](); + } else { + subValue = value[valueKey]; + } + } + var type3 = void 0, isSubValueMap = subValue instanceof Map; + if (targetType && isMap) { + type3 = targetType; + } else if (targetType) { + var metadata_1 = defaultMetadataStorage.findTypeMetadata(targetType, propertyName); + if (metadata_1) { + var options = { newObject: newValue, object: value, property: propertyName }; + var newType = metadata_1.typeFunction ? metadata_1.typeFunction(options) : metadata_1.reflectedType; + if (metadata_1.options && metadata_1.options.discriminator && metadata_1.options.discriminator.property && metadata_1.options.discriminator.subTypes) { + if (!(value[valueKey] instanceof Array)) { + if (this_1.transformationType === TransformationType.PLAIN_TO_CLASS) { + type3 = metadata_1.options.discriminator.subTypes.find(function(subType) { + if (subValue && subValue instanceof Object && metadata_1.options.discriminator.property in subValue) { + return subType.name === subValue[metadata_1.options.discriminator.property]; + } + }); + type3 === void 0 ? type3 = newType : type3 = type3.value; + if (!metadata_1.options.keepDiscriminatorProperty) { + if (subValue && subValue instanceof Object && metadata_1.options.discriminator.property in subValue) { + delete subValue[metadata_1.options.discriminator.property]; + } + } + } + if (this_1.transformationType === TransformationType.CLASS_TO_CLASS) { + type3 = subValue.constructor; + } + if (this_1.transformationType === TransformationType.CLASS_TO_PLAIN) { + if (subValue) { + subValue[metadata_1.options.discriminator.property] = metadata_1.options.discriminator.subTypes.find(function(subType) { + return subType.value === subValue.constructor; + }).name; + } + } + } else { + type3 = metadata_1; + } + } else { + type3 = newType; + } + isSubValueMap = isSubValueMap || metadata_1.reflectedType === Map; + } else if (this_1.options.targetMaps) { + this_1.options.targetMaps.filter(function(map) { + return map.target === targetType && !!map.properties[propertyName]; + }).forEach(function(map) { + return type3 = map.properties[propertyName]; + }); + } else if (this_1.options.enableImplicitConversion && this_1.transformationType === TransformationType.PLAIN_TO_CLASS) { + var reflectedType = Reflect.getMetadata("design:type", targetType.prototype, propertyName); + if (reflectedType) { + type3 = reflectedType; + } + } + } + var arrayType_1 = Array.isArray(value[valueKey]) ? this_1.getReflectedType(targetType, propertyName) : void 0; + var subSource = source ? source[valueKey] : void 0; + if (newValue.constructor.prototype) { + var descriptor = Object.getOwnPropertyDescriptor(newValue.constructor.prototype, newValueKey); + if ((this_1.transformationType === TransformationType.PLAIN_TO_CLASS || this_1.transformationType === TransformationType.CLASS_TO_CLASS) && // eslint-disable-next-line @typescript-eslint/unbound-method + (descriptor && !descriptor.set || newValue[newValueKey] instanceof Function)) + return "continue"; + } + if (!this_1.options.enableCircularCheck || !this_1.isCircular(subValue)) { + var transformKey = this_1.transformationType === TransformationType.PLAIN_TO_CLASS ? newValueKey : key2; + var finalValue = void 0; + if (this_1.transformationType === TransformationType.CLASS_TO_PLAIN) { + finalValue = value[transformKey]; + finalValue = this_1.applyCustomTransformations(finalValue, targetType, transformKey, value, this_1.transformationType); + finalValue = value[transformKey] === finalValue ? subValue : finalValue; + finalValue = this_1.transform(subSource, finalValue, type3, arrayType_1, isSubValueMap, level + 1); + } else { + if (subValue === void 0 && this_1.options.exposeDefaultValues) { + finalValue = newValue[newValueKey]; + } else { + finalValue = this_1.transform(subSource, subValue, type3, arrayType_1, isSubValueMap, level + 1); + finalValue = this_1.applyCustomTransformations(finalValue, targetType, transformKey, value, this_1.transformationType); + } + } + if (finalValue !== void 0 || this_1.options.exposeUnsetFields) { + if (newValue instanceof Map) { + newValue.set(newValueKey, finalValue); + } else { + newValue[newValueKey] = finalValue; + } + } + } else if (this_1.transformationType === TransformationType.CLASS_TO_CLASS) { + var finalValue = subValue; + finalValue = this_1.applyCustomTransformations(finalValue, targetType, key2, value, this_1.transformationType); + if (finalValue !== void 0 || this_1.options.exposeUnsetFields) { + if (newValue instanceof Map) { + newValue.set(newValueKey, finalValue); + } else { + newValue[newValueKey] = finalValue; + } + } + } + }; + var this_1 = this; + for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { + var key = keys_1[_i]; + _loop_1(key); + } + if (this.options.enableCircularCheck) { + this.recursionStack.delete(value); + } + return newValue; + } else { + return value; + } + }; + TransformOperationExecutor2.prototype.applyCustomTransformations = function(value, target, key, obj, transformationType) { + var _this = this; + var metadatas = defaultMetadataStorage.findTransformMetadatas(target, key, this.transformationType); + if (this.options.version !== void 0) { + metadatas = metadatas.filter(function(metadata3) { + if (!metadata3.options) + return true; + return _this.checkVersion(metadata3.options.since, metadata3.options.until); + }); + } + if (this.options.groups && this.options.groups.length) { + metadatas = metadatas.filter(function(metadata3) { + if (!metadata3.options) + return true; + return _this.checkGroups(metadata3.options.groups); + }); + } else { + metadatas = metadatas.filter(function(metadata3) { + return !metadata3.options || !metadata3.options.groups || !metadata3.options.groups.length; + }); + } + metadatas.forEach(function(metadata3) { + value = metadata3.transformFn({ value, key, obj, type: transformationType, options: _this.options }); + }); + return value; + }; + TransformOperationExecutor2.prototype.isCircular = function(object) { + return this.recursionStack.has(object); + }; + TransformOperationExecutor2.prototype.getReflectedType = function(target, propertyName) { + if (!target) + return void 0; + var meta = defaultMetadataStorage.findTypeMetadata(target, propertyName); + return meta ? meta.reflectedType : void 0; + }; + TransformOperationExecutor2.prototype.getKeys = function(target, object, isMap) { + var _this = this; + var strategy = defaultMetadataStorage.getStrategy(target); + if (strategy === "none") + strategy = this.options.strategy || "exposeAll"; + var keys = []; + if (strategy === "exposeAll" || isMap) { + if (object instanceof Map) { + keys = Array.from(object.keys()); + } else { + keys = Object.keys(object); + } + } + if (isMap) { + return keys; + } + if (this.options.ignoreDecorators && this.options.excludeExtraneousValues && target) { + var exposedProperties = defaultMetadataStorage.getExposedProperties(target, this.transformationType); + var excludedProperties = defaultMetadataStorage.getExcludedProperties(target, this.transformationType); + keys = __spreadArray5(__spreadArray5([], exposedProperties, true), excludedProperties, true); + } + if (!this.options.ignoreDecorators && target) { + var exposedProperties = defaultMetadataStorage.getExposedProperties(target, this.transformationType); + if (this.transformationType === TransformationType.PLAIN_TO_CLASS) { + exposedProperties = exposedProperties.map(function(key) { + var exposeMetadata = defaultMetadataStorage.findExposeMetadata(target, key); + if (exposeMetadata && exposeMetadata.options && exposeMetadata.options.name) { + return exposeMetadata.options.name; + } + return key; + }); + } + if (this.options.excludeExtraneousValues) { + keys = exposedProperties; + } else { + keys = keys.concat(exposedProperties); + } + var excludedProperties_1 = defaultMetadataStorage.getExcludedProperties(target, this.transformationType); + if (excludedProperties_1.length > 0) { + keys = keys.filter(function(key) { + return !excludedProperties_1.includes(key); + }); + } + if (this.options.version !== void 0) { + keys = keys.filter(function(key) { + var exposeMetadata = defaultMetadataStorage.findExposeMetadata(target, key); + if (!exposeMetadata || !exposeMetadata.options) + return true; + return _this.checkVersion(exposeMetadata.options.since, exposeMetadata.options.until); + }); + } + if (this.options.groups && this.options.groups.length) { + keys = keys.filter(function(key) { + var exposeMetadata = defaultMetadataStorage.findExposeMetadata(target, key); + if (!exposeMetadata || !exposeMetadata.options) + return true; + return _this.checkGroups(exposeMetadata.options.groups); + }); + } else { + keys = keys.filter(function(key) { + var exposeMetadata = defaultMetadataStorage.findExposeMetadata(target, key); + return !exposeMetadata || !exposeMetadata.options || !exposeMetadata.options.groups || !exposeMetadata.options.groups.length; + }); + } + } + if (this.options.excludePrefixes && this.options.excludePrefixes.length) { + keys = keys.filter(function(key) { + return _this.options.excludePrefixes.every(function(prefix2) { + return key.substr(0, prefix2.length) !== prefix2; + }); + }); + } + keys = keys.filter(function(key, index, self2) { + return self2.indexOf(key) === index; + }); + return keys; + }; + TransformOperationExecutor2.prototype.checkVersion = function(since, until) { + var decision = true; + if (decision && since) + decision = this.options.version >= since; + if (decision && until) + decision = this.options.version < until; + return decision; + }; + TransformOperationExecutor2.prototype.checkGroups = function(groups) { + if (!groups) + return true; + return this.options.groups.some(function(optionGroup) { + return groups.includes(optionGroup); + }); + }; + return TransformOperationExecutor2; + }() +); + +// node_modules/class-transformer/esm5/constants/default-options.constant.js +var defaultOptions = { + enableCircularCheck: false, + enableImplicitConversion: false, + excludeExtraneousValues: false, + excludePrefixes: void 0, + exposeDefaultValues: false, + exposeUnsetFields: true, + groups: void 0, + ignoreDecorators: false, + strategy: void 0, + targetMaps: void 0, + version: void 0 +}; + +// node_modules/class-transformer/esm5/ClassTransformer.js +var __assign = function() { + __assign = Object.assign || function(t2) { + for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { + s2 = arguments[i2]; + for (var p2 in s2) + if (Object.prototype.hasOwnProperty.call(s2, p2)) + t2[p2] = s2[p2]; + } + return t2; + }; + return __assign.apply(this, arguments); +}; +var ClassTransformer = ( + /** @class */ + function() { + function ClassTransformer2() { + } + ClassTransformer2.prototype.instanceToPlain = function(object, options) { + var executor = new TransformOperationExecutor(TransformationType.CLASS_TO_PLAIN, __assign(__assign({}, defaultOptions), options)); + return executor.transform(void 0, object, void 0, void 0, void 0, void 0); + }; + ClassTransformer2.prototype.classToPlainFromExist = function(object, plainObject, options) { + var executor = new TransformOperationExecutor(TransformationType.CLASS_TO_PLAIN, __assign(__assign({}, defaultOptions), options)); + return executor.transform(plainObject, object, void 0, void 0, void 0, void 0); + }; + ClassTransformer2.prototype.plainToInstance = function(cls, plain, options) { + var executor = new TransformOperationExecutor(TransformationType.PLAIN_TO_CLASS, __assign(__assign({}, defaultOptions), options)); + return executor.transform(void 0, plain, cls, void 0, void 0, void 0); + }; + ClassTransformer2.prototype.plainToClassFromExist = function(clsObject, plain, options) { + var executor = new TransformOperationExecutor(TransformationType.PLAIN_TO_CLASS, __assign(__assign({}, defaultOptions), options)); + return executor.transform(clsObject, plain, void 0, void 0, void 0, void 0); + }; + ClassTransformer2.prototype.instanceToInstance = function(object, options) { + var executor = new TransformOperationExecutor(TransformationType.CLASS_TO_CLASS, __assign(__assign({}, defaultOptions), options)); + return executor.transform(void 0, object, void 0, void 0, void 0, void 0); + }; + ClassTransformer2.prototype.classToClassFromExist = function(object, fromObject, options) { + var executor = new TransformOperationExecutor(TransformationType.CLASS_TO_CLASS, __assign(__assign({}, defaultOptions), options)); + return executor.transform(fromObject, object, void 0, void 0, void 0, void 0); + }; + ClassTransformer2.prototype.serialize = function(object, options) { + return JSON.stringify(this.instanceToPlain(object, options)); + }; + ClassTransformer2.prototype.deserialize = function(cls, json, options) { + var jsonObject = JSON.parse(json); + return this.plainToInstance(cls, jsonObject, options); + }; + ClassTransformer2.prototype.deserializeArray = function(cls, json, options) { + var jsonObject = JSON.parse(json); + return this.plainToInstance(cls, jsonObject, options); + }; + return ClassTransformer2; + }() +); + +// node_modules/class-transformer/esm5/decorators/exclude.decorator.js +function Exclude(options) { + if (options === void 0) { + options = {}; + } + return function(object, propertyName) { + defaultMetadataStorage.addExcludeMetadata({ + target: object instanceof Function ? object : object.constructor, + propertyName, + options + }); + }; +} + +// node_modules/class-transformer/esm5/decorators/expose.decorator.js +function Expose(options) { + if (options === void 0) { + options = {}; + } + return function(object, propertyName) { + defaultMetadataStorage.addExposeMetadata({ + target: object instanceof Function ? object : object.constructor, + propertyName, + options + }); + }; +} + +// node_modules/class-transformer/esm5/decorators/transform.decorator.js +function Transform2(transformFn, options) { + if (options === void 0) { + options = {}; + } + return function(target, propertyName) { + defaultMetadataStorage.addTransformMetadata({ + target: target.constructor, + propertyName, + transformFn, + options + }); + }; +} + +// node_modules/class-transformer/esm5/decorators/type.decorator.js +function Type(typeFunction, options) { + if (options === void 0) { + options = {}; + } + return function(target, propertyName) { + var reflectedType = Reflect.getMetadata("design:type", target, propertyName); + defaultMetadataStorage.addTypeMetadata({ + target: target.constructor, + propertyName, + reflectedType, + typeFunction, + options + }); + }; +} + +// node_modules/class-transformer/esm5/index.js +var classTransformer = new ClassTransformer(); +function instanceToPlain(object, options) { + return classTransformer.instanceToPlain(object, options); +} +function plainToInstance(cls, plain, options) { + return classTransformer.plainToInstance(cls, plain, options); +} +function instanceToInstance(object, options) { + return classTransformer.instanceToInstance(object, options); +} // node_modules/unctx/dist/index.mjs function createContext(opts = {}) { @@ -61243,10 +77655,65 @@ var defaultNamespace = _globalThis2[globalKey] || (_globalThis2[globalKey] = cre var asyncHandlersKey = "__unctx_async_handlers__"; var asyncHandlers = _globalThis2[asyncHandlersKey] || (_globalThis2[asyncHandlersKey] = /* @__PURE__ */ new Set()); +// node_modules/scule/dist/index.mjs +var NUMBER_CHAR_RE = /\d/; +var STR_SPLITTERS = ["-", "_", "/", "."]; +function isUppercase(char = "") { + if (NUMBER_CHAR_RE.test(char)) { + return void 0; + } + return char.toUpperCase() === char; +} +function splitByCase(string_, separators) { + const splitters = separators ?? STR_SPLITTERS; + const parts = []; + if (!string_ || typeof string_ !== "string") { + return parts; + } + let buff = ""; + let previousUpper; + let previousSplitter; + for (const char of string_) { + const isSplitter = splitters.includes(char); + if (isSplitter === true) { + parts.push(buff); + buff = ""; + previousUpper = void 0; + continue; + } + const isUpper = isUppercase(char); + if (previousSplitter === false) { + if (previousUpper === false && isUpper === true) { + parts.push(buff); + buff = char; + previousUpper = isUpper; + continue; + } + if (previousUpper === true && isUpper === false && buff.length > 1) { + const lastChar = buff[buff.length - 1]; + parts.push(buff.slice(0, Math.max(0, buff.length - 1))); + buff = lastChar + char; + previousUpper = isUpper; + continue; + } + } + buff += char; + previousUpper = isUpper; + previousSplitter = isSplitter; + } + parts.push(buff); + return parts; +} +function kebabCase(string_, joiner) { + return !string_ ? "" : (Array.isArray(string_) ? string_ : splitByCase(string_)).map((p2) => p2.toLowerCase()).join(joiner ?? "-"); +} +function snakeCase(string_) { + return kebabCase(string_, "_"); +} + // src/action/id.ts -init_dist(); -var name = "setup-texlive"; -var ID = { +var name = "setup-texlive-action"; +var id_default = { "kebab-case": name, SCREAMING_SNAKE_CASE: toUpperCase(snakeCase(name)) }; @@ -61264,6 +77731,7 @@ var LogLevel = { warn: 40, fatal: 60 }; +var notify = setLogFn("info", core.notice); var debug2 = setLogFn("debug", core.debug); var info2 = setLogFn("info", core.info); var warn = setLogFn("warn", core.warning); @@ -61301,7 +77769,7 @@ function notes(err, depth = inspectOptions.depth) { notes(err.cause, depth - 1); } const desc = Object.getOwnPropertyDescriptor(err, "note"); - if ((desc == null ? void 0 : desc.enumerable) === true && typeof desc.value === "string") { + if (desc?.enumerable === true && typeof desc.value === "string") { core.notice(desc.value); } } @@ -61316,7 +77784,8 @@ var CacheService = class extends CacheInfo { return !this.enabled; } [Symbol.dispose]() { - (0, import_core2.setOutput)("cache-hit", this.restored); + (0, import_core2.setOutput)("cache-hit", this.hit); + (0, import_core2.setOutput)("cache-restored", this.restored); } }; ((CacheService2) => { @@ -61324,7 +77793,7 @@ var CacheService = class extends CacheInfo { ({ use: CacheService2.use } = ctx); function setup(entry, config) { let service; - if ((config == null ? void 0 : config.enable) ?? true) { + if (config?.enable ?? true) { if ((0, import_cache2.isFeatureAvailable)()) { service = new ActionsCacheService(entry); } else { @@ -61356,22 +77825,46 @@ var ActionsCacheService = class extends CacheService { __publicField(this, "target"); __privateAdd(this, _keys, void 0); __privateAdd(this, _matchedKey, void 0); - __privateAdd(this, _forceUpdate, void 0); + __privateAdd(this, _forceUpdate, false); this.target = entry.TEXDIR; __privateSet(this, _keys, new CacheKeys(entry)); - __privateSet(this, _forceUpdate, (env2[`${ID.SCREAMING_SNAKE_CASE}_FORCE_UPDATE_CACHE`] ?? "0") !== "0"); + const envvars = [ + `${id_default.SCREAMING_SNAKE_CASE}_FORCE_UPDATE_CACHE`, + "SETUP_TEXLIVE_FORCE_UPDATE_CACHE" + ]; + for (const envvar of envvars) { + if (envvar in env) { + __privateSet(this, _forceUpdate, env[envvar] !== "0"); + if (envvar === envvars[1]) { + notify( + "`%s` is deprecated; Use `%s` instead", + envvar, + envvars[0] + ); + } + break; + } + } } async restore() { try { __privateSet(this, _matchedKey, await (0, import_cache2.restoreCache)( [this.target], __privateGet(this, _keys).uniqueKey, - __privateGet(this, _keys).restoreKeys + [ + __privateGet(this, _keys).primaryKey, + __privateGet(this, _keys).oldPrimaryKey, + __privateGet(this, _keys).secondaryKey, + __privateGet(this, _keys).oldSecondaryKey + ] )); if (__privateGet(this, _matchedKey) === void 0) { info2("Cache not found"); } else { info2("%s restored from cache with key: %s", this.target, this.key); + if (__privateGet(this, _matchedKey).startsWith(__privateGet(this, _keys).oldPrimaryKey)) { + this.update(); + } } } catch (error) { warn({ error }, "Failed to restore cache"); @@ -61382,8 +77875,15 @@ var ActionsCacheService = class extends CacheService { __privateSet(this, _forceUpdate, true); } get hit() { - var _a2; - return ((_a2 = __privateGet(this, _matchedKey)) == null ? void 0 : _a2.startsWith(__privateGet(this, _keys).primaryKey)) ?? false; + for (const primaryKey of [ + __privateGet(this, _keys).primaryKey, + __privateGet(this, _keys).oldPrimaryKey + ]) { + if (__privateGet(this, _matchedKey)?.startsWith(primaryKey) ?? false) { + return true; + } + } + return false; } get restored() { return __privateGet(this, _matchedKey) !== void 0; @@ -61471,10 +77971,13 @@ var CacheKeys = class { return `${this.secondaryKey}${this.#digest}`; } get secondaryKey() { - return `${ID["kebab-case"]}-${this.#distribution}-`; + return `${id_default["kebab-case"]}-${this.#distribution}-`; + } + get oldPrimaryKey() { + return `${this.oldSecondaryKey}${this.#digest}`; } - get restoreKeys() { - return [this.primaryKey, this.secondaryKey]; + get oldSecondaryKey() { + return `setup-texlive-${this.#distribution}-`; } }; function digest(obj) { @@ -61485,13 +77988,13 @@ function randomString() { } // src/action/config.ts +var import_glob = __toESM(require_glob2(), 1); import { readFile as readFile4 } from "node:fs/promises"; import { platform as platform5 } from "node:os"; // src/action/env.ts -import { homedir, tmpdir } from "node:os"; -import path3 from "node:path"; -import { env as env3 } from "node:process"; +import { tmpdir } from "node:os"; +import { env as env2 } from "node:process"; // src/tex/texmf.ts var Texmf; @@ -61509,396 +78012,85 @@ var Texmf; ]; })(Texmf || (Texmf = {})); -// src/texlive/install-tl/texmf.ts -init_esm5(); -import path2 from "node:path"; - -// node_modules/ts-mixer/dist/esm/index.js -var copyProps = (dest, src, exclude = []) => { - const props = Object.getOwnPropertyDescriptors(src); - for (let prop of exclude) - delete props[prop]; - Object.defineProperties(dest, props); -}; -var protoChain = (obj, currentChain = [obj]) => { - const proto = Object.getPrototypeOf(obj); - if (proto === null) - return currentChain; - return protoChain(proto, [...currentChain, proto]); -}; -var nearestCommonProto = (...objs) => { - if (objs.length === 0) - return void 0; - let commonProto = void 0; - const protoChains = objs.map((obj) => protoChain(obj)); - while (protoChains.every((protoChain2) => protoChain2.length > 0)) { - const protos = protoChains.map((protoChain2) => protoChain2.pop()); - const potentialCommonProto = protos[0]; - if (protos.every((proto) => proto === potentialCommonProto)) - commonProto = potentialCommonProto; - else - break; +// src/action/env.ts +function init() { + if (!("RUNNER_TEMP" in env2)) { + warn("`RUNNER_TEMP` not defined, %s will be used instead", tmpdir()); + env2["RUNNER_TEMP"] = tmpdir(); } - return commonProto; -}; -var hardMixProtos = (ingredients, constructor, exclude = []) => { - var _a2; - const base = (_a2 = nearestCommonProto(...ingredients)) !== null && _a2 !== void 0 ? _a2 : Object.prototype; - const mixedProto = Object.create(base); - const visitedProtos = protoChain(base); - for (let prototype of ingredients) { - let protos = protoChain(prototype); - for (let i2 = protos.length - 1; i2 >= 0; i2--) { - let newProto = protos[i2]; - if (visitedProtos.indexOf(newProto) === -1) { - copyProps(mixedProto, newProto, ["constructor", ...exclude]); - visitedProtos.push(newProto); - } + env2["TMPDIR"] = env2.RUNNER_TEMP; + env2.TEXLIVE_INSTALL_ENV_NOCHECK ??= "1"; + env2.TEXLIVE_INSTALL_NO_WELCOME ??= "1"; + for (const tree of Texmf.SYSTEM_TREES) { + const key = `TEXLIVE_INSTALL_${tree}`; + if (tree !== "TEXMFLOCAL" && key in env2) { + warn("`%s` is set, but ignored", key); + delete env2[key]; } } - mixedProto.constructor = constructor; - return mixedProto; -}; -var unique = (arr) => arr.filter((e2, i2) => arr.indexOf(e2) == i2); -var getIngredientWithProp = (prop, ingredients) => { - const protoChains = ingredients.map((ingredient) => protoChain(ingredient)); - let protoDepth = 0; - let protosAreLeftToSearch = true; - while (protosAreLeftToSearch) { - protosAreLeftToSearch = false; - for (let i2 = ingredients.length - 1; i2 >= 0; i2--) { - const searchTarget = protoChains[i2][protoDepth]; - if (searchTarget !== void 0 && searchTarget !== null) { - protosAreLeftToSearch = true; - if (Object.getOwnPropertyDescriptor(searchTarget, prop) != void 0) { - return protoChains[i2][0]; - } +} + +// src/action/inputs.ts +var import_core3 = __toESM(require_core(), 1); +import path2 from "node:path"; +import { env as env4 } from "node:process"; + +// src/util/decorators.ts +import path from "node:path"; +import { env as env3 } from "node:process"; +function Exception(constructor) { + const name2 = constructor.name; + Object.defineProperties(constructor.prototype, { + name: { + value: name2 + }, + [Symbol.toStringTag]: { + get: function() { + return this.name; } - } - protoDepth++; - } - return void 0; -}; -var proxyMix = (ingredients, prototype = Object.prototype) => new Proxy({}, { - getPrototypeOf() { - return prototype; - }, - setPrototypeOf() { - throw Error("Cannot set prototype of Proxies created by ts-mixer"); - }, - getOwnPropertyDescriptor(_2, prop) { - return Object.getOwnPropertyDescriptor(getIngredientWithProp(prop, ingredients) || {}, prop); - }, - defineProperty() { - throw new Error("Cannot define new properties on Proxies created by ts-mixer"); - }, - has(_2, prop) { - return getIngredientWithProp(prop, ingredients) !== void 0 || prototype[prop] !== void 0; - }, - get(_2, prop) { - return (getIngredientWithProp(prop, ingredients) || prototype)[prop]; - }, - set(_2, prop, val) { - const ingredientWithProp = getIngredientWithProp(prop, ingredients); - if (ingredientWithProp === void 0) - throw new Error("Cannot set new properties on Proxies created by ts-mixer"); - ingredientWithProp[prop] = val; - return true; - }, - deleteProperty() { - throw new Error("Cannot delete properties on Proxies created by ts-mixer"); - }, - ownKeys() { - return ingredients.map(Object.getOwnPropertyNames).reduce((prev, curr) => curr.concat(prev.filter((key) => curr.indexOf(key) < 0))); - } -}); -var softMixProtos = (ingredients, constructor) => proxyMix([...ingredients, { constructor }]); -var settings = { - initFunction: null, - staticsStrategy: "copy", - prototypeStrategy: "copy", - decoratorInheritance: "deep" -}; -var mixins = /* @__PURE__ */ new Map(); -var getMixinsForClass = (clazz) => mixins.get(clazz); -var registerMixins = (mixedClass, constituents) => mixins.set(mixedClass, constituents); -var mergeObjectsOfDecorators = (o1, o2) => { - var _a2, _b; - const allKeys = unique([...Object.getOwnPropertyNames(o1), ...Object.getOwnPropertyNames(o2)]); - const mergedObject = {}; - for (let key of allKeys) - mergedObject[key] = unique([...(_a2 = o1 === null || o1 === void 0 ? void 0 : o1[key]) !== null && _a2 !== void 0 ? _a2 : [], ...(_b = o2 === null || o2 === void 0 ? void 0 : o2[key]) !== null && _b !== void 0 ? _b : []]); - return mergedObject; -}; -var mergePropertyAndMethodDecorators = (d1, d2) => { - var _a2, _b, _c, _d; - return { - property: mergeObjectsOfDecorators((_a2 = d1 === null || d1 === void 0 ? void 0 : d1.property) !== null && _a2 !== void 0 ? _a2 : {}, (_b = d2 === null || d2 === void 0 ? void 0 : d2.property) !== null && _b !== void 0 ? _b : {}), - method: mergeObjectsOfDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.method) !== null && _c !== void 0 ? _c : {}, (_d = d2 === null || d2 === void 0 ? void 0 : d2.method) !== null && _d !== void 0 ? _d : {}) - }; -}; -var mergeDecorators = (d1, d2) => { - var _a2, _b, _c, _d, _e2, _f; - return { - class: unique([...(_a2 = d1 === null || d1 === void 0 ? void 0 : d1.class) !== null && _a2 !== void 0 ? _a2 : [], ...(_b = d2 === null || d2 === void 0 ? void 0 : d2.class) !== null && _b !== void 0 ? _b : []]), - static: mergePropertyAndMethodDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.static) !== null && _c !== void 0 ? _c : {}, (_d = d2 === null || d2 === void 0 ? void 0 : d2.static) !== null && _d !== void 0 ? _d : {}), - instance: mergePropertyAndMethodDecorators((_e2 = d1 === null || d1 === void 0 ? void 0 : d1.instance) !== null && _e2 !== void 0 ? _e2 : {}, (_f = d2 === null || d2 === void 0 ? void 0 : d2.instance) !== null && _f !== void 0 ? _f : {}) - }; -}; -var decorators = /* @__PURE__ */ new Map(); -var findAllConstituentClasses = (...classes) => { - var _a2; - const allClasses = /* @__PURE__ */ new Set(); - const frontier = /* @__PURE__ */ new Set([...classes]); - while (frontier.size > 0) { - for (let clazz of frontier) { - const protoChainClasses = protoChain(clazz.prototype).map((proto) => proto.constructor); - const mixinClasses = (_a2 = getMixinsForClass(clazz)) !== null && _a2 !== void 0 ? _a2 : []; - const potentiallyNewClasses = [...protoChainClasses, ...mixinClasses]; - const newClasses = potentiallyNewClasses.filter((c2) => !allClasses.has(c2)); - for (let newClass of newClasses) - frontier.add(newClass); - allClasses.add(clazz); - frontier.delete(clazz); - } - } - return [...allClasses]; -}; -var deepDecoratorSearch = (...classes) => { - const decoratorsForClassChain = findAllConstituentClasses(...classes).map((clazz) => decorators.get(clazz)).filter((decorators2) => !!decorators2); - if (decoratorsForClassChain.length == 0) - return {}; - if (decoratorsForClassChain.length == 1) - return decoratorsForClassChain[0]; - return decoratorsForClassChain.reduce((d1, d2) => mergeDecorators(d1, d2)); -}; -var directDecoratorSearch = (...classes) => { - const classDecorators = classes.map((clazz) => getDecoratorsForClass(clazz)); - if (classDecorators.length === 0) - return {}; - if (classDecorators.length === 1) - return classDecorators[0]; - return classDecorators.reduce((d1, d2) => mergeDecorators(d1, d2)); -}; -var getDecoratorsForClass = (clazz) => { - let decoratorsForClass = decorators.get(clazz); - if (!decoratorsForClass) { - decoratorsForClass = {}; - decorators.set(clazz, decoratorsForClass); - } - return decoratorsForClass; -}; -var decorateClass = (decorator) => (clazz) => { - const decoratorsForClass = getDecoratorsForClass(clazz); - let classDecorators = decoratorsForClass.class; - if (!classDecorators) { - classDecorators = []; - decoratorsForClass.class = classDecorators; - } - classDecorators.push(decorator); - return decorator(clazz); -}; -var decorateMember = (decorator) => (object, key, ...otherArgs) => { - var _a2, _b, _c; - const decoratorTargetType = typeof object === "function" ? "static" : "instance"; - const decoratorType = typeof object[key] === "function" ? "method" : "property"; - const clazz = decoratorTargetType === "static" ? object : object.constructor; - const decoratorsForClass = getDecoratorsForClass(clazz); - const decoratorsForTargetType = (_a2 = decoratorsForClass === null || decoratorsForClass === void 0 ? void 0 : decoratorsForClass[decoratorTargetType]) !== null && _a2 !== void 0 ? _a2 : {}; - decoratorsForClass[decoratorTargetType] = decoratorsForTargetType; - let decoratorsForType = (_b = decoratorsForTargetType === null || decoratorsForTargetType === void 0 ? void 0 : decoratorsForTargetType[decoratorType]) !== null && _b !== void 0 ? _b : {}; - decoratorsForTargetType[decoratorType] = decoratorsForType; - let decoratorsForKey = (_c = decoratorsForType === null || decoratorsForType === void 0 ? void 0 : decoratorsForType[key]) !== null && _c !== void 0 ? _c : []; - decoratorsForType[key] = decoratorsForKey; - decoratorsForKey.push(decorator); - return decorator(object, key, ...otherArgs); -}; -var decorate2 = (decorator) => (...args) => { - if (args.length === 1) - return decorateClass(decorator)(args[0]); - return decorateMember(decorator)(...args); -}; -function Mixin(...constructors) { - var _a2, _b, _c; - const prototypes = constructors.map((constructor) => constructor.prototype); - const initFunctionName = settings.initFunction; - if (initFunctionName !== null) { - const initFunctions = prototypes.map((proto) => proto[initFunctionName]).filter((func) => typeof func === "function"); - const combinedInitFunction = function(...args) { - for (let initFunction of initFunctions) - initFunction.apply(this, args); - }; - const extraProto = { [initFunctionName]: combinedInitFunction }; - prototypes.push(extraProto); - } - function MixedClass(...args) { - for (const constructor of constructors) - copyProps(this, new constructor(...args)); - if (initFunctionName !== null && typeof this[initFunctionName] === "function") - this[initFunctionName].apply(this, args); - } - MixedClass.prototype = settings.prototypeStrategy === "copy" ? hardMixProtos(prototypes, MixedClass) : softMixProtos(prototypes, MixedClass); - Object.setPrototypeOf(MixedClass, settings.staticsStrategy === "copy" ? hardMixProtos(constructors, null, ["prototype"]) : proxyMix(constructors, Function.prototype)); - let DecoratedMixedClass = MixedClass; - if (settings.decoratorInheritance !== "none") { - const classDecorators = settings.decoratorInheritance === "deep" ? deepDecoratorSearch(...constructors) : directDecoratorSearch(...constructors); - for (let decorator of (_a2 = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.class) !== null && _a2 !== void 0 ? _a2 : []) { - const result = decorator(DecoratedMixedClass); - if (result) { - DecoratedMixedClass = result; + }, + toJSON: { + value: function() { + return {}; } } - applyPropAndMethodDecorators((_b = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.static) !== null && _b !== void 0 ? _b : {}, DecoratedMixedClass); - applyPropAndMethodDecorators((_c = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.instance) !== null && _c !== void 0 ? _c : {}, DecoratedMixedClass.prototype); - } - registerMixins(DecoratedMixedClass, constructors); - return DecoratedMixedClass; + }); } -var applyPropAndMethodDecorators = (propAndMethodDecorators, target) => { - const propDecorators = propAndMethodDecorators.property; - const methodDecorators = propAndMethodDecorators.method; - if (propDecorators) - for (let key in propDecorators) - for (let decorator of propDecorators[key]) - decorator(target, key); - if (methodDecorators) - for (let key in methodDecorators) - for (let decorator of methodDecorators[key]) - decorator(target, key, Object.getOwnPropertyDescriptor(target, key)); -}; - -// src/texlive/install-tl/texmf.ts -init_decorators2(); -var _withPrefix, withPrefix_fn, _withTexdir, withTexdir_fn; -var SystemTrees = class { - constructor(version4, options) { - this.version = version4; - __privateAdd(this, _withPrefix); - __privateAdd(this, _withTexdir); - if (options.texdir === void 0) { - __privateMethod(this, _withPrefix, withPrefix_fn).call(this, options.prefix); - } - Object.assign(this, instanceToPlain(this)); - if (options.texdir !== void 0) { - __privateMethod(this, _withTexdir, withTexdir_fn).call(this, options.texdir); - } - } - get TEXMFROOT() { - return this.TEXDIR; - } -}; -_withPrefix = new WeakSet(); -withPrefix_fn = function(prefix2) { - this.TEXMFLOCAL = path2.join(prefix2, "texmf-local"); - __privateMethod(this, _withTexdir, withTexdir_fn).call(this, path2.join(prefix2, this.version)); +var CASE = { + kebab: kebabCase, + snake: snakeCase }; -_withTexdir = new WeakSet(); -withTexdir_fn = function(texdir) { - this.TEXDIR = texdir; - this.TEXMFSYSCONFIG = path2.join(texdir, "texmf-config"); - this.TEXMFSYSVAR = path2.join(texdir, "texmf-var"); - this.TEXMFLOCAL ??= path2.join(texdir, "texmf-local"); -}; -__decorateClass([ - decorate2(Expose()) -], SystemTrees.prototype, "TEXDIR", 2); -__decorateClass([ - decorate2(Expose()), - FromEnv("TEXLIVE_INSTALL_TEXMFLOCAL"), - AsPath -], SystemTrees.prototype, "TEXMFLOCAL", 2); -__decorateClass([ - decorate2(Expose()), - FromEnv("TEXLIVE_INSTALL_TEXMFSYSCONFIG"), - AsPath -], SystemTrees.prototype, "TEXMFSYSCONFIG", 2); -__decorateClass([ - decorate2(Expose()), - FromEnv("TEXLIVE_INSTALL_TEXMFSYSVAR"), - AsPath -], SystemTrees.prototype, "TEXMFSYSVAR", 2); -SystemTrees = __decorateClass([ - Exclude() -], SystemTrees); -var _withTexuserdir, withTexuserdir_fn, _withSystemTrees, withSystemTrees_fn; -var UserTrees = class { - constructor(version4, options) { - this.version = version4; - __privateAdd(this, _withTexuserdir); - __privateAdd(this, _withSystemTrees); - if (options.texuserdir !== void 0) { - __privateMethod(this, _withTexuserdir, withTexuserdir_fn).call(this, options.texuserdir); +function Case(letterCase) { + function decorator(target, key) { + const metadatas = defaultMetadataStorage.getExposedMetadatas( + target instanceof Function ? target : target.constructor + ); + if (key !== void 0) { + const name2 = CASE[letterCase](key); + const metadata3 = metadatas.find((data) => data.propertyName === key); + if (metadata3 === void 0) { + Expose({ name: name2 })(target, key); + } else { + metadata3.options.name = name2; + } } else { - __privateMethod(this, _withSystemTrees, withSystemTrees_fn).call(this, options); - Object.assign(this, instanceToPlain(this)); - } - } -}; -_withTexuserdir = new WeakSet(); -withTexuserdir_fn = function(texuserdir) { - this.TEXMFHOME = path2.join(texuserdir, "texmf"); - this.TEXMFCONFIG = path2.join(texuserdir, "texmf-config"); - this.TEXMFVAR = path2.join(texuserdir, "texmf-var"); -}; -_withSystemTrees = new WeakSet(); -withSystemTrees_fn = function(options) { - const trees = new SystemTrees(this.version, options); - this.TEXMFHOME = trees.TEXMFLOCAL; - this.TEXMFCONFIG = trees.TEXMFSYSCONFIG; - this.TEXMFVAR = trees.TEXMFSYSVAR; -}; -__decorateClass([ - decorate2(Expose()), - FromEnv("TEXLIVE_INSTALL_TEXMFHOME"), - AsPath -], UserTrees.prototype, "TEXMFHOME", 2); -__decorateClass([ - decorate2(Expose()), - FromEnv("TEXLIVE_INSTALL_TEXMFCONFIG"), - AsPath -], UserTrees.prototype, "TEXMFCONFIG", 2); -__decorateClass([ - decorate2(Expose()), - FromEnv("TEXLIVE_INSTALL_TEXMFVAR"), - AsPath -], UserTrees.prototype, "TEXMFVAR", 2); -UserTrees = __decorateClass([ - Exclude() -], UserTrees); - -// src/action/env.ts -function init() { - if (!("RUNNER_TEMP" in env3)) { - warn("`RUNNER_TEMP` not defined, %s will be used instead", tmpdir()); - env3["RUNNER_TEMP"] = tmpdir(); - } - env3["TMPDIR"] = env3.RUNNER_TEMP; - env3.TEXLIVE_INSTALL_ENV_NOCHECK ??= "1"; - env3.TEXLIVE_INSTALL_NO_WELCOME ??= "1"; - for (const tree of Texmf.SYSTEM_TREES) { - const key = `TEXLIVE_INSTALL_${tree}`; - if (tree !== "TEXMFLOCAL" && key in env3) { - warn("`%s` is set, but ignored", key); - delete env3[key]; + for (const metadata3 of metadatas) { + if (metadata3.propertyName !== void 0) { + metadata3.options.name = CASE[letterCase](metadata3.propertyName); + } + } } } + return decorator; } -function setDefaultTexmfUserTrees(version4) { - const TEXUSERDIR = path3.join(homedir(), ".local", "texlive", version4); - env3.TEXLIVE_INSTALL_TEXMFHOME ??= path3.join(homedir(), "texmf"); - const trees = new UserTrees(version4, { texdir: TEXUSERDIR }); - for (const key of Texmf.USER_TREES) { - env3[`TEXLIVE_INSTALL_${key}`] ??= trees[key]; - } +function FromEnv(key) { + return Transform2(({ value }) => env3[key] ?? value); } +var AsPath = Transform2( + ({ value }) => value === void 0 ? void 0 : path.normalize(value) +); // src/action/inputs.ts -var import_core3 = __toESM(require_core(), 1); -init_esm5(); -init_storage(); -import path4 from "node:path"; -import { env as env4 } from "node:process"; -init_decorators2(); var _Inputs = class _Inputs { cache = true; packageFile; @@ -61922,7 +78114,7 @@ __decorateClass([ Input ], _Inputs.prototype, "packages", 2); __decorateClass([ - Transform(() => path4.join(env4.RUNNER_TEMP, ID["kebab-case"])), + Transform2(() => path2.join(env4.RUNNER_TEMP, id_default["kebab-case"])), FromEnv("TEXLIVE_INSTALL_PREFIX"), Input, AsPath @@ -61939,26 +78131,22 @@ __decorateClass([ ], _Inputs.prototype, "updateAllPackages", 2); __decorateClass([ Input, - Transform(({ value }) => { - var _a2; - return (_a2 = value == null ? void 0 : value.toLowerCase) == null ? void 0 : _a2.call(value); - }) + Transform2(({ value }) => value?.toLowerCase?.()) ], _Inputs.prototype, "version", 2); var Inputs = _Inputs; function getExposedName(target, key) { - var _a2; - return ((_a2 = defaultMetadataStorage.getExposedMetadatas(target.constructor).find((data) => data.propertyName === key)) == null ? void 0 : _a2.options.name) ?? key; + return defaultMetadataStorage.getExposedMetadatas(target.constructor).find((data) => data.propertyName === key)?.options.name ?? key; } function Input(target, key) { Case("kebab")(target, key); - Transform(({ value }) => { + Transform2(({ value }) => { const raw = (0, import_core3.getInput)(getExposedName(target, key)); return raw === "" ? value : raw; })(target, key); } function BooleanInput(target, key) { Case("kebab")(target, key); - Transform(({ value }) => { + Transform2(({ value }) => { try { return (0, import_core3.getBooleanInput)(getExposedName(target, key)); } catch { @@ -62005,25 +78193,24 @@ function* parseDeps(packageName2, input) { // src/texlive/install-tl/cli.ts var import_tool_cache2 = __toESM(require_tool_cache(), 1); import { platform as platform3 } from "node:os"; -import path10 from "node:path"; +import path8 from "node:path"; // src/texlive/install-tl/errors.ts var import_deline = __toESM(require_deline(), 1); import { readFile } from "node:fs/promises"; -import path6 from "node:path"; +import path4 from "node:path"; // src/texlive/errors.ts -init_decorators2(); var TLError = class extends Error { constructor(msg, options) { super(msg, options); - if ((options == null ? void 0 : options.version) !== void 0) { + if (options?.version !== void 0) { this.version = options.version; } - if ((options == null ? void 0 : options.repository) !== void 0) { + if (options?.repository !== void 0) { this.repository = options.repository.toString(); } - if ((options == null ? void 0 : options.remoteVersion) !== void 0) { + if (options?.remoteVersion !== void 0) { this.remoteVersion = options.remoteVersion; } } @@ -62032,9 +78219,6 @@ TLError = __decorateClass([ Exception ], TLError); -// src/util/index.ts -init_decorators2(); - // src/util/exec.ts var actions = __toESM(require_exec(), 1); import { Buffer as Buffer2 } from "node:buffer"; @@ -62097,7 +78281,7 @@ async function exec(command, args, options) { args, ...await actions.getExecOutput(command, args, execOptions) }); - if ((options == null ? void 0 : options.ignoreReturnCode) !== true) { + if (options?.ignoreReturnCode !== true) { result.check(); } return result; @@ -62114,7 +78298,7 @@ function processArgsAndOptions(argsOrOptions, options) { var import_io = __toESM(require_io(), 1); var import_tool_cache = __toESM(require_tool_cache(), 1); import fs2 from "node:fs/promises"; -import path5 from "node:path"; +import path3 from "node:path"; import { env as env5 } from "node:process"; async function extract(archive, kind) { switch (kind) { @@ -62139,14 +78323,14 @@ async function uniqueChild(parent) { if (rest.length > 0) { throw new Error(`${parent} has multiple entries`); } - return path5.join(parent, child); + return path3.join(parent, child); } function tmpdir2() { return env5.RUNNER_TEMP; } async function mkdtemp() { return { - path: await fs2.mkdtemp(path5.join(tmpdir2(), `${ID["kebab-case"]}-`)), + path: await fs2.mkdtemp(path3.join(tmpdir2(), `${id_default["kebab-case"]}-`)), async [Symbol.asyncDispose]() { await (0, import_io.rmRF)(this.path); } @@ -62213,7 +78397,7 @@ function newClientError(statusCode, url2) { // src/util/types.ts function isIterable(value) { - return typeof (value == null ? void 0 : value[Symbol.iterator]) === "function"; + return typeof value?.[Symbol.iterator] === "function"; } // src/texlive/install-tl/errors.ts @@ -62235,11 +78419,10 @@ var RepositoryVersionIncompatible = class extends InstallTLError { `; } static check(output, options) { - var _a2, _b; if (output.exitCode !== 0 && output.stderr.includes(this.TAG)) { throw new this({ ...options, - remoteVersion: (_b = (_a2 = this.RE.exec(output.stderr)) == null ? void 0 : _a2.groups) == null ? void 0 : _b["remote"] + remoteVersion: this.RE.exec(output.stderr)?.groups?.["remote"] }); } } @@ -62252,15 +78435,14 @@ RepositoryVersionIncompatible = __decorateClass([ var UnexpectedVersion = class extends InstallTLError { constructor(options) { super( - `Unexpected install-tl version: ${(options == null ? void 0 : options.remoteVersion) ?? "unknown"}`, + `Unexpected install-tl version: ${options?.remoteVersion ?? "unknown"}`, options ); } static async check(TEXMFROOT, options) { - var _a2; const opts = { ...options }; try { - const releaseTextPath = path6.format({ + const releaseTextPath = path4.format({ dir: TEXMFROOT, name: this.RELEASE_TEXT_FILE }); @@ -62268,7 +78450,7 @@ var UnexpectedVersion = class extends InstallTLError { if (text.includes(`version ${options.version}`)) { return; } - opts.remoteVersion = (_a2 = this.RE.exec(text)) == null ? void 0 : _a2[1]; + opts.remoteVersion = this.RE.exec(text)?.[1]; } catch (cause) { opts.cause = cause; } @@ -62290,8 +78472,8 @@ import posixPath from "node:path/posix"; var API_VERSION = "2.0"; var API_BASE_URL = `https://ctan.org/json/${API_VERSION}`; async function pkg(name2) { - const path15 = `/pkg/${name2}`; - const endpoint = posixPath.join(API_BASE_URL, path15); + const path14 = `/pkg/${name2}`; + const endpoint = posixPath.join(API_BASE_URL, path14); return await getJson(endpoint); } @@ -62304,7 +78486,7 @@ var CTAN_MASTER = "http://ftp.dante.de/tex-archive/"; var CTAN_MIRROR = "https://mirrors.ctan.org/"; var resolvedMirrorLocation; async function resolve(options) { - if ((options == null ? void 0 : options.master) ?? false) { + if (options?.master ?? false) { return new URL(CTAN_MASTER); } try { @@ -62343,7 +78525,7 @@ function historic(version4, options) { version4 < "2010" ? "tlnet" : "tlnet-final", "/" ); - const base = (options == null ? void 0 : options.master) ?? false ? HISTORIC_MASTER : HISTORIC_MIRROR; + const base = options?.master ?? false ? HISTORIC_MASTER : HISTORIC_MIRROR; return new URL(tlnetPath, base); } @@ -62422,7 +78604,7 @@ var Latest = class { info2("Checking for latest version of TeX Live"); try { const { version: version4 } = await api_exports.pkg("texlive"); - this.version = Version.parse((version4 == null ? void 0 : version4.number) ?? ""); + this.version = Version.parse(version4?.number ?? ""); } catch (error) { info2({ error }, "Failed to check for latest version"); info2("Use `%s` as latest version", this.version); @@ -62463,7 +78645,7 @@ var Latest = class { // src/texlive/tlpkg/errors.ts var import_deline2 = __toESM(require_deline(), 1); -import path7 from "node:path"; +import path5 from "node:path"; var PackageChecksumMismatch = class extends TLError { constructor(packages, options) { super("The checksums of some packages did not match", options); @@ -62476,7 +78658,7 @@ var PackageChecksumMismatch = class extends TLError { static check(output, options) { const packages = Array.from( output.stderr.matchAll(this.RE), - ([, found]) => path7.basename(found, ".tar.xz") + ([, found]) => path5.basename(found, ".tar.xz") ); if (packages.length > 0) { throw new this(packages, options); @@ -62498,9 +78680,8 @@ var TlpdbNotFound = class extends TLError { `; } static check(output, options) { - var _a2; if (output.exitCode !== 0) { - const url2 = ((_a2 = this.RE.exec(output.stderr)) == null ? void 0 : _a2[1]) ?? void 0; + const url2 = this.RE.exec(output.stderr)?.[1] ?? void 0; if (url2 !== void 0) { throw new this(url2, options); } @@ -62516,7 +78697,7 @@ TlpdbNotFound = __decorateClass([ // src/texlive/tlpkg/patch.ts import { readFile as readFile2, writeFile } from "node:fs/promises"; import { platform as platform2 } from "node:os"; -import path8 from "node:path"; +import path6 from "node:path"; var PATCHES = [{ description: "Fixes a syntax error.", versions: { since: "2009", until: "2011" }, @@ -62549,8 +78730,7 @@ var PATCHES = [{ }]; async function patch(options) { const patches = PATCHES.filter((p2) => { - var _a2, _b; - return (p2.platforms === void 0 || p2.platforms === platform2()) && (((_a2 = p2.versions) == null ? void 0 : _a2.since) ?? "") <= options.version && options.version < (((_b = p2.versions) == null ? void 0 : _b.until) ?? "9999"); + return (p2.platforms === void 0 || p2.platforms === platform2()) && (p2.versions?.since ?? "") <= options.version && options.version < (p2.versions?.until ?? "9999"); }); if (patches.length > 0) { const diff = async (changed, p2) => { @@ -62582,7 +78762,7 @@ async function patch(options) { return []; }; const apply = async (p2) => { - const target = path8.join(options.TEXMFROOT, p2.file); + const target = path6.join(options.TEXMFROOT, p2.file); const content = p2.from.reduce( (s2, from, i2) => s2.replace(from, p2.to[i2] ?? ""), await readFile2(target, "utf8") @@ -62612,10 +78792,10 @@ function* parse4(db) { } // src/texlive/tlpkg/util.ts -import path9 from "node:path"; +import path7 from "node:path"; async function makeLocalSkeleton(texmflocal, options) { await exec("perl", [ - `-I${path9.join(options.TEXDIR, "tlpkg")}`, + `-I${path7.join(options.TEXDIR, "tlpkg")}`, "-mTeXLive::TLUtils=make_local_skeleton", "-e", "make_local_skeleton shift", @@ -62656,7 +78836,7 @@ async function installTL(options) { await patch(profile); } async function acquire(options) { - return path10.format({ + return path8.format({ dir: restoreCache2(options) ?? await download(options), base: executableName(options.profile.version) }); @@ -62725,10 +78905,364 @@ function archiveName() { } // src/texlive/install-tl/profile.ts -init_esm5(); import { writeFile as writeFile2 } from "node:fs/promises"; import { platform as platform4 } from "node:os"; -import path11 from "node:path"; +import path10 from "node:path"; + +// node_modules/ts-mixer/dist/esm/index.js +var copyProps = (dest, src, exclude = []) => { + const props = Object.getOwnPropertyDescriptors(src); + for (let prop of exclude) + delete props[prop]; + Object.defineProperties(dest, props); +}; +var protoChain = (obj, currentChain = [obj]) => { + const proto = Object.getPrototypeOf(obj); + if (proto === null) + return currentChain; + return protoChain(proto, [...currentChain, proto]); +}; +var nearestCommonProto = (...objs) => { + if (objs.length === 0) + return void 0; + let commonProto = void 0; + const protoChains = objs.map((obj) => protoChain(obj)); + while (protoChains.every((protoChain2) => protoChain2.length > 0)) { + const protos = protoChains.map((protoChain2) => protoChain2.pop()); + const potentialCommonProto = protos[0]; + if (protos.every((proto) => proto === potentialCommonProto)) + commonProto = potentialCommonProto; + else + break; + } + return commonProto; +}; +var hardMixProtos = (ingredients, constructor, exclude = []) => { + var _a2; + const base = (_a2 = nearestCommonProto(...ingredients)) !== null && _a2 !== void 0 ? _a2 : Object.prototype; + const mixedProto = Object.create(base); + const visitedProtos = protoChain(base); + for (let prototype of ingredients) { + let protos = protoChain(prototype); + for (let i2 = protos.length - 1; i2 >= 0; i2--) { + let newProto = protos[i2]; + if (visitedProtos.indexOf(newProto) === -1) { + copyProps(mixedProto, newProto, ["constructor", ...exclude]); + visitedProtos.push(newProto); + } + } + } + mixedProto.constructor = constructor; + return mixedProto; +}; +var unique = (arr) => arr.filter((e2, i2) => arr.indexOf(e2) == i2); +var getIngredientWithProp = (prop, ingredients) => { + const protoChains = ingredients.map((ingredient) => protoChain(ingredient)); + let protoDepth = 0; + let protosAreLeftToSearch = true; + while (protosAreLeftToSearch) { + protosAreLeftToSearch = false; + for (let i2 = ingredients.length - 1; i2 >= 0; i2--) { + const searchTarget = protoChains[i2][protoDepth]; + if (searchTarget !== void 0 && searchTarget !== null) { + protosAreLeftToSearch = true; + if (Object.getOwnPropertyDescriptor(searchTarget, prop) != void 0) { + return protoChains[i2][0]; + } + } + } + protoDepth++; + } + return void 0; +}; +var proxyMix = (ingredients, prototype = Object.prototype) => new Proxy({}, { + getPrototypeOf() { + return prototype; + }, + setPrototypeOf() { + throw Error("Cannot set prototype of Proxies created by ts-mixer"); + }, + getOwnPropertyDescriptor(_2, prop) { + return Object.getOwnPropertyDescriptor(getIngredientWithProp(prop, ingredients) || {}, prop); + }, + defineProperty() { + throw new Error("Cannot define new properties on Proxies created by ts-mixer"); + }, + has(_2, prop) { + return getIngredientWithProp(prop, ingredients) !== void 0 || prototype[prop] !== void 0; + }, + get(_2, prop) { + return (getIngredientWithProp(prop, ingredients) || prototype)[prop]; + }, + set(_2, prop, val) { + const ingredientWithProp = getIngredientWithProp(prop, ingredients); + if (ingredientWithProp === void 0) + throw new Error("Cannot set new properties on Proxies created by ts-mixer"); + ingredientWithProp[prop] = val; + return true; + }, + deleteProperty() { + throw new Error("Cannot delete properties on Proxies created by ts-mixer"); + }, + ownKeys() { + return ingredients.map(Object.getOwnPropertyNames).reduce((prev, curr) => curr.concat(prev.filter((key) => curr.indexOf(key) < 0))); + } +}); +var softMixProtos = (ingredients, constructor) => proxyMix([...ingredients, { constructor }]); +var settings = { + initFunction: null, + staticsStrategy: "copy", + prototypeStrategy: "copy", + decoratorInheritance: "deep" +}; +var mixins = /* @__PURE__ */ new Map(); +var getMixinsForClass = (clazz) => mixins.get(clazz); +var registerMixins = (mixedClass, constituents) => mixins.set(mixedClass, constituents); +var mergeObjectsOfDecorators = (o1, o2) => { + var _a2, _b2; + const allKeys = unique([...Object.getOwnPropertyNames(o1), ...Object.getOwnPropertyNames(o2)]); + const mergedObject = {}; + for (let key of allKeys) + mergedObject[key] = unique([...(_a2 = o1 === null || o1 === void 0 ? void 0 : o1[key]) !== null && _a2 !== void 0 ? _a2 : [], ...(_b2 = o2 === null || o2 === void 0 ? void 0 : o2[key]) !== null && _b2 !== void 0 ? _b2 : []]); + return mergedObject; +}; +var mergePropertyAndMethodDecorators = (d1, d2) => { + var _a2, _b2, _c2, _d2; + return { + property: mergeObjectsOfDecorators((_a2 = d1 === null || d1 === void 0 ? void 0 : d1.property) !== null && _a2 !== void 0 ? _a2 : {}, (_b2 = d2 === null || d2 === void 0 ? void 0 : d2.property) !== null && _b2 !== void 0 ? _b2 : {}), + method: mergeObjectsOfDecorators((_c2 = d1 === null || d1 === void 0 ? void 0 : d1.method) !== null && _c2 !== void 0 ? _c2 : {}, (_d2 = d2 === null || d2 === void 0 ? void 0 : d2.method) !== null && _d2 !== void 0 ? _d2 : {}) + }; +}; +var mergeDecorators = (d1, d2) => { + var _a2, _b2, _c2, _d2, _e2, _f; + return { + class: unique([...(_a2 = d1 === null || d1 === void 0 ? void 0 : d1.class) !== null && _a2 !== void 0 ? _a2 : [], ...(_b2 = d2 === null || d2 === void 0 ? void 0 : d2.class) !== null && _b2 !== void 0 ? _b2 : []]), + static: mergePropertyAndMethodDecorators((_c2 = d1 === null || d1 === void 0 ? void 0 : d1.static) !== null && _c2 !== void 0 ? _c2 : {}, (_d2 = d2 === null || d2 === void 0 ? void 0 : d2.static) !== null && _d2 !== void 0 ? _d2 : {}), + instance: mergePropertyAndMethodDecorators((_e2 = d1 === null || d1 === void 0 ? void 0 : d1.instance) !== null && _e2 !== void 0 ? _e2 : {}, (_f = d2 === null || d2 === void 0 ? void 0 : d2.instance) !== null && _f !== void 0 ? _f : {}) + }; +}; +var decorators = /* @__PURE__ */ new Map(); +var findAllConstituentClasses = (...classes) => { + var _a2; + const allClasses = /* @__PURE__ */ new Set(); + const frontier = /* @__PURE__ */ new Set([...classes]); + while (frontier.size > 0) { + for (let clazz of frontier) { + const protoChainClasses = protoChain(clazz.prototype).map((proto) => proto.constructor); + const mixinClasses = (_a2 = getMixinsForClass(clazz)) !== null && _a2 !== void 0 ? _a2 : []; + const potentiallyNewClasses = [...protoChainClasses, ...mixinClasses]; + const newClasses = potentiallyNewClasses.filter((c2) => !allClasses.has(c2)); + for (let newClass of newClasses) + frontier.add(newClass); + allClasses.add(clazz); + frontier.delete(clazz); + } + } + return [...allClasses]; +}; +var deepDecoratorSearch = (...classes) => { + const decoratorsForClassChain = findAllConstituentClasses(...classes).map((clazz) => decorators.get(clazz)).filter((decorators2) => !!decorators2); + if (decoratorsForClassChain.length == 0) + return {}; + if (decoratorsForClassChain.length == 1) + return decoratorsForClassChain[0]; + return decoratorsForClassChain.reduce((d1, d2) => mergeDecorators(d1, d2)); +}; +var directDecoratorSearch = (...classes) => { + const classDecorators = classes.map((clazz) => getDecoratorsForClass(clazz)); + if (classDecorators.length === 0) + return {}; + if (classDecorators.length === 1) + return classDecorators[0]; + return classDecorators.reduce((d1, d2) => mergeDecorators(d1, d2)); +}; +var getDecoratorsForClass = (clazz) => { + let decoratorsForClass = decorators.get(clazz); + if (!decoratorsForClass) { + decoratorsForClass = {}; + decorators.set(clazz, decoratorsForClass); + } + return decoratorsForClass; +}; +var decorateClass = (decorator) => (clazz) => { + const decoratorsForClass = getDecoratorsForClass(clazz); + let classDecorators = decoratorsForClass.class; + if (!classDecorators) { + classDecorators = []; + decoratorsForClass.class = classDecorators; + } + classDecorators.push(decorator); + return decorator(clazz); +}; +var decorateMember = (decorator) => (object, key, ...otherArgs) => { + var _a2, _b2, _c2; + const decoratorTargetType = typeof object === "function" ? "static" : "instance"; + const decoratorType = typeof object[key] === "function" ? "method" : "property"; + const clazz = decoratorTargetType === "static" ? object : object.constructor; + const decoratorsForClass = getDecoratorsForClass(clazz); + const decoratorsForTargetType = (_a2 = decoratorsForClass === null || decoratorsForClass === void 0 ? void 0 : decoratorsForClass[decoratorTargetType]) !== null && _a2 !== void 0 ? _a2 : {}; + decoratorsForClass[decoratorTargetType] = decoratorsForTargetType; + let decoratorsForType = (_b2 = decoratorsForTargetType === null || decoratorsForTargetType === void 0 ? void 0 : decoratorsForTargetType[decoratorType]) !== null && _b2 !== void 0 ? _b2 : {}; + decoratorsForTargetType[decoratorType] = decoratorsForType; + let decoratorsForKey = (_c2 = decoratorsForType === null || decoratorsForType === void 0 ? void 0 : decoratorsForType[key]) !== null && _c2 !== void 0 ? _c2 : []; + decoratorsForType[key] = decoratorsForKey; + decoratorsForKey.push(decorator); + return decorator(object, key, ...otherArgs); +}; +var decorate2 = (decorator) => (...args) => { + if (args.length === 1) + return decorateClass(decorator)(args[0]); + return decorateMember(decorator)(...args); +}; +function Mixin(...constructors) { + var _a2, _b2, _c2; + const prototypes = constructors.map((constructor) => constructor.prototype); + const initFunctionName = settings.initFunction; + if (initFunctionName !== null) { + const initFunctions = prototypes.map((proto) => proto[initFunctionName]).filter((func) => typeof func === "function"); + const combinedInitFunction = function(...args) { + for (let initFunction of initFunctions) + initFunction.apply(this, args); + }; + const extraProto = { [initFunctionName]: combinedInitFunction }; + prototypes.push(extraProto); + } + function MixedClass(...args) { + for (const constructor of constructors) + copyProps(this, new constructor(...args)); + if (initFunctionName !== null && typeof this[initFunctionName] === "function") + this[initFunctionName].apply(this, args); + } + MixedClass.prototype = settings.prototypeStrategy === "copy" ? hardMixProtos(prototypes, MixedClass) : softMixProtos(prototypes, MixedClass); + Object.setPrototypeOf(MixedClass, settings.staticsStrategy === "copy" ? hardMixProtos(constructors, null, ["prototype"]) : proxyMix(constructors, Function.prototype)); + let DecoratedMixedClass = MixedClass; + if (settings.decoratorInheritance !== "none") { + const classDecorators = settings.decoratorInheritance === "deep" ? deepDecoratorSearch(...constructors) : directDecoratorSearch(...constructors); + for (let decorator of (_a2 = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.class) !== null && _a2 !== void 0 ? _a2 : []) { + const result = decorator(DecoratedMixedClass); + if (result) { + DecoratedMixedClass = result; + } + } + applyPropAndMethodDecorators((_b2 = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.static) !== null && _b2 !== void 0 ? _b2 : {}, DecoratedMixedClass); + applyPropAndMethodDecorators((_c2 = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.instance) !== null && _c2 !== void 0 ? _c2 : {}, DecoratedMixedClass.prototype); + } + registerMixins(DecoratedMixedClass, constructors); + return DecoratedMixedClass; +} +var applyPropAndMethodDecorators = (propAndMethodDecorators, target) => { + const propDecorators = propAndMethodDecorators.property; + const methodDecorators = propAndMethodDecorators.method; + if (propDecorators) + for (let key in propDecorators) + for (let decorator of propDecorators[key]) + decorator(target, key); + if (methodDecorators) + for (let key in methodDecorators) + for (let decorator of methodDecorators[key]) + decorator(target, key, Object.getOwnPropertyDescriptor(target, key)); +}; + +// src/texlive/install-tl/texmf.ts +import path9 from "node:path"; +var _withPrefix, withPrefix_fn, _withTexdir, withTexdir_fn; +var SystemTrees = class { + constructor(version4, options) { + this.version = version4; + __privateAdd(this, _withPrefix); + __privateAdd(this, _withTexdir); + if (options.texdir === void 0) { + __privateMethod(this, _withPrefix, withPrefix_fn).call(this, options.prefix); + } + Object.assign(this, instanceToPlain(this)); + if (options.texdir !== void 0) { + __privateMethod(this, _withTexdir, withTexdir_fn).call(this, options.texdir); + } + } + get TEXMFROOT() { + return this.TEXDIR; + } +}; +_withPrefix = new WeakSet(); +withPrefix_fn = function(prefix2) { + this.TEXMFLOCAL = path9.join(prefix2, "texmf-local"); + __privateMethod(this, _withTexdir, withTexdir_fn).call(this, path9.join(prefix2, this.version)); +}; +_withTexdir = new WeakSet(); +withTexdir_fn = function(texdir) { + this.TEXDIR = texdir; + this.TEXMFSYSCONFIG = path9.join(texdir, "texmf-config"); + this.TEXMFSYSVAR = path9.join(texdir, "texmf-var"); + this.TEXMFLOCAL ??= path9.join(texdir, "texmf-local"); +}; +__decorateClass([ + decorate2(Expose()) +], SystemTrees.prototype, "TEXDIR", 2); +__decorateClass([ + decorate2(Expose()), + FromEnv("TEXLIVE_INSTALL_TEXMFLOCAL"), + AsPath +], SystemTrees.prototype, "TEXMFLOCAL", 2); +__decorateClass([ + decorate2(Expose()), + FromEnv("TEXLIVE_INSTALL_TEXMFSYSCONFIG"), + AsPath +], SystemTrees.prototype, "TEXMFSYSCONFIG", 2); +__decorateClass([ + decorate2(Expose()), + FromEnv("TEXLIVE_INSTALL_TEXMFSYSVAR"), + AsPath +], SystemTrees.prototype, "TEXMFSYSVAR", 2); +SystemTrees = __decorateClass([ + Exclude() +], SystemTrees); +var _withTexuserdir, withTexuserdir_fn, _withSystemTrees, withSystemTrees_fn; +var UserTrees = class { + constructor(version4, options) { + this.version = version4; + __privateAdd(this, _withTexuserdir); + __privateAdd(this, _withSystemTrees); + if (options.texuserdir !== void 0) { + __privateMethod(this, _withTexuserdir, withTexuserdir_fn).call(this, options.texuserdir); + } else { + __privateMethod(this, _withSystemTrees, withSystemTrees_fn).call(this, options); + Object.assign(this, instanceToPlain(this)); + } + } +}; +_withTexuserdir = new WeakSet(); +withTexuserdir_fn = function(texuserdir) { + this.TEXMFHOME = path9.join(texuserdir, "texmf"); + this.TEXMFCONFIG = path9.join(texuserdir, "texmf-config"); + this.TEXMFVAR = path9.join(texuserdir, "texmf-var"); +}; +_withSystemTrees = new WeakSet(); +withSystemTrees_fn = function(options) { + const trees = new SystemTrees(this.version, options); + this.TEXMFHOME = trees.TEXMFLOCAL; + this.TEXMFCONFIG = trees.TEXMFSYSCONFIG; + this.TEXMFVAR = trees.TEXMFSYSVAR; +}; +__decorateClass([ + decorate2(Expose()), + FromEnv("TEXLIVE_INSTALL_TEXMFHOME"), + AsPath +], UserTrees.prototype, "TEXMFHOME", 2); +__decorateClass([ + decorate2(Expose()), + FromEnv("TEXLIVE_INSTALL_TEXMFCONFIG"), + AsPath +], UserTrees.prototype, "TEXMFCONFIG", 2); +__decorateClass([ + decorate2(Expose()), + FromEnv("TEXLIVE_INSTALL_TEXMFVAR"), + AsPath +], UserTrees.prototype, "TEXMFVAR", 2); +UserTrees = __decorateClass([ + Exclude() +], UserTrees); + +// src/texlive/install-tl/profile.ts var _tmpdir, _path; var Profile = class extends Mixin(SystemTrees, UserTrees) { constructor() { @@ -62744,17 +79278,16 @@ var Profile = class extends Mixin(SystemTrees, UserTrees) { async open() { __privateGet(this, _tmpdir) ?? __privateSet(this, _tmpdir, await mkdtemp()); if (__privateGet(this, _path) === void 0) { - const profilePath = path11.join(__privateGet(this, _tmpdir).path, "texlive.profile"); + const profilePath = path10.join(__privateGet(this, _tmpdir).path, "texlive.profile"); await writeFile2(profilePath, this.toString()); __privateSet(this, _path, profilePath); } return __privateGet(this, _path); } async [Symbol.asyncDispose]() { - var _a2; __privateSet(this, _path, void 0); try { - await ((_a2 = __privateGet(this, _tmpdir)) == null ? void 0 : _a2[Symbol.asyncDispose]()); + await __privateGet(this, _tmpdir)?.[Symbol.asyncDispose](); } finally { __privateSet(this, _tmpdir, void 0); } @@ -62892,7 +79425,7 @@ var kpse_exports = {}; __export(kpse_exports, { varValue: () => varValue }); -import path12 from "node:path"; +import path11 from "node:path"; async function varValue(variable) { const { exitCode, stdout } = await exec("kpsewhich", [ `-var-value=${variable}` @@ -62900,7 +79433,7 @@ async function varValue(variable) { ignoreReturnCode: true, silent: true }); - return exitCode === 0 ? path12.normalize(stdout.replace(/\r?\n$/u, "")) : void 0; + return exitCode === 0 ? path11.normalize(stdout.replace(/\r?\n$/u, "")) : void 0; } // src/texlive/tlmgr/action.ts @@ -62973,9 +79506,8 @@ var TLVersionOutdated = class extends TlmgrError { super("The TeX Live version is outdated", options); } static check(output, options) { - var _a2, _b; if (output.exitCode !== 0) { - const remoteVersion = (_b = (_a2 = this.RE.exec(output.stderr)) == null ? void 0 : _a2.groups) == null ? void 0 : _b["remote"]; + const remoteVersion = this.RE.exec(output.stderr)?.groups?.["remote"]; if (remoteVersion !== void 0) { throw new this({ ...options, remoteVersion }); } @@ -63088,15 +79620,14 @@ async function resolvePackageName(name2) { // src/texlive/tlmgr/actions/list.ts import { readFile as readFile3 } from "node:fs/promises"; -import path13 from "node:path"; +import path12 from "node:path"; var RE2 = { nonPackage: /(?:^(?:collection|scheme)-|\.)/u, version: /^catalogue-version\s+(.*)$/mu, revision: /^revision\s+(\d+)\s*$/mu }; async function* list() { - var _a2, _b, _c; - const tlpdbPath = path13.join(use().TEXDIR, "tlpkg", "texlive.tlpdb"); + const tlpdbPath = path12.join(use().TEXDIR, "tlpkg", "texlive.tlpdb"); let db; try { db = await readFile3(tlpdbPath, "utf8"); @@ -63107,8 +79638,8 @@ async function* list() { try { for (const [name2, data] of tlpdb_exports.parse(db)) { if (name2 === "texlive.infra" || !RE2.nonPackage.test(name2)) { - const version4 = (_b = (_a2 = RE2.version.exec(data)) == null ? void 0 : _a2[1]) == null ? void 0 : _b.trimEnd(); - const revision = ((_c = RE2.revision.exec(data)) == null ? void 0 : _c[1]) ?? ""; + const version4 = RE2.version.exec(data)?.[1]?.trimEnd(); + const revision = RE2.revision.exec(data)?.[1] ?? ""; yield { name: name2, version: version4, revision }; } } @@ -63123,11 +79654,11 @@ __export(path_exports, { add: () => add }); var import_core5 = __toESM(require_core(), 1); -import path14 from "node:path"; +import path13 from "node:path"; async function add() { let dir; try { - dir = await uniqueChild(path14.join(use().TEXDIR, "bin")); + dir = await uniqueChild(path13.join(use().TEXDIR, "bin")); } catch (cause) { throw new Error("Unable to locate TeX Live's binary directory", { cause }); } @@ -63167,11 +79698,10 @@ async function remove(repo) { await use().exec("repository", ["remove", repo.toString()]); } async function* list2() { - var _a2; const { stdout } = await use().exec("repository", ["list"]); const re3 = /^\t(?.+) \((?.+)\)$/u; for (const line of stdout.split(/\r?\n/gu).slice(1)) { - const found = ((_a2 = re3.exec(line)) == null ? void 0 : _a2.groups) ?? {}; + const found = re3.exec(line)?.groups ?? {}; yield { path: found["path"] ?? line.trim(), tag: found["tag"] @@ -63187,11 +79717,11 @@ async function update3(packagesOrOptions, options) { packagesOrOptions, options ); - const args = (options == null ? void 0 : options.all) ?? false ? ["--all"] : [...packages]; - if ((options == null ? void 0 : options.self) ?? false) { + const args = options?.all ?? false ? ["--all"] : [...packages]; + if (options?.self ?? false) { args.push(internals.version > "2008" ? "--self" : "texlive.infra"); } - if (((options == null ? void 0 : options.reinstallForciblyRemoved) ?? false) && internals.version >= "2009") { + if ((options?.reinstallForciblyRemoved ?? false) && internals.version >= "2009") { args.unshift("--reinstall-forcibly-removed"); } const action5 = "update"; @@ -63240,7 +79770,6 @@ var Config; version: await resolveVersion({ version: version4 }), packages: await collectPackages({ packageFile, packages }) }; - setDefaultTexmfUserTrees(config.version); if (!isLatest(config.version)) { if (config.tlcontrib) { warn(`TLContrib cannot be used with an older version of TeX Live`); @@ -63261,7 +79790,13 @@ async function collectPackages(inputs) { yield* depends_txt_exports.parse(inputs.packages); } if (inputs.packageFile !== void 0) { - yield* depends_txt_exports.parse(await readFile4(inputs.packageFile, "utf8")); + const globber = await (0, import_glob.create)(inputs.packageFile, { + implicitDescendants: false, + matchDirectories: false + }); + for await (const packageFile of globber.globGenerator()) { + yield* depends_txt_exports.parse(await readFile4(packageFile, "utf8")); + } } } const packages = []; diff --git a/package-lock.json b/package-lock.json index ffc6c70..d65ad79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "setup-texlive-action", - "version": "2.6.3", + "version": "3.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "setup-texlive-action", - "version": "2.6.3", + "version": "3.0.0", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index f767924..3dec5e1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "setup-texlive-action", "private": true, - "version": "2.6.3", + "version": "3.0.0", "description": "A GitHub Action to set up TeX Live", "scripts": { "build": "npm run build:script",