From 2f772d46b5bbec51fc8dd38a6818ae32b5a96e65 Mon Sep 17 00:00:00 2001 From: Solomon Date: Thu, 18 Dec 2025 12:44:52 +0000 Subject: [PATCH] Build dist --- dist/index.js | 27328 +++++++++++++++++++++++++++++------------------- 1 file changed, 16292 insertions(+), 11036 deletions(-) diff --git a/dist/index.js b/dist/index.js index f3ae47f..f5e56f5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,9 +1,7 @@ "use strict"; -var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __esm = (fn, res) => function __init() { @@ -24,19 +22,12 @@ var __copyProps = (to, from, except, desc) => { } return to; }; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // node_modules/semver/internal/constants.js var require_constants = __commonJS({ "node_modules/semver/internal/constants.js"(exports2, module2) { + "use strict"; var SEMVER_SPEC_VERSION = "2.0.0"; var MAX_LENGTH = 256; var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ @@ -68,6 +59,7 @@ var require_constants = __commonJS({ // node_modules/semver/internal/debug.js var require_debug = __commonJS({ "node_modules/semver/internal/debug.js"(exports2, module2) { + "use strict"; var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { }; module2.exports = debug; @@ -77,6 +69,7 @@ var require_debug = __commonJS({ // node_modules/semver/internal/re.js var require_re = __commonJS({ "node_modules/semver/internal/re.js"(exports2, module2) { + "use strict"; var { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, @@ -87,6 +80,7 @@ var require_re = __commonJS({ var re = exports2.re = []; var safeRe = exports2.safeRe = []; var src = exports2.src = []; + var safeSrc = exports2.safeSrc = []; var t = exports2.t = {}; var R = 0; var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; @@ -107,6 +101,7 @@ var require_re = __commonJS({ debug(name, index, value); t[name] = index; src[index] = value; + safeSrc[index] = safe; re[index] = new RegExp(value, isGlobal ? "g" : void 0); safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0); }, "createToken"); @@ -115,8 +110,8 @@ var require_re = __commonJS({ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`); createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`); - createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`); - createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`); + createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`); + createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`); createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); @@ -162,6 +157,7 @@ var require_re = __commonJS({ // node_modules/semver/internal/parse-options.js var require_parse_options = __commonJS({ "node_modules/semver/internal/parse-options.js"(exports2, module2) { + "use strict"; var looseOption = Object.freeze({ loose: true }); var emptyOpts = Object.freeze({}); var parseOptions = /* @__PURE__ */ __name((options) => { @@ -180,8 +176,12 @@ var require_parse_options = __commonJS({ // node_modules/semver/internal/identifiers.js var require_identifiers = __commonJS({ "node_modules/semver/internal/identifiers.js"(exports2, module2) { + "use strict"; var numeric = /^[0-9]+$/; var compareIdentifiers = /* @__PURE__ */ __name((a, b) => { + if (typeof a === "number" && typeof b === "number") { + return a === b ? 0 : a < b ? -1 : 1; + } const anum = numeric.test(a); const bnum = numeric.test(b); if (anum && bnum) { @@ -201,6 +201,7 @@ var require_identifiers = __commonJS({ // node_modules/semver/classes/semver.js var require_semver = __commonJS({ "node_modules/semver/classes/semver.js"(exports2, module2) { + "use strict"; var debug = require_debug(); var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants(); var { safeRe: re, t } = require_re(); @@ -210,31 +211,31 @@ var require_semver = __commonJS({ static { __name(this, "SemVer"); } - constructor(version2, options) { + constructor(version, options) { options = parseOptions(options); - if (version2 instanceof _SemVer) { - if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) { - return version2; + if (version instanceof _SemVer) { + if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { + return version; } else { - version2 = version2.version; + version = version.version; } - } else if (typeof version2 !== "string") { - throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`); + } else if (typeof version !== "string") { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`); } - if (version2.length > MAX_LENGTH) { + if (version.length > MAX_LENGTH) { throw new TypeError( `version is longer than ${MAX_LENGTH} characters` ); } - debug("SemVer", version2, options); + debug("SemVer", version, options); this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; - const m = version2.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); if (!m) { - throw new TypeError(`Invalid Version: ${version2}`); + throw new TypeError(`Invalid Version: ${version}`); } - this.raw = version2; + this.raw = version; this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; @@ -290,7 +291,25 @@ var require_semver = __commonJS({ 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); + if (this.major < other.major) { + return -1; + } + if (this.major > other.major) { + return 1; + } + if (this.minor < other.minor) { + return -1; + } + if (this.minor > other.minor) { + return 1; + } + if (this.patch < other.patch) { + return -1; + } + if (this.patch > other.patch) { + return 1; + } + return 0; } comparePre(other) { if (!(other instanceof _SemVer)) { @@ -346,6 +365,17 @@ var require_semver = __commonJS({ // 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(release, identifier, identifierBase) { + if (release.startsWith("pre")) { + if (!identifier && identifierBase === false) { + throw new Error("invalid increment argument: identifier is empty"); + } + if (identifier) { + const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]); + if (!match || match[1] !== identifier) { + throw new Error(`invalid identifier: ${identifier}`); + } + } + } switch (release) { case "premajor": this.prerelease.length = 0; @@ -371,6 +401,12 @@ var require_semver = __commonJS({ } this.inc("pre", identifier, identifierBase); break; + case "release": + if (this.prerelease.length === 0) { + throw new Error(`version ${this.raw} is not a prerelease`); + } + this.prerelease.length = 0; + break; case "major": if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { this.major++; @@ -394,9 +430,6 @@ var require_semver = __commonJS({ 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 { @@ -446,13 +479,14 @@ var require_semver = __commonJS({ // node_modules/semver/functions/parse.js var require_parse = __commonJS({ "node_modules/semver/functions/parse.js"(exports2, module2) { + "use strict"; var SemVer = require_semver(); - var parse2 = /* @__PURE__ */ __name((version2, options, throwErrors = false) => { - if (version2 instanceof SemVer) { - return version2; + var parse = /* @__PURE__ */ __name((version, options, throwErrors = false) => { + if (version instanceof SemVer) { + return version; } try { - return new SemVer(version2, options); + return new SemVer(version, options); } catch (er) { if (!throwErrors) { return null; @@ -460,16 +494,17 @@ var require_parse = __commonJS({ throw er; } }, "parse"); - module2.exports = parse2; + module2.exports = parse; } }); // node_modules/semver/functions/valid.js var require_valid = __commonJS({ "node_modules/semver/functions/valid.js"(exports2, module2) { - var parse2 = require_parse(); - var valid = /* @__PURE__ */ __name((version2, options) => { - const v = parse2(version2, options); + "use strict"; + var parse = require_parse(); + var valid = /* @__PURE__ */ __name((version, options) => { + const v = parse(version, options); return v ? v.version : null; }, "valid"); module2.exports = valid; @@ -479,9 +514,10 @@ var require_valid = __commonJS({ // node_modules/semver/functions/clean.js var require_clean = __commonJS({ "node_modules/semver/functions/clean.js"(exports2, module2) { - var parse2 = require_parse(); - var clean = /* @__PURE__ */ __name((version2, options) => { - const s = parse2(version2.trim().replace(/^[=v]+/, ""), options); + "use strict"; + var parse = require_parse(); + var clean = /* @__PURE__ */ __name((version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ""), options); return s ? s.version : null; }, "clean"); module2.exports = clean; @@ -491,8 +527,9 @@ var require_clean = __commonJS({ // node_modules/semver/functions/inc.js var require_inc = __commonJS({ "node_modules/semver/functions/inc.js"(exports2, module2) { + "use strict"; var SemVer = require_semver(); - var inc = /* @__PURE__ */ __name((version2, release, options, identifier, identifierBase) => { + var inc = /* @__PURE__ */ __name((version, release, options, identifier, identifierBase) => { if (typeof options === "string") { identifierBase = identifier; identifier = options; @@ -500,7 +537,7 @@ var require_inc = __commonJS({ } try { return new SemVer( - version2 instanceof SemVer ? version2.version : version2, + version instanceof SemVer ? version.version : version, options ).inc(release, identifier, identifierBase).version; } catch (er) { @@ -514,39 +551,39 @@ var require_inc = __commonJS({ // node_modules/semver/functions/diff.js var require_diff = __commonJS({ "node_modules/semver/functions/diff.js"(exports2, module2) { - var parse2 = require_parse(); + "use strict"; + var parse = require_parse(); var diff = /* @__PURE__ */ __name((version1, version2) => { - const v12 = parse2(version1, null, true); - const v2 = parse2(version2, null, true); - const comparison = v12.compare(v2); + const v1 = parse(version1, null, true); + const v2 = parse(version2, null, true); + const comparison = v1.compare(v2); if (comparison === 0) { return null; } const v1Higher = comparison > 0; - const highVersion = v1Higher ? v12 : v2; - const lowVersion = v1Higher ? v2 : v12; + const highVersion = v1Higher ? v1 : v2; + const lowVersion = v1Higher ? v2 : v1; const highHasPre = !!highVersion.prerelease.length; const lowHasPre = !!lowVersion.prerelease.length; if (lowHasPre && !highHasPre) { if (!lowVersion.patch && !lowVersion.minor) { return "major"; } - if (highVersion.patch) { + if (lowVersion.compareMain(highVersion) === 0) { + if (lowVersion.minor && !lowVersion.patch) { + return "minor"; + } return "patch"; } - if (highVersion.minor) { - return "minor"; - } - return "major"; } const prefix = highHasPre ? "pre" : ""; - if (v12.major !== v2.major) { + if (v1.major !== v2.major) { return prefix + "major"; } - if (v12.minor !== v2.minor) { + if (v1.minor !== v2.minor) { return prefix + "minor"; } - if (v12.patch !== v2.patch) { + if (v1.patch !== v2.patch) { return prefix + "patch"; } return "prerelease"; @@ -558,6 +595,7 @@ var require_diff = __commonJS({ // node_modules/semver/functions/major.js var require_major = __commonJS({ "node_modules/semver/functions/major.js"(exports2, module2) { + "use strict"; var SemVer = require_semver(); var major = /* @__PURE__ */ __name((a, loose) => new SemVer(a, loose).major, "major"); module2.exports = major; @@ -567,6 +605,7 @@ var require_major = __commonJS({ // node_modules/semver/functions/minor.js var require_minor = __commonJS({ "node_modules/semver/functions/minor.js"(exports2, module2) { + "use strict"; var SemVer = require_semver(); var minor = /* @__PURE__ */ __name((a, loose) => new SemVer(a, loose).minor, "minor"); module2.exports = minor; @@ -576,6 +615,7 @@ var require_minor = __commonJS({ // node_modules/semver/functions/patch.js var require_patch = __commonJS({ "node_modules/semver/functions/patch.js"(exports2, module2) { + "use strict"; var SemVer = require_semver(); var patch = /* @__PURE__ */ __name((a, loose) => new SemVer(a, loose).patch, "patch"); module2.exports = patch; @@ -585,9 +625,10 @@ var require_patch = __commonJS({ // node_modules/semver/functions/prerelease.js var require_prerelease = __commonJS({ "node_modules/semver/functions/prerelease.js"(exports2, module2) { - var parse2 = require_parse(); - var prerelease = /* @__PURE__ */ __name((version2, options) => { - const parsed = parse2(version2, options); + "use strict"; + var parse = require_parse(); + var prerelease = /* @__PURE__ */ __name((version, options) => { + const parsed = parse(version, options); return parsed && parsed.prerelease.length ? parsed.prerelease : null; }, "prerelease"); module2.exports = prerelease; @@ -597,6 +638,7 @@ var require_prerelease = __commonJS({ // node_modules/semver/functions/compare.js var require_compare = __commonJS({ "node_modules/semver/functions/compare.js"(exports2, module2) { + "use strict"; var SemVer = require_semver(); var compare = /* @__PURE__ */ __name((a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)), "compare"); module2.exports = compare; @@ -606,6 +648,7 @@ var require_compare = __commonJS({ // node_modules/semver/functions/rcompare.js var require_rcompare = __commonJS({ "node_modules/semver/functions/rcompare.js"(exports2, module2) { + "use strict"; var compare = require_compare(); var rcompare = /* @__PURE__ */ __name((a, b, loose) => compare(b, a, loose), "rcompare"); module2.exports = rcompare; @@ -615,6 +658,7 @@ var require_rcompare = __commonJS({ // node_modules/semver/functions/compare-loose.js var require_compare_loose = __commonJS({ "node_modules/semver/functions/compare-loose.js"(exports2, module2) { + "use strict"; var compare = require_compare(); var compareLoose = /* @__PURE__ */ __name((a, b) => compare(a, b, true), "compareLoose"); module2.exports = compareLoose; @@ -624,6 +668,7 @@ var require_compare_loose = __commonJS({ // node_modules/semver/functions/compare-build.js var require_compare_build = __commonJS({ "node_modules/semver/functions/compare-build.js"(exports2, module2) { + "use strict"; var SemVer = require_semver(); var compareBuild = /* @__PURE__ */ __name((a, b, loose) => { const versionA = new SemVer(a, loose); @@ -637,6 +682,7 @@ var require_compare_build = __commonJS({ // node_modules/semver/functions/sort.js var require_sort = __commonJS({ "node_modules/semver/functions/sort.js"(exports2, module2) { + "use strict"; var compareBuild = require_compare_build(); var sort = /* @__PURE__ */ __name((list, loose) => list.sort((a, b) => compareBuild(a, b, loose)), "sort"); module2.exports = sort; @@ -646,6 +692,7 @@ var require_sort = __commonJS({ // node_modules/semver/functions/rsort.js var require_rsort = __commonJS({ "node_modules/semver/functions/rsort.js"(exports2, module2) { + "use strict"; var compareBuild = require_compare_build(); var rsort = /* @__PURE__ */ __name((list, loose) => list.sort((a, b) => compareBuild(b, a, loose)), "rsort"); module2.exports = rsort; @@ -655,6 +702,7 @@ var require_rsort = __commonJS({ // node_modules/semver/functions/gt.js var require_gt = __commonJS({ "node_modules/semver/functions/gt.js"(exports2, module2) { + "use strict"; var compare = require_compare(); var gt = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) > 0, "gt"); module2.exports = gt; @@ -664,6 +712,7 @@ var require_gt = __commonJS({ // node_modules/semver/functions/lt.js var require_lt = __commonJS({ "node_modules/semver/functions/lt.js"(exports2, module2) { + "use strict"; var compare = require_compare(); var lt = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) < 0, "lt"); module2.exports = lt; @@ -673,6 +722,7 @@ var require_lt = __commonJS({ // node_modules/semver/functions/eq.js var require_eq = __commonJS({ "node_modules/semver/functions/eq.js"(exports2, module2) { + "use strict"; var compare = require_compare(); var eq = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) === 0, "eq"); module2.exports = eq; @@ -682,6 +732,7 @@ var require_eq = __commonJS({ // node_modules/semver/functions/neq.js var require_neq = __commonJS({ "node_modules/semver/functions/neq.js"(exports2, module2) { + "use strict"; var compare = require_compare(); var neq = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) !== 0, "neq"); module2.exports = neq; @@ -691,6 +742,7 @@ var require_neq = __commonJS({ // node_modules/semver/functions/gte.js var require_gte = __commonJS({ "node_modules/semver/functions/gte.js"(exports2, module2) { + "use strict"; var compare = require_compare(); var gte = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) >= 0, "gte"); module2.exports = gte; @@ -700,6 +752,7 @@ var require_gte = __commonJS({ // node_modules/semver/functions/lte.js var require_lte = __commonJS({ "node_modules/semver/functions/lte.js"(exports2, module2) { + "use strict"; var compare = require_compare(); var lte = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) <= 0, "lte"); module2.exports = lte; @@ -709,6 +762,7 @@ var require_lte = __commonJS({ // node_modules/semver/functions/cmp.js var require_cmp = __commonJS({ "node_modules/semver/functions/cmp.js"(exports2, module2) { + "use strict"; var eq = require_eq(); var neq = require_neq(); var gt = require_gt(); @@ -758,27 +812,28 @@ var require_cmp = __commonJS({ // node_modules/semver/functions/coerce.js var require_coerce = __commonJS({ "node_modules/semver/functions/coerce.js"(exports2, module2) { + "use strict"; var SemVer = require_semver(); - var parse2 = require_parse(); + var parse = require_parse(); var { safeRe: re, t } = require_re(); - var coerce = /* @__PURE__ */ __name((version2, options) => { - if (version2 instanceof SemVer) { - return version2; + var coerce = /* @__PURE__ */ __name((version, options) => { + if (version instanceof SemVer) { + return version; } - if (typeof version2 === "number") { - version2 = String(version2); + if (typeof version === "number") { + version = String(version); } - if (typeof version2 !== "string") { + if (typeof version !== "string") { return null; } options = options || {}; let match = null; if (!options.rtl) { - match = version2.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); + match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); } else { const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]; let next; - while ((next = coerceRtlRegex.exec(version2)) && (!match || match.index + match[0].length !== version2.length)) { + while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next; } @@ -794,7 +849,7 @@ var require_coerce = __commonJS({ const patch = match[4] || "0"; const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ""; const build = options.includePrerelease && match[6] ? `+${match[6]}` : ""; - return parse2(`${major}.${minor}.${patch}${prerelease}${build}`, options); + return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options); }, "coerce"); module2.exports = coerce; } @@ -803,6 +858,7 @@ var require_coerce = __commonJS({ // node_modules/semver/internal/lrucache.js var require_lrucache = __commonJS({ "node_modules/semver/internal/lrucache.js"(exports2, module2) { + "use strict"; var LRUCache = class { static { __name(this, "LRUCache"); @@ -843,6 +899,7 @@ var require_lrucache = __commonJS({ // node_modules/semver/classes/range.js var require_range = __commonJS({ "node_modules/semver/classes/range.js"(exports2, module2) { + "use strict"; var SPACE_CHARACTERS = /\s+/g; var Range = class _Range { static { @@ -966,19 +1023,19 @@ var require_range = __commonJS({ }); } // if ANY of the sets match ALL of its comparators, then pass - test(version2) { - if (!version2) { + test(version) { + if (!version) { return false; } - if (typeof version2 === "string") { + if (typeof version === "string") { try { - version2 = new SemVer(version2, this.options); + version = new SemVer(version, this.options); } catch (er) { return false; } } for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version2, this.options)) { + if (testSet(this.set[i], version, this.options)) { return true; } } @@ -1015,6 +1072,7 @@ var require_range = __commonJS({ return result; }, "isSatisfiable"); var parseComparator = /* @__PURE__ */ __name((comp, options) => { + comp = comp.replace(re[t.BUILD], ""); debug("comp", comp, options); comp = replaceCarets(comp, options); debug("caret", comp); @@ -1192,13 +1250,13 @@ var require_range = __commonJS({ } return `${from} ${to}`.trim(); }, "hyphenReplace"); - var testSet = /* @__PURE__ */ __name((set, version2, options) => { + var testSet = /* @__PURE__ */ __name((set, version, options) => { for (let i = 0; i < set.length; i++) { - if (!set[i].test(version2)) { + if (!set[i].test(version)) { return false; } } - if (version2.prerelease.length && !options.includePrerelease) { + if (version.prerelease.length && !options.includePrerelease) { for (let i = 0; i < set.length; i++) { debug(set[i].semver); if (set[i].semver === Comparator.ANY) { @@ -1206,7 +1264,7 @@ var require_range = __commonJS({ } if (set[i].semver.prerelease.length > 0) { const allowed = set[i].semver; - if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) { + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true; } } @@ -1221,6 +1279,7 @@ var require_range = __commonJS({ // node_modules/semver/classes/comparator.js var require_comparator = __commonJS({ "node_modules/semver/classes/comparator.js"(exports2, module2) { + "use strict"; var ANY = Symbol("SemVer ANY"); var Comparator = class _Comparator { static { @@ -1269,19 +1328,19 @@ var require_comparator = __commonJS({ toString() { return this.value; } - test(version2) { - debug("Comparator.test", version2, this.options.loose); - if (this.semver === ANY || version2 === ANY) { + test(version) { + debug("Comparator.test", version, this.options.loose); + if (this.semver === ANY || version === ANY) { return true; } - if (typeof version2 === "string") { + if (typeof version === "string") { try { - version2 = new SemVer(version2, this.options); + version = new SemVer(version, this.options); } catch (er) { return false; } } - return cmp(version2, this.operator, this.semver, this.options); + return cmp(version, this.operator, this.semver, this.options); } intersects(comp, options) { if (!(comp instanceof _Comparator)) { @@ -1336,14 +1395,15 @@ var require_comparator = __commonJS({ // node_modules/semver/functions/satisfies.js var require_satisfies = __commonJS({ "node_modules/semver/functions/satisfies.js"(exports2, module2) { + "use strict"; var Range = require_range(); - var satisfies = /* @__PURE__ */ __name((version2, range, options) => { + var satisfies = /* @__PURE__ */ __name((version, range, options) => { try { range = new Range(range, options); } catch (er) { return false; } - return range.test(version2); + return range.test(version); }, "satisfies"); module2.exports = satisfies; } @@ -1352,6 +1412,7 @@ var require_satisfies = __commonJS({ // node_modules/semver/ranges/to-comparators.js var require_to_comparators = __commonJS({ "node_modules/semver/ranges/to-comparators.js"(exports2, module2) { + "use strict"; var Range = require_range(); var toComparators = /* @__PURE__ */ __name((range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" ")), "toComparators"); module2.exports = toComparators; @@ -1361,6 +1422,7 @@ var require_to_comparators = __commonJS({ // node_modules/semver/ranges/max-satisfying.js var require_max_satisfying = __commonJS({ "node_modules/semver/ranges/max-satisfying.js"(exports2, module2) { + "use strict"; var SemVer = require_semver(); var Range = require_range(); var maxSatisfying = /* @__PURE__ */ __name((versions, range, options) => { @@ -1389,6 +1451,7 @@ var require_max_satisfying = __commonJS({ // node_modules/semver/ranges/min-satisfying.js var require_min_satisfying = __commonJS({ "node_modules/semver/ranges/min-satisfying.js"(exports2, module2) { + "use strict"; var SemVer = require_semver(); var Range = require_range(); var minSatisfying = /* @__PURE__ */ __name((versions, range, options) => { @@ -1417,6 +1480,7 @@ var require_min_satisfying = __commonJS({ // node_modules/semver/ranges/min-version.js var require_min_version = __commonJS({ "node_modules/semver/ranges/min-version.js"(exports2, module2) { + "use strict"; var SemVer = require_semver(); var Range = require_range(); var gt = require_gt(); @@ -1473,6 +1537,7 @@ var require_min_version = __commonJS({ // node_modules/semver/ranges/valid.js var require_valid2 = __commonJS({ "node_modules/semver/ranges/valid.js"(exports2, module2) { + "use strict"; var Range = require_range(); var validRange = /* @__PURE__ */ __name((range, options) => { try { @@ -1488,6 +1553,7 @@ var require_valid2 = __commonJS({ // node_modules/semver/ranges/outside.js var require_outside = __commonJS({ "node_modules/semver/ranges/outside.js"(exports2, module2) { + "use strict"; var SemVer = require_semver(); var Comparator = require_comparator(); var { ANY } = Comparator; @@ -1497,8 +1563,8 @@ var require_outside = __commonJS({ var lt = require_lt(); var lte = require_lte(); var gte = require_gte(); - var outside = /* @__PURE__ */ __name((version2, range, hilo, options) => { - version2 = new SemVer(version2, options); + var outside = /* @__PURE__ */ __name((version, range, hilo, options) => { + version = new SemVer(version, options); range = new Range(range, options); let gtfn, ltefn, ltfn, comp, ecomp; switch (hilo) { @@ -1519,7 +1585,7 @@ var require_outside = __commonJS({ default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } - if (satisfies(version2, range, options)) { + if (satisfies(version, range, options)) { return false; } for (let i = 0; i < range.set.length; ++i) { @@ -1541,9 +1607,9 @@ var require_outside = __commonJS({ if (high.operator === comp || high.operator === ecomp) { return false; } - if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) { + if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false; - } else if (low.operator === ecomp && ltfn(version2, low.semver)) { + } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false; } } @@ -1556,8 +1622,9 @@ var require_outside = __commonJS({ // node_modules/semver/ranges/gtr.js var require_gtr = __commonJS({ "node_modules/semver/ranges/gtr.js"(exports2, module2) { + "use strict"; var outside = require_outside(); - var gtr = /* @__PURE__ */ __name((version2, range, options) => outside(version2, range, ">", options), "gtr"); + var gtr = /* @__PURE__ */ __name((version, range, options) => outside(version, range, ">", options), "gtr"); module2.exports = gtr; } }); @@ -1565,8 +1632,9 @@ var require_gtr = __commonJS({ // node_modules/semver/ranges/ltr.js var require_ltr = __commonJS({ "node_modules/semver/ranges/ltr.js"(exports2, module2) { + "use strict"; var outside = require_outside(); - var ltr = /* @__PURE__ */ __name((version2, range, options) => outside(version2, range, "<", options), "ltr"); + var ltr = /* @__PURE__ */ __name((version, range, options) => outside(version, range, "<", options), "ltr"); module2.exports = ltr; } }); @@ -1574,6 +1642,7 @@ var require_ltr = __commonJS({ // node_modules/semver/ranges/intersects.js var require_intersects = __commonJS({ "node_modules/semver/ranges/intersects.js"(exports2, module2) { + "use strict"; var Range = require_range(); var intersects = /* @__PURE__ */ __name((r1, r2, options) => { r1 = new Range(r1, options); @@ -1587,6 +1656,7 @@ var require_intersects = __commonJS({ // node_modules/semver/ranges/simplify.js var require_simplify = __commonJS({ "node_modules/semver/ranges/simplify.js"(exports2, module2) { + "use strict"; var satisfies = require_satisfies(); var compare = require_compare(); module2.exports = (versions, range, options) => { @@ -1594,12 +1664,12 @@ var require_simplify = __commonJS({ let first = null; let prev = null; const v = versions.sort((a, b) => compare(a, b, options)); - for (const version2 of v) { - const included = satisfies(version2, range, options); + for (const version of v) { + const included = satisfies(version, range, options); if (included) { - prev = version2; + prev = version; if (!first) { - first = version2; + first = version; } } else { if (prev) { @@ -1636,6 +1706,7 @@ var require_simplify = __commonJS({ // node_modules/semver/ranges/subset.js var require_subset = __commonJS({ "node_modules/semver/ranges/subset.js"(exports2, module2) { + "use strict"; var Range = require_range(); var Comparator = require_comparator(); var { ANY } = Comparator; @@ -1798,11 +1869,12 @@ var require_subset = __commonJS({ // node_modules/semver/index.js var require_semver2 = __commonJS({ "node_modules/semver/index.js"(exports2, module2) { + "use strict"; var internalRe = require_re(); var constants = require_constants(); var SemVer = require_semver(); var identifiers = require_identifiers(); - var parse2 = require_parse(); + var parse = require_parse(); var valid = require_valid(); var clean = require_clean(); var inc = require_inc(); @@ -1840,7 +1912,7 @@ var require_semver2 = __commonJS({ var simplifyRange = require_simplify(); var subset = require_subset(); module2.exports = { - parse: parse2, + parse, valid, clean, inc, @@ -1930,9 +2002,13 @@ var require_command = __commonJS({ var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { if (k2 === void 0) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); } : function(o, m, k, k2) { if (k2 === void 0) k2 = k; @@ -1949,7 +2025,7 @@ var require_command = __commonJS({ var result = {}; if (mod != null) { for (var k in mod) - if (k !== "default" && Object.hasOwnProperty.call(mod, k)) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } __setModuleDefault2(result, mod); @@ -1990,14 +2066,14 @@ var require_command = __commonJS({ let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { - const val2 = this.properties[key]; - if (val2) { + const val = this.properties[key]; + if (val) { if (first) { first = false; } else { cmdStr += ","; } - cmdStr += `${key}=${escapeProperty(val2)}`; + cmdStr += `${key}=${escapeProperty(val)}`; } } } @@ -2007,361 +2083,16 @@ var require_command = __commonJS({ } }; function escapeData(s) { - return utils_1.toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); + return (0, utils_1.toCommandValue)(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); } __name(escapeData, "escapeData"); function escapeProperty(s) { - return utils_1.toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); + return (0, utils_1.toCommandValue)(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); } __name(escapeProperty, "escapeProperty"); } }); -// node_modules/@actions/core/node_modules/uuid/dist/esm-node/rng.js -function rng() { - if (poolPtr > rnds8Pool.length - 16) { - import_crypto.default.randomFillSync(rnds8Pool); - poolPtr = 0; - } - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} -var import_crypto, rnds8Pool, poolPtr; -var init_rng = __esm({ - "node_modules/@actions/core/node_modules/uuid/dist/esm-node/rng.js"() { - import_crypto = __toESM(require("crypto")); - rnds8Pool = new Uint8Array(256); - poolPtr = rnds8Pool.length; - __name(rng, "rng"); - } -}); - -// node_modules/@actions/core/node_modules/uuid/dist/esm-node/regex.js -var regex_default; -var init_regex = __esm({ - "node_modules/@actions/core/node_modules/uuid/dist/esm-node/regex.js"() { - regex_default = /^(?:[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/@actions/core/node_modules/uuid/dist/esm-node/validate.js -function validate(uuid) { - return typeof uuid === "string" && regex_default.test(uuid); -} -var validate_default; -var init_validate = __esm({ - "node_modules/@actions/core/node_modules/uuid/dist/esm-node/validate.js"() { - init_regex(); - __name(validate, "validate"); - validate_default = validate; - } -}); - -// node_modules/@actions/core/node_modules/uuid/dist/esm-node/stringify.js -function stringify(arr, offset = 0) { - const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); - if (!validate_default(uuid)) { - throw TypeError("Stringified UUID is invalid"); - } - return uuid; -} -var byteToHex, stringify_default; -var init_stringify = __esm({ - "node_modules/@actions/core/node_modules/uuid/dist/esm-node/stringify.js"() { - init_validate(); - byteToHex = []; - for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 256).toString(16).substr(1)); - } - __name(stringify, "stringify"); - stringify_default = stringify; - } -}); - -// node_modules/@actions/core/node_modules/uuid/dist/esm-node/v1.js -function v1(options, buf, offset) { - let i = buf && offset || 0; - const b = buf || new Array(16); - options = options || {}; - let node = options.node || _nodeId; - let clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq; - if (node == null || clockseq == null) { - const seedBytes = options.random || (options.rng || rng)(); - if (node == null) { - node = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } - if (clockseq == null) { - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 16383; - } - } - let msecs = options.msecs !== void 0 ? options.msecs : Date.now(); - let nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs + 1; - const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4; - if (dt < 0 && options.clockseq === void 0) { - clockseq = clockseq + 1 & 16383; - } - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === void 0) { - nsecs = 0; - } - if (nsecs >= 1e4) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; - msecs += 122192928e5; - const tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296; - b[i++] = tl >>> 24 & 255; - b[i++] = tl >>> 16 & 255; - b[i++] = tl >>> 8 & 255; - b[i++] = tl & 255; - const tmh = msecs / 4294967296 * 1e4 & 268435455; - b[i++] = tmh >>> 8 & 255; - b[i++] = tmh & 255; - b[i++] = tmh >>> 24 & 15 | 16; - b[i++] = tmh >>> 16 & 255; - b[i++] = clockseq >>> 8 | 128; - b[i++] = clockseq & 255; - for (let n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - return buf || stringify_default(b); -} -var _nodeId, _clockseq, _lastMSecs, _lastNSecs, v1_default; -var init_v1 = __esm({ - "node_modules/@actions/core/node_modules/uuid/dist/esm-node/v1.js"() { - init_rng(); - init_stringify(); - _lastMSecs = 0; - _lastNSecs = 0; - __name(v1, "v1"); - v1_default = v1; - } -}); - -// node_modules/@actions/core/node_modules/uuid/dist/esm-node/parse.js -function parse(uuid) { - if (!validate_default(uuid)) { - throw TypeError("Invalid UUID"); - } - let v; - const arr = new Uint8Array(16); - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 255; - arr[2] = v >>> 8 & 255; - arr[3] = v & 255; - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 255; - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 255; - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 255; - arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255; - arr[11] = v / 4294967296 & 255; - arr[12] = v >>> 24 & 255; - arr[13] = v >>> 16 & 255; - arr[14] = v >>> 8 & 255; - arr[15] = v & 255; - return arr; -} -var parse_default; -var init_parse = __esm({ - "node_modules/@actions/core/node_modules/uuid/dist/esm-node/parse.js"() { - init_validate(); - __name(parse, "parse"); - parse_default = parse; - } -}); - -// node_modules/@actions/core/node_modules/uuid/dist/esm-node/v35.js -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); - const bytes = []; - for (let i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); - } - return bytes; -} -function v35_default(name, version2, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - if (typeof value === "string") { - value = stringToBytes(value); - } - if (typeof namespace === "string") { - namespace = parse_default(namespace); - } - if (namespace.length !== 16) { - throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)"); - } - let bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 15 | version2; - bytes[8] = bytes[8] & 63 | 128; - if (buf) { - offset = offset || 0; - for (let i = 0; i < 16; ++i) { - buf[offset + i] = bytes[i]; - } - return buf; - } - return stringify_default(bytes); - } - __name(generateUUID, "generateUUID"); - try { - generateUUID.name = name; - } catch (err) { - } - generateUUID.DNS = DNS; - generateUUID.URL = URL2; - return generateUUID; -} -var DNS, URL2; -var init_v35 = __esm({ - "node_modules/@actions/core/node_modules/uuid/dist/esm-node/v35.js"() { - init_stringify(); - init_parse(); - __name(stringToBytes, "stringToBytes"); - DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; - URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; - __name(v35_default, "default"); - } -}); - -// node_modules/@actions/core/node_modules/uuid/dist/esm-node/md5.js -function md5(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === "string") { - bytes = Buffer.from(bytes, "utf8"); - } - return import_crypto2.default.createHash("md5").update(bytes).digest(); -} -var import_crypto2, md5_default; -var init_md5 = __esm({ - "node_modules/@actions/core/node_modules/uuid/dist/esm-node/md5.js"() { - import_crypto2 = __toESM(require("crypto")); - __name(md5, "md5"); - md5_default = md5; - } -}); - -// node_modules/@actions/core/node_modules/uuid/dist/esm-node/v3.js -var v3, v3_default; -var init_v3 = __esm({ - "node_modules/@actions/core/node_modules/uuid/dist/esm-node/v3.js"() { - init_v35(); - init_md5(); - v3 = v35_default("v3", 48, md5_default); - v3_default = v3; - } -}); - -// node_modules/@actions/core/node_modules/uuid/dist/esm-node/v4.js -function v4(options, buf, offset) { - options = options || {}; - const rnds = options.random || (options.rng || rng)(); - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - offset = offset || 0; - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - return buf; - } - return stringify_default(rnds); -} -var v4_default; -var init_v4 = __esm({ - "node_modules/@actions/core/node_modules/uuid/dist/esm-node/v4.js"() { - init_rng(); - init_stringify(); - __name(v4, "v4"); - v4_default = v4; - } -}); - -// node_modules/@actions/core/node_modules/uuid/dist/esm-node/sha1.js -function sha1(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === "string") { - bytes = Buffer.from(bytes, "utf8"); - } - return import_crypto3.default.createHash("sha1").update(bytes).digest(); -} -var import_crypto3, sha1_default; -var init_sha1 = __esm({ - "node_modules/@actions/core/node_modules/uuid/dist/esm-node/sha1.js"() { - import_crypto3 = __toESM(require("crypto")); - __name(sha1, "sha1"); - sha1_default = sha1; - } -}); - -// node_modules/@actions/core/node_modules/uuid/dist/esm-node/v5.js -var v5, v5_default; -var init_v5 = __esm({ - "node_modules/@actions/core/node_modules/uuid/dist/esm-node/v5.js"() { - init_v35(); - init_sha1(); - v5 = v35_default("v5", 80, sha1_default); - v5_default = v5; - } -}); - -// node_modules/@actions/core/node_modules/uuid/dist/esm-node/nil.js -var nil_default; -var init_nil = __esm({ - "node_modules/@actions/core/node_modules/uuid/dist/esm-node/nil.js"() { - nil_default = "00000000-0000-0000-0000-000000000000"; - } -}); - -// node_modules/@actions/core/node_modules/uuid/dist/esm-node/version.js -function version(uuid) { - if (!validate_default(uuid)) { - throw TypeError("Invalid UUID"); - } - return parseInt(uuid.substr(14, 1), 16); -} -var version_default; -var init_version = __esm({ - "node_modules/@actions/core/node_modules/uuid/dist/esm-node/version.js"() { - init_validate(); - __name(version, "version"); - version_default = version; - } -}); - -// node_modules/@actions/core/node_modules/uuid/dist/esm-node/index.js -var esm_node_exports = {}; -__export(esm_node_exports, { - NIL: () => nil_default, - parse: () => parse_default, - stringify: () => stringify_default, - v1: () => v1_default, - v3: () => v3_default, - v4: () => v4_default, - v5: () => v5_default, - validate: () => validate_default, - version: () => version_default -}); -var init_esm_node = __esm({ - "node_modules/@actions/core/node_modules/uuid/dist/esm-node/index.js"() { - init_v1(); - init_v3(); - init_v4(); - init_v5(); - init_nil(); - init_version(); - init_validate(); - init_stringify(); - init_parse(); - } -}); - // node_modules/@actions/core/lib/file-command.js var require_file_command = __commonJS({ "node_modules/@actions/core/lib/file-command.js"(exports2) { @@ -2369,9 +2100,13 @@ var require_file_command = __commonJS({ var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { if (k2 === void 0) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); } : function(o, m, k, k2) { if (k2 === void 0) k2 = k; @@ -2388,7 +2123,7 @@ var require_file_command = __commonJS({ var result = {}; if (mod != null) { for (var k in mod) - if (k !== "default" && Object.hasOwnProperty.call(mod, k)) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } __setModuleDefault2(result, mod); @@ -2396,9 +2131,9 @@ var require_file_command = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); var fs = __importStar2(require("fs")); var os2 = __importStar2(require("os")); - var uuid_1 = (init_esm_node(), __toCommonJS(esm_node_exports)); var utils_1 = require_utils(); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -2408,15 +2143,15 @@ var require_file_command = __commonJS({ if (!fs.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os2.EOL}`, { + fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { encoding: "utf8" }); } __name(issueFileCommand, "issueFileCommand"); exports2.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${uuid_1.v4()}`; - const convertedValue = utils_1.toCommandValue(value); + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); if (key.includes(delimiter)) { throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } @@ -3240,7 +2975,7 @@ var require_util = __commonJS({ var { InvalidArgumentError } = require_errors(); var { Blob: Blob2 } = require("buffer"); var nodeUtil = require("util"); - var { stringify: stringify2 } = require("querystring"); + var { stringify } = require("querystring"); var { headerNameLowerCasedRecord } = require_constants2(); var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v) => Number(v)); function nop() { @@ -3258,7 +2993,7 @@ var require_util = __commonJS({ if (url.includes("?") || url.includes("#")) { throw new Error('Query params cannot be passed when url already contains "?" or "#".'); } - const stringified = stringify2(queryParams); + const stringified = stringify(queryParams); if (stringified) { url += "?" + stringified; } @@ -3396,8 +3131,8 @@ var require_util = __commonJS({ } __name(destroy, "destroy"); var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; - function parseKeepAliveTimeout(val2) { - const m = val2.toString().match(KEEPALIVE_TIMEOUT_EXPR); + function parseKeepAliveTimeout(val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); return m ? parseInt(m[1], 10) * 1e3 : null; } __name(parseKeepAliveTimeout, "parseKeepAliveTimeout"); @@ -3410,19 +3145,19 @@ var require_util = __commonJS({ return headers; for (let i = 0; i < headers.length; i += 2) { const key = headers[i].toString().toLowerCase(); - let val2 = obj[key]; - if (!val2) { + let val = obj[key]; + if (!val) { if (Array.isArray(headers[i + 1])) { obj[key] = headers[i + 1].map((x) => x.toString("utf8")); } else { obj[key] = headers[i + 1].toString("utf8"); } } else { - if (!Array.isArray(val2)) { - val2 = [val2]; - obj[key] = val2; + if (!Array.isArray(val)) { + val = [val]; + obj[key] = val; } - val2.push(headers[i + 1].toString("utf8")); + val.push(headers[i + 1].toString("utf8")); } } if ("content-length" in obj && "content-disposition" in obj) { @@ -3437,14 +3172,14 @@ var require_util = __commonJS({ let contentDispositionIdx = -1; for (let n = 0; n < headers.length; n += 2) { const key = headers[n + 0].toString(); - const val2 = headers[n + 1].toString("utf8"); + const val = headers[n + 1].toString("utf8"); if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) { - ret.push(key, val2); + ret.push(key, val); hasContentLength = true; } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { - contentDispositionIdx = ret.push(key, val2) - 1; + contentDispositionIdx = ret.push(key, val) - 1; } else { - ret.push(key, val2); + ret.push(key, val); } } if (hasContentLength && contentDispositionIdx !== -1) { @@ -3585,13 +3320,13 @@ var require_util = __commonJS({ } __name(addAbortListener, "addAbortListener"); var hasToWellFormed = !!String.prototype.toWellFormed; - function toUSVString(val2) { + function toUSVString(val) { if (hasToWellFormed) { - return `${val2}`.toWellFormed(); + return `${val}`.toWellFormed(); } else if (nodeUtil.toUSVString) { - return nodeUtil.toUSVString(val2); + return nodeUtil.toUSVString(val); } - return `${val2}`; + return `${val}`; } __name(toUSVString, "toUSVString"); function parseRangeHeader(range) { @@ -5986,11 +5721,11 @@ var require_util2 = __commonJS({ var assert = require("assert"); var { isUint8Array } = require("util/types"); var supportedHashes = []; - var crypto4; + var crypto2; try { - crypto4 = require("crypto"); + crypto2 = require("crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto4.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); + supportedHashes = crypto2.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); } catch { } function responseURL(response) { @@ -6280,7 +6015,7 @@ var require_util2 = __commonJS({ } __name(isURLPotentiallyTrustworthy, "isURLPotentiallyTrustworthy"); function bytesMatch(bytes, metadataList) { - if (crypto4 === void 0) { + if (crypto2 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -6295,7 +6030,7 @@ var require_util2 = __commonJS({ for (const item of metadata) { const algorithm = item.algo; const expectedValue = item.hash; - let actualValue = crypto4.createHash(algorithm).update(bytes).digest("base64"); + let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); @@ -7693,6 +7428,13 @@ var require_body = __commonJS({ var { isUint8Array, isArrayBuffer } = require("util/types"); var { File: UndiciFile } = require_file(); var { parseMIMEType, serializeAMimeType } = require_dataURL(); + var random; + try { + const crypto2 = require("node:crypto"); + random = /* @__PURE__ */ __name((max) => crypto2.randomInt(0, max), "random"); + } catch { + random = /* @__PURE__ */ __name((max) => Math.floor(Math.random(max)), "random"); + } var ReadableStream2 = globalThis.ReadableStream; var File2 = NativeFile ?? UndiciFile; var textEncoder = new TextEncoder(); @@ -7735,7 +7477,7 @@ var require_body = __commonJS({ } else if (ArrayBuffer.isView(object)) { source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)); } else if (util.isFormDataLike(object)) { - const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, "0")}`; + const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; const prefix = `--${boundary}\r Content-Disposition: form-data`; const escape = /* @__PURE__ */ __name((str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), "escape"); @@ -8362,44 +8104,44 @@ var require_request = __commonJS({ return headers; } }; - function processHeaderValue(key, val2, skipAppend) { - if (val2 && typeof val2 === "object") { + function processHeaderValue(key, val, skipAppend) { + if (val && typeof val === "object") { throw new InvalidArgumentError(`invalid ${key} header`); } - val2 = val2 != null ? `${val2}` : ""; - if (headerCharRegex.exec(val2) !== null) { + val = val != null ? `${val}` : ""; + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - return skipAppend ? val2 : `${key}: ${val2}\r + return skipAppend ? val : `${key}: ${val}\r `; } __name(processHeaderValue, "processHeaderValue"); - function processHeader(request, key, val2, skipAppend = false) { - if (val2 && (typeof val2 === "object" && !Array.isArray(val2))) { + function processHeader(request, key, val, skipAppend = false) { + if (val && (typeof val === "object" && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`); - } else if (val2 === void 0) { + } else if (val === void 0) { return; } if (request.host === null && key.length === 4 && key.toLowerCase() === "host") { - if (headerCharRegex.exec(val2) !== null) { + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - request.host = val2; + request.host = val; } else if (request.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { - request.contentLength = parseInt(val2, 10); + 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 = val2; + request.contentType = val; if (skipAppend) - request.headers[key] = processHeaderValue(key, val2, skipAppend); + request.headers[key] = processHeaderValue(key, val, skipAppend); else - request.headers += processHeaderValue(key, val2); + 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 val2 === "string" ? val2.toLowerCase() : null; + const value = typeof val === "string" ? val.toLowerCase() : null; if (value !== "close" && value !== "keep-alive") { throw new InvalidArgumentError("invalid connection header"); } else if (value === "close") { @@ -8414,22 +8156,22 @@ var require_request = __commonJS({ } else if (tokenRegExp.exec(key) === null) { throw new InvalidArgumentError("invalid header key"); } else { - if (Array.isArray(val2)) { - for (let i = 0; i < val2.length; i++) { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { if (skipAppend) { if (request.headers[key]) - request.headers[key] += `,${processHeaderValue(key, val2[i], skipAppend)}`; + request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`; else - request.headers[key] = processHeaderValue(key, val2[i], skipAppend); + request.headers[key] = processHeaderValue(key, val[i], skipAppend); } else { - request.headers += processHeaderValue(key, val2[i]); + request.headers += processHeaderValue(key, val[i]); } } } else { if (skipAppend) - request.headers[key] = processHeaderValue(key, val2, skipAppend); + request.headers[key] = processHeaderValue(key, val, skipAppend); else - request.headers += processHeaderValue(key, val2); + request.headers += processHeaderValue(key, val); } } } @@ -11399,6 +11141,14 @@ var require_pool = __commonJS({ this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; + this.on("connectionError", (origin2, targets, error) => { + for (const target of targets) { + const idx = this[kClients].indexOf(target); + if (idx !== -1) { + this[kClients].splice(idx, 1); + } + } + }); } [kGetDispatcher]() { let dispatcher = this[kClients].find((dispatcher2) => !dispatcher2[kNeedDrain]); @@ -13683,7 +13433,7 @@ var require_proxy_agent = __commonJS({ "node_modules/undici/lib/proxy-agent.js"(exports2, module2) { "use strict"; var { kProxy, kClose, kDestroy, kInterceptors } = require_symbols(); - var { URL: URL3 } = require("url"); + var { URL: URL2 } = require("url"); var Agent = require_agent(); var Pool = require_pool(); var DispatcherBase = require_dispatcher_base(); @@ -13738,7 +13488,7 @@ var require_proxy_agent = __commonJS({ this[kRequestTls] = opts.requestTls; this[kProxyTls] = opts.proxyTls; this[kProxyHeaders] = opts.headers || {}; - const resolvedUrl = new URL3(opts.uri); + const resolvedUrl = new URL2(opts.uri); const { origin, port, host, username, password } = resolvedUrl; if (opts.auth && opts.token) { throw new InvalidArgumentError("opts.auth cannot be used in combination with opts.token"); @@ -13793,7 +13543,7 @@ var require_proxy_agent = __commonJS({ }); } dispatch(opts, handler) { - const { host } = new URL3(opts.origin); + const { host } = new URL2(opts.origin); const headers = buildHeaders(opts.headers); throwIfProxyAuthIsSent(headers); return this[kAgent].dispatch( @@ -14192,6 +13942,7 @@ var require_headers = __commonJS({ isValidHeaderName, isValidHeaderValue } = require_util2(); + var util = require("util"); var { webidl } = require_webidl(); var assert = require("assert"); var kHeadersMap = Symbol("headers map"); @@ -14555,6 +14306,9 @@ var require_headers = __commonJS({ [Symbol.toStringTag]: { value: "Headers", configurable: true + }, + [util.inspect.custom]: { + enumerable: false } }); webidl.converters.HeadersInit = function(V) { @@ -15236,8 +14990,8 @@ var require_request2 = __commonJS({ const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList); headersList.clear(); if (headers instanceof HeadersList) { - for (const [key, val2] of headers) { - headersList.append(key, val2); + for (const [key, val] of headers) { + headersList.append(key, val); } headersList.cookies = headers.cookies; } else { @@ -16555,24 +16309,24 @@ var require_fetch = __commonJS({ if (Array.isArray(headersList)) { for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); + const val = headersList[n + 1].toString("latin1"); if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()); + codings = val.toLowerCase().split(",").map((x) => x.trim()); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } else { const keys = Object.keys(headersList); for (const key of keys) { - const val2 = headersList[key]; + const val = headersList[key]; if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()).reverse(); + codings = val.toLowerCase().split(",").map((x) => x.trim()).reverse(); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } this.body = new Readable({ read: resume }); @@ -16639,8 +16393,8 @@ var require_fetch = __commonJS({ const headers = new Headers(); for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); - headers[kHeadersList].append(key, val2); + const val = headersList[n + 1].toString("latin1"); + headers[kHeadersList].append(key, val); } resolve({ status, @@ -18200,8 +17954,6 @@ var require_constants5 = __commonJS({ var require_util6 = __commonJS({ "node_modules/undici/lib/cookies/util.js"(exports2, module2) { "use strict"; - var assert = require("assert"); - var { kHeadersList } = require_symbols(); function isCTLExcludingHtab(value) { if (value.length === 0) { return false; @@ -18291,7 +18043,7 @@ var require_util6 = __commonJS({ } } __name(validateCookieMaxAge, "validateCookieMaxAge"); - function stringify2(cookie) { + function stringify(cookie) { if (cookie.name.length === 0) { return null; } @@ -18339,27 +18091,14 @@ var require_util6 = __commonJS({ } return out.join("; "); } - __name(stringify2, "stringify"); - 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; - } - __name(getHeadersList, "getHeadersList"); + __name(stringify, "stringify"); module2.exports = { isCTLExcludingHtab, - stringify: stringify2, - getHeadersList + validateCookieName, + validateCookiePath, + validateCookieValue, + toIMFDate, + stringify }; } }); @@ -18511,7 +18250,7 @@ var require_cookies = __commonJS({ "node_modules/undici/lib/cookies/index.js"(exports2, module2) { "use strict"; var { parseSetCookie } = require_parse2(); - var { stringify: stringify2, getHeadersList } = require_util6(); + var { stringify } = require_util6(); var { webidl } = require_webidl(); var { Headers } = require_headers(); function getCookies(headers) { @@ -18545,20 +18284,20 @@ var require_cookies = __commonJS({ function getSetCookies(headers) { webidl.argumentLengthCheck(arguments, 1, { header: "getSetCookies" }); webidl.brandCheck(headers, Headers, { strict: false }); - const cookies = getHeadersList(headers).cookies; + const cookies = headers.getSetCookie(); if (!cookies) { return []; } - return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair)); + return cookies.map((pair) => parseSetCookie(pair)); } __name(getSetCookies, "getSetCookies"); function setCookie(headers, cookie) { webidl.argumentLengthCheck(arguments, 2, { header: "setCookie" }); webidl.brandCheck(headers, Headers, { strict: false }); cookie = webidl.converters.Cookie(cookie); - const str = stringify2(cookie); + const str = stringify(cookie); if (str) { - headers.append("Set-Cookie", stringify2(cookie)); + headers.append("Set-Cookie", stringify(cookie)); } } __name(setCookie, "setCookie"); @@ -19072,9 +18811,9 @@ var require_connection = __commonJS({ channels.open = diagnosticsChannel.channel("undici:websocket:open"); channels.close = diagnosticsChannel.channel("undici:websocket:close"); channels.socketError = diagnosticsChannel.channel("undici:websocket:socket_error"); - var crypto4; + var crypto2; try { - crypto4 = require("crypto"); + crypto2 = require("crypto"); } catch { } function establishWebSocketConnection(url, protocols, ws, onEstablish, options) { @@ -19093,7 +18832,7 @@ var require_connection = __commonJS({ const headersList = new Headers(options.headers)[kHeadersList]; request.headersList = headersList; } - const keyValue = crypto4.randomBytes(16).toString("base64"); + const keyValue = crypto2.randomBytes(16).toString("base64"); request.headersList.append("sec-websocket-key", keyValue); request.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { @@ -19122,7 +18861,7 @@ var require_connection = __commonJS({ return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto4.createHash("sha1").update(keyValue + uid).digest("base64"); + const digest = crypto2.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); return; @@ -19206,9 +18945,9 @@ var require_frame = __commonJS({ "node_modules/undici/lib/websocket/frame.js"(exports2, module2) { "use strict"; var { maxUnsigned16Bit } = require_constants6(); - var crypto4; + var crypto2; try { - crypto4 = require("crypto"); + crypto2 = require("crypto"); } catch { } var WebsocketFrameSend = class { @@ -19220,7 +18959,7 @@ var require_frame = __commonJS({ */ constructor(data) { this.frameData = data; - this.maskKey = crypto4.randomBytes(4); + this.maskKey = crypto2.randomBytes(4); } createFrame(opcode) { const bodyLength = this.frameData?.byteLength ?? 0; @@ -20898,9 +20637,9 @@ var require_oidc_utils = __commonJS({ const encodedAudience = encodeURIComponent(audience); id_token_url = `${id_token_url}&audience=${encodedAudience}`; } - core_1.debug(`ID token url is ${id_token_url}`); + (0, core_1.debug)(`ID token url is ${id_token_url}`); const id_token = yield _OidcClient.getCall(id_token_url); - core_1.setSecret(id_token); + (0, core_1.setSecret)(id_token); return id_token; } catch (error) { throw new Error(`Error message: ${error.message}`); @@ -21220,9 +20959,13 @@ var require_path_utils = __commonJS({ var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { if (k2 === void 0) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); } : function(o, m, k, k2) { if (k2 === void 0) k2 = k; @@ -21239,7 +20982,7 @@ var require_path_utils = __commonJS({ var result = {}; if (mod != null) { for (var k in mod) - if (k !== "default" && Object.hasOwnProperty.call(mod, k)) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } __setModuleDefault2(result, mod); @@ -21266,260 +21009,6 @@ var require_path_utils = __commonJS({ } }); -// node_modules/@actions/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/core/lib/core.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault2(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); - } - __name(adopt, "adopt"); - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - __name(fulfilled, "fulfilled"); - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - __name(rejected, "rejected"); - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - __name(step, "step"); - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getIDToken = exports2.getState = exports2.saveState = exports2.group = exports2.endGroup = exports2.startGroup = exports2.info = exports2.notice = exports2.warning = exports2.error = exports2.debug = exports2.isDebug = exports2.setFailed = exports2.setCommandEcho = exports2.setOutput = exports2.getBooleanInput = exports2.getMultilineInput = exports2.getInput = exports2.addPath = exports2.setSecret = exports2.exportVariable = exports2.ExitCode = void 0; - var command_1 = require_command(); - var file_command_1 = require_file_command(); - var utils_1 = require_utils(); - var os2 = __importStar2(require("os")); - var path2 = __importStar2(require("path")); - var oidc_utils_1 = require_oidc_utils(); - var ExitCode; - (function(ExitCode2) { - ExitCode2[ExitCode2["Success"] = 0] = "Success"; - ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; - })(ExitCode = exports2.ExitCode || (exports2.ExitCode = {})); - function exportVariable(name, val2) { - const convertedVal = utils_1.toCommandValue(val2); - process.env[name] = convertedVal; - const filePath = process.env["GITHUB_ENV"] || ""; - if (filePath) { - return file_command_1.issueFileCommand("ENV", file_command_1.prepareKeyValueMessage(name, val2)); - } - command_1.issueCommand("set-env", { name }, convertedVal); - } - __name(exportVariable, "exportVariable"); - exports2.exportVariable = exportVariable; - function setSecret(secret) { - command_1.issueCommand("add-mask", {}, secret); - } - __name(setSecret, "setSecret"); - exports2.setSecret = setSecret; - function addPath(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}${path2.delimiter}${process.env["PATH"]}`; - } - __name(addPath, "addPath"); - exports2.addPath = addPath; - function getInput(name, options) { - const val2 = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val2) { - throw new Error(`Input required and not supplied: ${name}`); - } - if (options && options.trimWhitespace === false) { - return val2; - } - return val2.trim(); - } - __name(getInput, "getInput"); - exports2.getInput = getInput; - function getMultilineInput(name, options) { - const inputs = getInput(name, options).split("\n").filter((x) => x !== ""); - if (options && options.trimWhitespace === false) { - return inputs; - } - return inputs.map((input) => input.trim()); - } - __name(getMultilineInput, "getMultilineInput"); - exports2.getMultilineInput = getMultilineInput; - function getBooleanInput(name, options) { - const trueValue = ["true", "True", "TRUE"]; - const falseValue = ["false", "False", "FALSE"]; - const val2 = getInput(name, options); - if (trueValue.includes(val2)) - return true; - if (falseValue.includes(val2)) - return false; - throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name} -Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); - } - __name(getBooleanInput, "getBooleanInput"); - exports2.getBooleanInput = getBooleanInput; - function setOutput(name, value) { - const filePath = process.env["GITHUB_OUTPUT"] || ""; - if (filePath) { - return file_command_1.issueFileCommand("OUTPUT", file_command_1.prepareKeyValueMessage(name, value)); - } - process.stdout.write(os2.EOL); - command_1.issueCommand("set-output", { name }, utils_1.toCommandValue(value)); - } - __name(setOutput, "setOutput"); - exports2.setOutput = setOutput; - function setCommandEcho(enabled) { - command_1.issue("echo", enabled ? "on" : "off"); - } - __name(setCommandEcho, "setCommandEcho"); - exports2.setCommandEcho = setCommandEcho; - function setFailed(message) { - process.exitCode = ExitCode.Failure; - error(message); - } - __name(setFailed, "setFailed"); - exports2.setFailed = setFailed; - function isDebug() { - return process.env["RUNNER_DEBUG"] === "1"; - } - __name(isDebug, "isDebug"); - exports2.isDebug = isDebug; - function debug(message) { - command_1.issueCommand("debug", {}, message); - } - __name(debug, "debug"); - exports2.debug = debug; - function error(message, properties = {}) { - command_1.issueCommand("error", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); - } - __name(error, "error"); - exports2.error = error; - function warning(message, properties = {}) { - command_1.issueCommand("warning", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); - } - __name(warning, "warning"); - exports2.warning = warning; - function notice(message, properties = {}) { - command_1.issueCommand("notice", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); - } - __name(notice, "notice"); - exports2.notice = notice; - function info(message) { - process.stdout.write(message + os2.EOL); - } - __name(info, "info"); - exports2.info = info; - function startGroup(name) { - command_1.issue("group", name); - } - __name(startGroup, "startGroup"); - exports2.startGroup = startGroup; - function endGroup() { - command_1.issue("endgroup"); - } - __name(endGroup, "endGroup"); - exports2.endGroup = endGroup; - function group(name, fn) { - return __awaiter2(this, void 0, void 0, function* () { - startGroup(name); - let result; - try { - result = yield fn(); - } finally { - endGroup(); - } - return result; - }); - } - __name(group, "group"); - exports2.group = group; - function saveState(name, value) { - const filePath = process.env["GITHUB_STATE"] || ""; - if (filePath) { - return file_command_1.issueFileCommand("STATE", file_command_1.prepareKeyValueMessage(name, value)); - } - command_1.issueCommand("save-state", { name }, utils_1.toCommandValue(value)); - } - __name(saveState, "saveState"); - exports2.saveState = saveState; - function getState(name) { - return process.env[`STATE_${name}`] || ""; - } - __name(getState, "getState"); - exports2.getState = getState; - function getIDToken(aud) { - return __awaiter2(this, void 0, void 0, function* () { - return yield oidc_utils_1.OidcClient.getIDToken(aud); - }); - } - __name(getIDToken, "getIDToken"); - exports2.getIDToken = getIDToken; - var summary_1 = require_summary(); - Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { - return summary_1.summary; - } }); - var summary_2 = require_summary(); - Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { - return summary_2.markdownSummary; - } }); - var path_utils_1 = require_path_utils(); - Object.defineProperty(exports2, "toPosixPath", { enumerable: true, get: function() { - return path_utils_1.toPosixPath; - } }); - Object.defineProperty(exports2, "toWin32Path", { enumerable: true, get: function() { - return path_utils_1.toWin32Path; - } }); - Object.defineProperty(exports2, "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"(exports2) { @@ -22594,6 +22083,394 @@ var require_exec = __commonJS({ } }); +// node_modules/@actions/core/lib/platform.js +var require_platform = __commonJS({ + "node_modules/@actions/core/lib/platform.js"(exports2) { + "use strict"; + var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } : function(o, v) { + o["default"] = v; + }); + var __importStar2 = exports2 && exports2.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding2(result, mod, k); + } + __setModuleDefault2(result, mod); + return result; + }; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + __name(adopt, "adopt"); + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + __name(fulfilled, "fulfilled"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + __name(rejected, "rejected"); + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + __name(step, "step"); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; + var os_1 = __importDefault2(require("os")); + var exec = __importStar2(require_exec()); + var getWindowsInfo = /* @__PURE__ */ __name(() => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + silent: true + }); + return { + name: name.trim(), + version: version.trim() + }; + }), "getWindowsInfo"); + var getMacOsInfo = /* @__PURE__ */ __name(() => __awaiter2(void 0, void 0, void 0, function* () { + var _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; + const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : ""; + return { + name, + version + }; + }), "getMacOsInfo"); + var getLinuxInfo = /* @__PURE__ */ __name(() => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + silent: true + }); + const [name, version] = stdout.trim().split("\n"); + return { + name, + version + }; + }), "getLinuxInfo"); + exports2.platform = os_1.default.platform(); + exports2.arch = os_1.default.arch(); + exports2.isWindows = exports2.platform === "win32"; + exports2.isMacOS = exports2.platform === "darwin"; + exports2.isLinux = exports2.platform === "linux"; + function getDetails() { + return __awaiter2(this, void 0, void 0, function* () { + return Object.assign(Object.assign({}, yield exports2.isWindows ? getWindowsInfo() : exports2.isMacOS ? getMacOsInfo() : getLinuxInfo()), { + platform: exports2.platform, + arch: exports2.arch, + isWindows: exports2.isWindows, + isMacOS: exports2.isMacOS, + isLinux: exports2.isLinux + }); + }); + } + __name(getDetails, "getDetails"); + exports2.getDetails = getDetails; + } +}); + +// node_modules/@actions/core/lib/core.js +var require_core = __commonJS({ + "node_modules/@actions/core/lib/core.js"(exports2) { + "use strict"; + var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } : function(o, v) { + o["default"] = v; + }); + var __importStar2 = exports2 && exports2.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding2(result, mod, k); + } + __setModuleDefault2(result, mod); + return result; + }; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + __name(adopt, "adopt"); + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + __name(fulfilled, "fulfilled"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + __name(rejected, "rejected"); + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + __name(step, "step"); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.platform = exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = exports2.markdownSummary = exports2.summary = exports2.getIDToken = exports2.getState = exports2.saveState = exports2.group = exports2.endGroup = exports2.startGroup = exports2.info = exports2.notice = exports2.warning = exports2.error = exports2.debug = exports2.isDebug = exports2.setFailed = exports2.setCommandEcho = exports2.setOutput = exports2.getBooleanInput = exports2.getMultilineInput = exports2.getInput = exports2.addPath = exports2.setSecret = exports2.exportVariable = exports2.ExitCode = void 0; + var command_1 = require_command(); + var file_command_1 = require_file_command(); + var utils_1 = require_utils(); + var os2 = __importStar2(require("os")); + var path2 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable(name, val) { + const convertedVal = (0, utils_1.toCommandValue)(val); + process.env[name] = convertedVal; + const filePath = process.env["GITHUB_ENV"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); + } + (0, command_1.issueCommand)("set-env", { name }, convertedVal); + } + __name(exportVariable, "exportVariable"); + exports2.exportVariable = exportVariable; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + __name(setSecret, "setSecret"); + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); + } + process.env["PATH"] = `${inputPath}${path2.delimiter}${process.env["PATH"]}`; + } + __name(addPath, "addPath"); + exports2.addPath = addPath; + function getInput(name, options) { + const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; + if (options && options.required && !val) { + throw new Error(`Input required and not supplied: ${name}`); + } + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); + } + __name(getInput, "getInput"); + exports2.getInput = getInput; + function getMultilineInput(name, options) { + const inputs = getInput(name, options).split("\n").filter((x) => x !== ""); + if (options && options.trimWhitespace === false) { + return inputs; + } + return inputs.map((input) => input.trim()); + } + __name(getMultilineInput, "getMultilineInput"); + exports2.getMultilineInput = getMultilineInput; + function getBooleanInput(name, options) { + const trueValue = ["true", "True", "TRUE"]; + const falseValue = ["false", "False", "FALSE"]; + const val = getInput(name, 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: ${name} +Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); + } + __name(getBooleanInput, "getBooleanInput"); + exports2.getBooleanInput = getBooleanInput; + function setOutput(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); + } + process.stdout.write(os2.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + __name(setOutput, "setOutput"); + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + __name(setCommandEcho, "setCommandEcho"); + exports2.setCommandEcho = setCommandEcho; + function setFailed(message) { + process.exitCode = ExitCode.Failure; + error(message); + } + __name(setFailed, "setFailed"); + exports2.setFailed = setFailed; + function isDebug() { + return process.env["RUNNER_DEBUG"] === "1"; + } + __name(isDebug, "isDebug"); + exports2.isDebug = isDebug; + function debug(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + __name(debug, "debug"); + exports2.debug = debug; + function error(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + __name(error, "error"); + exports2.error = error; + function warning(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + __name(warning, "warning"); + exports2.warning = warning; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + __name(notice, "notice"); + exports2.notice = notice; + function info(message) { + process.stdout.write(message + os2.EOL); + } + __name(info, "info"); + exports2.info = info; + function startGroup(name) { + (0, command_1.issue)("group", name); + } + __name(startGroup, "startGroup"); + exports2.startGroup = startGroup; + function endGroup() { + (0, command_1.issue)("endgroup"); + } + __name(endGroup, "endGroup"); + exports2.endGroup = endGroup; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup(name); + let result; + try { + result = yield fn(); + } finally { + endGroup(); + } + return result; + }); + } + __name(group, "group"); + exports2.group = group; + function saveState(name, value) { + const filePath = process.env["GITHUB_STATE"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("STATE", (0, file_command_1.prepareKeyValueMessage)(name, value)); + } + (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); + } + __name(saveState, "saveState"); + exports2.saveState = saveState; + function getState(name) { + return process.env[`STATE_${name}`] || ""; + } + __name(getState, "getState"); + exports2.getState = getState; + function getIDToken(aud) { + return __awaiter2(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); + } + __name(getIDToken, "getIDToken"); + exports2.getIDToken = getIDToken; + var summary_1 = require_summary(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils(); + Object.defineProperty(exports2, "toPosixPath", { enumerable: true, get: function() { + return path_utils_1.toPosixPath; + } }); + Object.defineProperty(exports2, "toWin32Path", { enumerable: true, get: function() { + return path_utils_1.toWin32Path; + } }); + Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() { + return path_utils_1.toPlatformPath; + } }); + exports2.platform = __importStar2(require_platform()); + } +}); + // 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"(exports2) { @@ -23067,7 +22944,7 @@ var require_brace_expansion = __commonJS({ var isSequence = isNumericSequence || isAlphaSequence; var isOptions = m.body.indexOf(",") >= 0; if (!isSequence && !isOptions) { - if (m.post.match(/,.*\}/)) { + if (m.post.match(/,(?!,).*\}/)) { str = m.pre + "{" + m.body + escClose + m.post; return expand(str); } @@ -23347,9 +23224,9 @@ var require_minimatch = __commonJS({ throw new TypeError("pattern is too long"); } }, "assertValidPattern"); - Minimatch.prototype.parse = parse2; + Minimatch.prototype.parse = parse; var SUBPARSE = {}; - function parse2(pattern, isSub) { + function parse(pattern, isSub) { assertValidPattern(pattern); var options = this.options; if (pattern === "**") { @@ -23582,7 +23459,7 @@ var require_minimatch = __commonJS({ regExp._src = re; return regExp; } - __name(parse2, "parse"); + __name(parse, "parse"); minimatch.makeRe = function(pattern, options) { return new Minimatch(pattern, options || {}).makeRe(); }; @@ -24555,77 +24432,77 @@ var require_semver3 = __commonJS({ } } var i; - exports2.parse = parse2; - function parse2(version2, options) { + exports2.parse = parse; + function parse(version, options) { if (!options || typeof options !== "object") { options = { loose: !!options, includePrerelease: false }; } - if (version2 instanceof SemVer) { - return version2; + if (version instanceof SemVer) { + return version; } - if (typeof version2 !== "string") { + if (typeof version !== "string") { return null; } - if (version2.length > MAX_LENGTH) { + if (version.length > MAX_LENGTH) { return null; } var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]; - if (!r.test(version2)) { + if (!r.test(version)) { return null; } try { - return new SemVer(version2, options); + return new SemVer(version, options); } catch (er) { return null; } } - __name(parse2, "parse"); + __name(parse, "parse"); exports2.valid = valid; - function valid(version2, options) { - var v = parse2(version2, options); + function valid(version, options) { + var v = parse(version, options); return v ? v.version : null; } __name(valid, "valid"); exports2.clean = clean; - function clean(version2, options) { - var s = parse2(version2.trim().replace(/^[=v]+/, ""), options); + function clean(version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ""), options); return s ? s.version : null; } __name(clean, "clean"); exports2.SemVer = SemVer; - function SemVer(version2, options) { + function SemVer(version, options) { if (!options || typeof options !== "object") { options = { loose: !!options, includePrerelease: false }; } - if (version2 instanceof SemVer) { - if (version2.loose === options.loose) { - return version2; + if (version instanceof SemVer) { + if (version.loose === options.loose) { + return version; } else { - version2 = version2.version; + version = version.version; } - } else if (typeof version2 !== "string") { - throw new TypeError("Invalid Version: " + version2); + } else if (typeof version !== "string") { + throw new TypeError("Invalid Version: " + version); } - if (version2.length > MAX_LENGTH) { + if (version.length > MAX_LENGTH) { throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); } if (!(this instanceof SemVer)) { - return new SemVer(version2, options); + return new SemVer(version, options); } - debug("SemVer", version2, options); + debug("SemVer", version, options); this.options = options; this.loose = !!options.loose; - var m = version2.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]); + var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]); if (!m) { - throw new TypeError("Invalid Version: " + version2); + throw new TypeError("Invalid Version: " + version); } - this.raw = version2; + this.raw = version; this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; @@ -24809,13 +24686,13 @@ var require_semver3 = __commonJS({ return this; }; exports2.inc = inc; - function inc(version2, release, loose, identifier) { + function inc(version, release, loose, identifier) { if (typeof loose === "string") { identifier = loose; loose = void 0; } try { - return new SemVer(version2, loose).inc(release, identifier).version; + return new SemVer(version, loose).inc(release, identifier).version; } catch (er) { return null; } @@ -24826,16 +24703,16 @@ var require_semver3 = __commonJS({ if (eq(version1, version2)) { return null; } else { - var v12 = parse2(version1); - var v2 = parse2(version2); + var v1 = parse(version1); + var v2 = parse(version2); var prefix = ""; - if (v12.prerelease.length || v2.prerelease.length) { + if (v1.prerelease.length || v2.prerelease.length) { prefix = "pre"; var defaultResult = "prerelease"; } - for (var key in v12) { + for (var key in v1) { if (key === "major" || key === "minor" || key === "patch") { - if (v12[key] !== v2[key]) { + if (v1[key] !== v2[key]) { return prefix + key; } } @@ -25027,19 +24904,19 @@ var require_semver3 = __commonJS({ Comparator.prototype.toString = function() { return this.value; }; - Comparator.prototype.test = function(version2) { - debug("Comparator.test", version2, this.options.loose); - if (this.semver === ANY || version2 === ANY) { + Comparator.prototype.test = function(version) { + debug("Comparator.test", version, this.options.loose); + if (this.semver === ANY || version === ANY) { return true; } - if (typeof version2 === "string") { + if (typeof version === "string") { try { - version2 = new SemVer(version2, this.options); + version = new SemVer(version, this.options); } catch (er) { return false; } } - return cmp(version2, this.operator, this.semver, this.options); + return cmp(version, this.operator, this.semver, this.options); }; Comparator.prototype.intersects = function(comp, options) { if (!(comp instanceof Comparator)) { @@ -25362,31 +25239,31 @@ var require_semver3 = __commonJS({ return (from + " " + to).trim(); } __name(hyphenReplace, "hyphenReplace"); - Range.prototype.test = function(version2) { - if (!version2) { + Range.prototype.test = function(version) { + if (!version) { return false; } - if (typeof version2 === "string") { + if (typeof version === "string") { try { - version2 = new SemVer(version2, this.options); + version = new SemVer(version, this.options); } catch (er) { return false; } } for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version2, this.options)) { + if (testSet(this.set[i2], version, this.options)) { return true; } } return false; }; - function testSet(set, version2, options) { + function testSet(set, version, options) { for (var i2 = 0; i2 < set.length; i2++) { - if (!set[i2].test(version2)) { + if (!set[i2].test(version)) { return false; } } - if (version2.prerelease.length && !options.includePrerelease) { + if (version.prerelease.length && !options.includePrerelease) { for (i2 = 0; i2 < set.length; i2++) { debug(set[i2].semver); if (set[i2].semver === ANY) { @@ -25394,7 +25271,7 @@ var require_semver3 = __commonJS({ } if (set[i2].semver.prerelease.length > 0) { var allowed = set[i2].semver; - if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) { + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true; } } @@ -25405,13 +25282,13 @@ var require_semver3 = __commonJS({ } __name(testSet, "testSet"); exports2.satisfies = satisfies; - function satisfies(version2, range, options) { + function satisfies(version, range, options) { try { range = new Range(range, options); } catch (er) { return false; } - return range.test(version2); + return range.test(version); } __name(satisfies, "satisfies"); exports2.maxSatisfying = maxSatisfying; @@ -25508,18 +25385,18 @@ var require_semver3 = __commonJS({ } __name(validRange, "validRange"); exports2.ltr = ltr; - function ltr(version2, range, options) { - return outside(version2, range, "<", options); + function ltr(version, range, options) { + return outside(version, range, "<", options); } __name(ltr, "ltr"); exports2.gtr = gtr; - function gtr(version2, range, options) { - return outside(version2, range, ">", options); + function gtr(version, range, options) { + return outside(version, range, ">", options); } __name(gtr, "gtr"); exports2.outside = outside; - function outside(version2, range, hilo, options) { - version2 = new SemVer(version2, options); + function outside(version, range, hilo, options) { + version = new SemVer(version, options); range = new Range(range, options); var gtfn, ltefn, ltfn, comp, ecomp; switch (hilo) { @@ -25540,7 +25417,7 @@ var require_semver3 = __commonJS({ default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } - if (satisfies(version2, range, options)) { + if (satisfies(version, range, options)) { return false; } for (var i2 = 0; i2 < range.set.length; ++i2) { @@ -25562,9 +25439,9 @@ var require_semver3 = __commonJS({ if (high.operator === comp || high.operator === ecomp) { return false; } - if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) { + if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false; - } else if (low.operator === ecomp && ltfn(version2, low.semver)) { + } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false; } } @@ -25572,8 +25449,8 @@ var require_semver3 = __commonJS({ } __name(outside, "outside"); exports2.prerelease = prerelease; - function prerelease(version2, options) { - var parsed = parse2(version2, options); + function prerelease(version, options) { + var parsed = parse(version, options); return parsed && parsed.prerelease.length ? parsed.prerelease : null; } __name(prerelease, "prerelease"); @@ -25585,23 +25462,23 @@ var require_semver3 = __commonJS({ } __name(intersects, "intersects"); exports2.coerce = coerce; - function coerce(version2, options) { - if (version2 instanceof SemVer) { - return version2; + function coerce(version, options) { + if (version instanceof SemVer) { + return version; } - if (typeof version2 === "number") { - version2 = String(version2); + if (typeof version === "number") { + version = String(version); } - if (typeof version2 !== "string") { + if (typeof version !== "string") { return null; } options = options || {}; var match = null; if (!options.rtl) { - match = version2.match(safeRe[t.COERCE]); + match = version.match(safeRe[t.COERCE]); } else { var next; - while ((next = safeRe[t.COERCERTL].exec(version2)) && (!match || match.index + match[0].length !== version2.length)) { + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next; } @@ -25612,169 +25489,12 @@ var require_semver3 = __commonJS({ if (match === null) { return null; } - return parse2(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); + return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); } __name(coerce, "coerce"); } }); -// node_modules/uuid/lib/rng.js -var require_rng = __commonJS({ - "node_modules/uuid/lib/rng.js"(exports2, module2) { - var crypto4 = require("crypto"); - module2.exports = /* @__PURE__ */ __name(function nodeRNG() { - return crypto4.randomBytes(16); - }, "nodeRNG"); - } -}); - -// node_modules/uuid/lib/bytesToUuid.js -var require_bytesToUuid = __commonJS({ - "node_modules/uuid/lib/bytesToUuid.js"(exports2, module2) { - var byteToHex2 = []; - for (i = 0; i < 256; ++i) { - byteToHex2[i] = (i + 256).toString(16).substr(1); - } - var i; - function bytesToUuid(buf, offset) { - var i2 = offset || 0; - var bth = byteToHex2; - return [ - bth[buf[i2++]], - bth[buf[i2++]], - bth[buf[i2++]], - bth[buf[i2++]], - "-", - bth[buf[i2++]], - bth[buf[i2++]], - "-", - bth[buf[i2++]], - bth[buf[i2++]], - "-", - bth[buf[i2++]], - bth[buf[i2++]], - "-", - bth[buf[i2++]], - bth[buf[i2++]], - bth[buf[i2++]], - bth[buf[i2++]], - bth[buf[i2++]], - bth[buf[i2++]] - ].join(""); - } - __name(bytesToUuid, "bytesToUuid"); - module2.exports = bytesToUuid; - } -}); - -// node_modules/uuid/v1.js -var require_v1 = __commonJS({ - "node_modules/uuid/v1.js"(exports2, module2) { - var rng2 = require_rng(); - var bytesToUuid = require_bytesToUuid(); - var _nodeId2; - var _clockseq2; - var _lastMSecs2 = 0; - var _lastNSecs2 = 0; - function v12(options, buf, offset) { - var i = buf && offset || 0; - var b = buf || []; - options = options || {}; - var node = options.node || _nodeId2; - var clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq2; - if (node == null || clockseq == null) { - var seedBytes = rng2(); - 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 dt = msecs - _lastMSecs2 + (nsecs - _lastNSecs2) / 1e4; - if (dt < 0 && options.clockseq === void 0) { - clockseq = clockseq + 1 & 16383; - } - if ((dt < 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; - b[i++] = tl >>> 24 & 255; - b[i++] = tl >>> 16 & 255; - b[i++] = tl >>> 8 & 255; - b[i++] = tl & 255; - var tmh = msecs / 4294967296 * 1e4 & 268435455; - b[i++] = tmh >>> 8 & 255; - b[i++] = tmh & 255; - b[i++] = tmh >>> 24 & 15 | 16; - b[i++] = tmh >>> 16 & 255; - b[i++] = clockseq >>> 8 | 128; - b[i++] = clockseq & 255; - for (var n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - return buf ? buf : bytesToUuid(b); - } - __name(v12, "v1"); - module2.exports = v12; - } -}); - -// node_modules/uuid/v4.js -var require_v4 = __commonJS({ - "node_modules/uuid/v4.js"(exports2, module2) { - var rng2 = require_rng(); - var bytesToUuid = require_bytesToUuid(); - function v42(options, buf, offset) { - var i = buf && offset || 0; - if (typeof options == "string") { - buf = options === "binary" ? new Array(16) : null; - options = null; - } - options = options || {}; - var rnds = options.random || (options.rng || rng2)(); - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - for (var ii = 0; ii < 16; ++ii) { - buf[i + ii] = rnds[ii]; - } - } - return buf || bytesToUuid(rnds); - } - __name(v42, "v4"); - module2.exports = v42; - } -}); - -// node_modules/uuid/index.js -var require_uuid = __commonJS({ - "node_modules/uuid/index.js"(exports2, module2) { - var v12 = require_v1(); - var v42 = require_v4(); - var uuid = v42; - uuid.v1 = v12; - uuid.v4 = v42; - module2.exports = uuid; - } -}); - // node_modules/@actions/cache/lib/internal/constants.js var require_constants7 = __commonJS({ "node_modules/@actions/cache/lib/internal/constants.js"(exports2) { @@ -25902,11 +25622,11 @@ var require_cacheUtils = __commonJS({ var exec = __importStar2(require_exec()); var glob = __importStar2(require_glob()); var io = __importStar2(require_io()); + var crypto2 = __importStar2(require("crypto")); var fs = __importStar2(require("fs")); var path2 = __importStar2(require("path")); var semver2 = __importStar2(require_semver3()); var util = __importStar2(require("util")); - var uuid_1 = require_uuid(); var constants_1 = require_constants7(); function createTempDirectory() { return __awaiter2(this, void 0, void 0, function* () { @@ -25925,7 +25645,7 @@ var require_cacheUtils = __commonJS({ } tempDirectory = path2.join(baseLocation, "actions", "temp"); } - const dest = path2.join(tempDirectory, (0, uuid_1.v4)()); + const dest = path2.join(tempDirectory, crypto2.randomUUID()); yield io.mkdirP(dest); return dest; }); @@ -26008,8 +25728,8 @@ var require_cacheUtils = __commonJS({ function getCompressionMethod() { return __awaiter2(this, void 0, void 0, function* () { const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version2 = semver2.clean(versionOutput); - core.debug(`zstd version: ${version2}`); + const version = semver2.clean(versionOutput); + core.debug(`zstd version: ${version}`); if (versionOutput === "") { return constants_1.CompressionMethod.Gzip; } else { @@ -26055,202 +25775,6 @@ var require_cacheUtils = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js -var require_pipeline = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createEmptyPipeline = createEmptyPipeline; - var ValidPhaseNames = /* @__PURE__ */ new Set(["Deserialize", "Serialize", "Retry", "Sign"]); - var HttpPipeline = class _HttpPipeline { - static { - __name(this, "HttpPipeline"); - } - constructor(policies) { - var _a; - this._policies = []; - this._policies = (_a = policies === null || policies === void 0 ? void 0 : policies.slice(0)) !== null && _a !== void 0 ? _a : []; - this._orderedPolicies = void 0; - } - addPolicy(policy, options = {}) { - if (options.phase && options.afterPhase) { - throw new Error("Policies inside a phase cannot specify afterPhase."); - } - if (options.phase && !ValidPhaseNames.has(options.phase)) { - throw new Error(`Invalid phase name: ${options.phase}`); - } - if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { - throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); - } - this._policies.push({ - policy, - options - }); - this._orderedPolicies = void 0; - } - removePolicy(options) { - const removedPolicies = []; - this._policies = this._policies.filter((policyDescriptor) => { - if (options.name && policyDescriptor.policy.name === options.name || options.phase && policyDescriptor.options.phase === options.phase) { - removedPolicies.push(policyDescriptor.policy); - return false; - } else { - return true; - } - }); - this._orderedPolicies = void 0; - return removedPolicies; - } - sendRequest(httpClient, request) { - const policies = this.getOrderedPolicies(); - const pipeline = policies.reduceRight((next, policy) => { - return (req) => { - return policy.sendRequest(req, next); - }; - }, (req) => httpClient.sendRequest(req)); - return pipeline(request); - } - getOrderedPolicies() { - if (!this._orderedPolicies) { - this._orderedPolicies = this.orderPolicies(); - } - return this._orderedPolicies; - } - clone() { - return new _HttpPipeline(this._policies); - } - static create() { - return new _HttpPipeline(); - } - orderPolicies() { - const result = []; - const policyMap = /* @__PURE__ */ new Map(); - function createPhase(name) { - return { - name, - policies: /* @__PURE__ */ new Set(), - hasRun: false, - hasAfterPolicies: false - }; - } - __name(createPhase, "createPhase"); - const serializePhase = createPhase("Serialize"); - const noPhase = createPhase("None"); - const deserializePhase = createPhase("Deserialize"); - const retryPhase = createPhase("Retry"); - const signPhase = createPhase("Sign"); - const orderedPhases = [serializePhase, noPhase, deserializePhase, retryPhase, signPhase]; - function getPhase(phase) { - if (phase === "Retry") { - return retryPhase; - } else if (phase === "Serialize") { - return serializePhase; - } else if (phase === "Deserialize") { - return deserializePhase; - } else if (phase === "Sign") { - return signPhase; - } else { - return noPhase; - } - } - __name(getPhase, "getPhase"); - for (const descriptor of this._policies) { - const policy = descriptor.policy; - const options = descriptor.options; - const policyName = policy.name; - if (policyMap.has(policyName)) { - throw new Error("Duplicate policy names not allowed in pipeline"); - } - const node = { - policy, - dependsOn: /* @__PURE__ */ new Set(), - dependants: /* @__PURE__ */ new Set() - }; - if (options.afterPhase) { - node.afterPhase = getPhase(options.afterPhase); - node.afterPhase.hasAfterPolicies = true; - } - policyMap.set(policyName, node); - const phase = getPhase(options.phase); - phase.policies.add(node); - } - for (const descriptor of this._policies) { - const { policy, options } = descriptor; - const policyName = policy.name; - const node = policyMap.get(policyName); - if (!node) { - throw new Error(`Missing node for policy ${policyName}`); - } - if (options.afterPolicies) { - for (const afterPolicyName of options.afterPolicies) { - const afterNode = policyMap.get(afterPolicyName); - if (afterNode) { - node.dependsOn.add(afterNode); - afterNode.dependants.add(node); - } - } - } - if (options.beforePolicies) { - for (const beforePolicyName of options.beforePolicies) { - const beforeNode = policyMap.get(beforePolicyName); - if (beforeNode) { - beforeNode.dependsOn.add(node); - node.dependants.add(beforeNode); - } - } - } - } - function walkPhase(phase) { - phase.hasRun = true; - for (const node of phase.policies) { - if (node.afterPhase && (!node.afterPhase.hasRun || node.afterPhase.policies.size)) { - continue; - } - if (node.dependsOn.size === 0) { - result.push(node.policy); - for (const dependant of node.dependants) { - dependant.dependsOn.delete(node); - } - policyMap.delete(node.policy.name); - phase.policies.delete(node); - } - } - } - __name(walkPhase, "walkPhase"); - function walkPhases() { - for (const phase of orderedPhases) { - walkPhase(phase); - if (phase.policies.size > 0 && phase !== noPhase) { - if (!noPhase.hasRun) { - walkPhase(noPhase); - } - return; - } - if (phase.hasAfterPolicies) { - walkPhase(noPhase); - } - } - } - __name(walkPhases, "walkPhases"); - let iteration = 0; - while (policyMap.size > 0) { - iteration++; - const initialResultLength = result.length; - walkPhases(); - if (result.length <= initialResultLength && iteration > 1) { - throw new Error("Cannot satisfy policy dependencies due to requirements cycle."); - } - } - return result; - } - }; - function createEmptyPipeline() { - return HttpPipeline.create(); - } - __name(createEmptyPipeline, "createEmptyPipeline"); - } -}); - // node_modules/tslib/tslib.es6.mjs var tslib_es6_exports = {}; __export(tslib_es6_exports, { @@ -26279,6 +25803,7 @@ __export(tslib_es6_exports, { __propKey: () => __propKey, __read: () => __read, __rest: () => __rest, + __rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension, __runInitializers: () => __runInitializers, __setFunctionName: () => __setFunctionName, __spread: () => __spread, @@ -26664,9 +26189,9 @@ function __importStar(mod) { return mod; var result = {}; if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); + for (var k = ownKeys(mod), i = 0; i < k.length; i++) + if (k[i] !== "default") + __createBinding(result, mod, k[i]); } __setModuleDefault(result, mod); return result; @@ -26761,7 +26286,15 @@ function __disposeResources(env) { __name(next, "next"); return next(); } -var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default; +function __rewriteRelativeImportExtension(path2, preserveJsx) { + if (typeof path2 === "string" && /^\.\.?\//.test(path2)) { + return path2.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path2; +} +var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default; var init_tslib_es6 = __esm({ "node_modules/tslib/tslib.es6.mjs"() { extendStatics = /* @__PURE__ */ __name(function(d, b) { @@ -26828,6 +26361,16 @@ var init_tslib_es6 = __esm({ } : function(o, v) { o["default"] = v; }; + ownKeys = /* @__PURE__ */ __name(function(o) { + ownKeys = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k in o2) + if (Object.prototype.hasOwnProperty.call(o2, k)) + ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }, "ownKeys"); __name(__importStar, "__importStar"); __name(__importDefault, "__importDefault"); __name(__classPrivateFieldGet, "__classPrivateFieldGet"); @@ -26839,12 +26382,17 @@ var init_tslib_es6 = __esm({ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; }; __name(__disposeResources, "__disposeResources"); + __name(__rewriteRelativeImportExtension, "__rewriteRelativeImportExtension"); tslib_es6_default = { __extends, __assign, __rest, __decorate, __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, __metadata, __awaiter, __generator, @@ -26866,31 +26414,51 @@ var init_tslib_es6 = __esm({ __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, - __disposeResources + __disposeResources, + __rewriteRelativeImportExtension }; } }); -// node_modules/@azure/logger/dist/commonjs/log.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/abort-controller/AbortError.js +var require_AbortError = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/abort-controller/AbortError.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AbortError = void 0; + var AbortError = class extends Error { + static { + __name(this, "AbortError"); + } + constructor(message) { + super(message); + this.name = "AbortError"; + } + }; + exports2.AbortError = AbortError; + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/log.js var require_log = __commonJS({ - "node_modules/@azure/logger/dist/commonjs/log.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/log.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.log = log; var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var node_os_1 = require("node:os"); var node_util_1 = tslib_1.__importDefault(require("node:util")); - var process2 = tslib_1.__importStar(require("node:process")); + var node_process_1 = tslib_1.__importDefault(require("node:process")); function log(message, ...args) { - process2.stderr.write(`${node_util_1.default.format(message, ...args)}${node_os_1.EOL}`); + node_process_1.default.stderr.write(`${node_util_1.default.format(message, ...args)}${node_os_1.EOL}`); } __name(log, "log"); } }); -// node_modules/@azure/logger/dist/commonjs/debug.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/debug.js var require_debug2 = __commonJS({ - "node_modules/@azure/logger/dist/commonjs/debug.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/debug.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var log_js_1 = require_log(); @@ -26914,13 +26482,12 @@ var require_debug2 = __commonJS({ enabledString = namespaces; enabledNamespaces = []; skippedNamespaces = []; - const wildcard = /\*/g; - const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); + const namespaceList = namespaces.split(",").map((ns) => ns.trim()); for (const ns of namespaceList) { if (ns.startsWith("-")) { - skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); + skippedNamespaces.push(ns.substring(1)); } else { - enabledNamespaces.push(new RegExp(`^${ns}$`)); + enabledNamespaces.push(ns); } } for (const instance of debuggers) { @@ -26933,18 +26500,88 @@ var require_debug2 = __commonJS({ return true; } for (const skipped of skippedNamespaces) { - if (skipped.test(namespace)) { + if (namespaceMatches(namespace, skipped)) { return false; } } for (const enabledNamespace of enabledNamespaces) { - if (enabledNamespace.test(namespace)) { + if (namespaceMatches(namespace, enabledNamespace)) { return true; } } return false; } __name(enabled, "enabled"); + function namespaceMatches(namespace, patternToMatch) { + if (patternToMatch.indexOf("*") === -1) { + return namespace === patternToMatch; + } + let pattern = patternToMatch; + if (patternToMatch.indexOf("**") !== -1) { + const patternParts = []; + let lastCharacter = ""; + for (const character of patternToMatch) { + if (character === "*" && lastCharacter === "*") { + continue; + } else { + lastCharacter = character; + patternParts.push(character); + } + } + pattern = patternParts.join(""); + } + let namespaceIndex = 0; + let patternIndex = 0; + const patternLength = pattern.length; + const namespaceLength = namespace.length; + let lastWildcard = -1; + let lastWildcardNamespace = -1; + while (namespaceIndex < namespaceLength && patternIndex < patternLength) { + if (pattern[patternIndex] === "*") { + lastWildcard = patternIndex; + patternIndex++; + if (patternIndex === patternLength) { + return true; + } + while (namespace[namespaceIndex] !== pattern[patternIndex]) { + namespaceIndex++; + if (namespaceIndex === namespaceLength) { + return false; + } + } + lastWildcardNamespace = namespaceIndex; + namespaceIndex++; + patternIndex++; + continue; + } else if (pattern[patternIndex] === namespace[namespaceIndex]) { + patternIndex++; + namespaceIndex++; + } else if (lastWildcard >= 0) { + patternIndex = lastWildcard + 1; + namespaceIndex = lastWildcardNamespace + 1; + if (namespaceIndex === namespaceLength) { + return false; + } + while (namespace[namespaceIndex] !== pattern[patternIndex]) { + namespaceIndex++; + if (namespaceIndex === namespaceLength) { + return false; + } + } + lastWildcardNamespace = namespaceIndex; + namespaceIndex++; + patternIndex++; + continue; + } else { + return false; + } + } + const namespaceDone = namespaceIndex === namespace.length; + const patternDone = patternIndex === pattern.length; + const trailingWildCard = patternIndex === pattern.length - 1 && pattern[patternIndex] === "*"; + return namespaceDone && (patternDone || trailingWildCard); + } + __name(namespaceMatches, "namespaceMatches"); function disable() { const result = enabledString || ""; enable(""); @@ -26992,1450 +26629,127 @@ var require_debug2 = __commonJS({ } }); -// node_modules/@azure/logger/dist/commonjs/index.js -var require_commonjs = __commonJS({ - "node_modules/@azure/logger/dist/commonjs/index.js"(exports2) { +// node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/logger.js +var require_logger = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/logger.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AzureLogger = void 0; + exports2.TypeSpecRuntimeLogger = void 0; + exports2.createLoggerContext = createLoggerContext; exports2.setLogLevel = setLogLevel; exports2.getLogLevel = getLogLevel; exports2.createClientLogger = createClientLogger; var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var debug_js_1 = tslib_1.__importDefault(require_debug2()); - var registeredLoggers = /* @__PURE__ */ new Set(); - var logLevelFromEnv = typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL || void 0; - var azureLogLevel; - exports2.AzureLogger = (0, debug_js_1.default)("azure"); - exports2.AzureLogger.log = (...args) => { - debug_js_1.default.log(...args); - }; - var 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(", ")}.`); - } - } - function setLogLevel(level) { - if (level && !isAzureLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); - } - azureLogLevel = level; - const enabledNamespaces = []; - for (const logger of registeredLoggers) { - if (shouldEnable(logger)) { - enabledNamespaces.push(logger.namespace); - } - } - debug_js_1.default.enable(enabledNamespaces.join(",")); - } - __name(setLogLevel, "setLogLevel"); - function getLogLevel() { - return azureLogLevel; - } - __name(getLogLevel, "getLogLevel"); + var TYPESPEC_RUNTIME_LOG_LEVELS = ["verbose", "info", "warning", "error"]; var levelMap = { verbose: 400, info: 300, warning: 200, error: 100 }; - function createClientLogger(namespace) { - const clientRootLogger = exports2.AzureLogger.extend(namespace); - patchLogMethod(exports2.AzureLogger, clientRootLogger); - return { - error: createLogger(clientRootLogger, "error"), - warning: createLogger(clientRootLogger, "warning"), - info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose") - }; - } - __name(createClientLogger, "createClientLogger"); function patchLogMethod(parent, child) { child.log = (...args) => { parent.log(...args); }; } __name(patchLogMethod, "patchLogMethod"); - function createLogger(parent, level) { - const logger = Object.assign(parent.extend(level), { - level - }); - patchLogMethod(parent, logger); - if (shouldEnable(logger)) { - const enabledNamespaces = debug_js_1.default.disable(); - debug_js_1.default.enable(enabledNamespaces + "," + logger.namespace); - } - registeredLoggers.add(logger); - return logger; + function isTypeSpecRuntimeLogLevel(level) { + return TYPESPEC_RUNTIME_LOG_LEVELS.includes(level); } - __name(createLogger, "createLogger"); - function shouldEnable(logger) { - return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); - } - __name(shouldEnable, "shouldEnable"); - function isAzureLogLevel(logLevel) { - return AZURE_LOG_LEVELS.includes(logLevel); - } - __name(isAzureLogLevel, "isAzureLogLevel"); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js -var require_log2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.logger = void 0; - var logger_1 = require_commonjs(); - exports2.logger = (0, logger_1.createClientLogger)("core-rest-pipeline"); - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError = __commonJS({ - "node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AbortError = void 0; - var AbortError = class extends Error { - static { - __name(this, "AbortError"); - } - constructor(message) { - super(message); - this.name = "AbortError"; - } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs2 = __commonJS({ - "node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AbortError = void 0; - var AbortError_js_1 = require_AbortError(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); - } -}); - -// node_modules/@azure/core-util/dist/commonjs/createAbortablePromise.js -var require_createAbortablePromise = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/createAbortablePromise.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createAbortablePromise = createAbortablePromise; - var abort_controller_1 = require_commonjs2(); - function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return new Promise((resolve, reject) => { - function rejectOnAbort() { - reject(new abort_controller_1.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); - } - __name(rejectOnAbort, "rejectOnAbort"); - function removeListeners() { - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); - } - __name(removeListeners, "removeListeners"); - function onAbort() { - cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); - removeListeners(); - rejectOnAbort(); - } - __name(onAbort, "onAbort"); - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - return rejectOnAbort(); - } - try { - buildPromise((x) => { - removeListeners(); - resolve(x); - }, (x) => { - removeListeners(); - reject(x); - }); - } catch (err) { - reject(err); - } - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); - }); - } - __name(createAbortablePromise, "createAbortablePromise"); - } -}); - -// node_modules/@azure/core-util/dist/commonjs/random.js -var require_random = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/random.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; - function getRandomIntegerInclusive(min, max) { - min = Math.ceil(min); - max = Math.floor(max); - const offset = Math.floor(Math.random() * (max - min + 1)); - return offset + min; - } - __name(getRandomIntegerInclusive, "getRandomIntegerInclusive"); - } -}); - -// node_modules/@azure/core-util/dist/commonjs/delay.js -var require_delay = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/delay.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay; - exports2.calculateRetryDelay = calculateRetryDelay; - var createAbortablePromise_js_1 = require_createAbortablePromise(); - var random_js_1 = require_random(); - var StandardAbortMessage = "The delay was aborted."; - function delay(timeInMs, options) { - let token; - const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve) => { - token = setTimeout(resolve, timeInMs); - }, { - cleanupBeforeAbort: () => clearTimeout(token), - abortSignal, - abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage - }); - } - __name(delay, "delay"); - function calculateRetryDelay(retryAttempt, config) { - const exponentialDelay = config.retryDelayInMs * Math.pow(2, retryAttempt); - const clampedDelay = Math.min(config.maxRetryDelayInMs, exponentialDelay); - const retryAfterInMs = clampedDelay / 2 + (0, random_js_1.getRandomIntegerInclusive)(0, clampedDelay / 2); - return { retryAfterInMs }; - } - __name(calculateRetryDelay, "calculateRetryDelay"); - } -}); - -// node_modules/@azure/core-util/dist/commonjs/aborterUtils.js -var require_aborterUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/aborterUtils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.cancelablePromiseRace = cancelablePromiseRace; - async function cancelablePromiseRace(abortablePromiseBuilders, options) { - var _a, _b; - const aborter = new AbortController(); - function abortHandler() { - aborter.abort(); - } - __name(abortHandler, "abortHandler"); - (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler); - try { - return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); - } finally { - aborter.abort(); - (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler); - } - } - __name(cancelablePromiseRace, "cancelablePromiseRace"); - } -}); - -// node_modules/@azure/core-util/dist/commonjs/object.js -var require_object = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/object.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isObject = isObject; - function isObject(input) { - return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); - } - __name(isObject, "isObject"); - } -}); - -// node_modules/@azure/core-util/dist/commonjs/error.js -var require_error = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isError = isError; - exports2.getErrorMessage = getErrorMessage; - var object_js_1 = require_object(); - function isError(e) { - if ((0, object_js_1.isObject)(e)) { - const hasName = typeof e.name === "string"; - const hasMessage = typeof e.message === "string"; - return hasName && hasMessage; - } - return false; - } - __name(isError, "isError"); - function getErrorMessage(e) { - if (isError(e)) { - return e.message; - } else { - let stringified; - try { - if (typeof e === "object" && e) { - stringified = JSON.stringify(e); - } else { - stringified = String(e); - } - } catch (err) { - stringified = "[unable to stringify input]"; - } - return `Unknown error ${stringified}`; - } - } - __name(getErrorMessage, "getErrorMessage"); - } -}); - -// node_modules/@azure/core-util/dist/commonjs/sha256.js -var require_sha256 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/sha256.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.computeSha256Hmac = computeSha256Hmac; - exports2.computeSha256Hash = computeSha256Hash; - var crypto_1 = require("crypto"); - async function computeSha256Hmac(key, stringToSign, encoding) { - const decodedKey = Buffer.from(key, "base64"); - return (0, crypto_1.createHmac)("sha256", decodedKey).update(stringToSign).digest(encoding); - } - __name(computeSha256Hmac, "computeSha256Hmac"); - async function computeSha256Hash(content, encoding) { - return (0, crypto_1.createHash)("sha256").update(content).digest(encoding); - } - __name(computeSha256Hash, "computeSha256Hash"); - } -}); - -// node_modules/@azure/core-util/dist/commonjs/typeGuards.js -var require_typeGuards = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined; - exports2.isObjectWithProperties = isObjectWithProperties; - exports2.objectHasProperty = objectHasProperty; - function isDefined(thing) { - return typeof thing !== "undefined" && thing !== null; - } - __name(isDefined, "isDefined"); - function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { - return false; - } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return false; - } - } - return true; - } - __name(isObjectWithProperties, "isObjectWithProperties"); - function objectHasProperty(thing, property) { - return isDefined(thing) && typeof thing === "object" && property in thing; - } - __name(objectHasProperty, "objectHasProperty"); - } -}); - -// node_modules/@azure/core-util/dist/commonjs/uuidUtils.js -var require_uuidUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/uuidUtils.js"(exports2) { - "use strict"; - var _a; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.randomUUID = randomUUID; - var crypto_1 = require("crypto"); - var uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : crypto_1.randomUUID; - function randomUUID() { - return uuidFunction(); - } - __name(randomUUID, "randomUUID"); - } -}); - -// node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js -var require_checkEnvironment = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js"(exports2) { - "use strict"; - var _a; - var _b; - var _c; - var _d; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isReactNative = exports2.isNodeRuntime = exports2.isNode = exports2.isNodeLike = exports2.isBun = exports2.isDeno = exports2.isWebWorker = exports2.isBrowser = void 0; - exports2.isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; - exports2.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"); - exports2.isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined"; - exports2.isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined"; - exports2.isNodeLike = typeof globalThis.process !== "undefined" && Boolean(globalThis.process.version) && Boolean((_d = globalThis.process.versions) === null || _d === void 0 ? void 0 : _d.node); - exports2.isNode = exports2.isNodeLike; - exports2.isNodeRuntime = exports2.isNodeLike && !exports2.isBun && !exports2.isDeno; - exports2.isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; - } -}); - -// node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js -var require_bytesEncoding = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.uint8ArrayToString = uint8ArrayToString; - exports2.stringToUint8Array = stringToUint8Array; - function uint8ArrayToString(bytes, format) { - return Buffer.from(bytes).toString(format); - } - __name(uint8ArrayToString, "uint8ArrayToString"); - function stringToUint8Array(value, format) { - return Buffer.from(value, format); - } - __name(stringToUint8Array, "stringToUint8Array"); - } -}); - -// node_modules/@azure/core-util/dist/commonjs/index.js -var require_commonjs3 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.stringToUint8Array = exports2.uint8ArrayToString = exports2.isWebWorker = exports2.isReactNative = exports2.isDeno = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isNode = exports2.isBun = exports2.isBrowser = exports2.randomUUID = exports2.objectHasProperty = exports2.isObjectWithProperties = exports2.isDefined = exports2.computeSha256Hmac = exports2.computeSha256Hash = exports2.getErrorMessage = exports2.isError = exports2.isObject = exports2.getRandomIntegerInclusive = exports2.createAbortablePromise = exports2.cancelablePromiseRace = exports2.calculateRetryDelay = exports2.delay = void 0; - var delay_js_1 = require_delay(); - Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { - return delay_js_1.delay; - } }); - Object.defineProperty(exports2, "calculateRetryDelay", { enumerable: true, get: function() { - return delay_js_1.calculateRetryDelay; - } }); - var aborterUtils_js_1 = require_aborterUtils(); - Object.defineProperty(exports2, "cancelablePromiseRace", { enumerable: true, get: function() { - return aborterUtils_js_1.cancelablePromiseRace; - } }); - var createAbortablePromise_js_1 = require_createAbortablePromise(); - Object.defineProperty(exports2, "createAbortablePromise", { enumerable: true, get: function() { - return createAbortablePromise_js_1.createAbortablePromise; - } }); - var random_js_1 = require_random(); - Object.defineProperty(exports2, "getRandomIntegerInclusive", { enumerable: true, get: function() { - return random_js_1.getRandomIntegerInclusive; - } }); - var object_js_1 = require_object(); - Object.defineProperty(exports2, "isObject", { enumerable: true, get: function() { - return object_js_1.isObject; - } }); - var error_js_1 = require_error(); - Object.defineProperty(exports2, "isError", { enumerable: true, get: function() { - return error_js_1.isError; - } }); - Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { - return error_js_1.getErrorMessage; - } }); - var sha256_js_1 = require_sha256(); - Object.defineProperty(exports2, "computeSha256Hash", { enumerable: true, get: function() { - return sha256_js_1.computeSha256Hash; - } }); - Object.defineProperty(exports2, "computeSha256Hmac", { enumerable: true, get: function() { - return sha256_js_1.computeSha256Hmac; - } }); - var typeGuards_js_1 = require_typeGuards(); - Object.defineProperty(exports2, "isDefined", { enumerable: true, get: function() { - return typeGuards_js_1.isDefined; - } }); - Object.defineProperty(exports2, "isObjectWithProperties", { enumerable: true, get: function() { - return typeGuards_js_1.isObjectWithProperties; - } }); - Object.defineProperty(exports2, "objectHasProperty", { enumerable: true, get: function() { - return typeGuards_js_1.objectHasProperty; - } }); - var uuidUtils_js_1 = require_uuidUtils(); - Object.defineProperty(exports2, "randomUUID", { enumerable: true, get: function() { - return uuidUtils_js_1.randomUUID; - } }); - var checkEnvironment_js_1 = require_checkEnvironment(); - Object.defineProperty(exports2, "isBrowser", { enumerable: true, get: function() { - return checkEnvironment_js_1.isBrowser; - } }); - Object.defineProperty(exports2, "isBun", { enumerable: true, get: function() { - return checkEnvironment_js_1.isBun; - } }); - Object.defineProperty(exports2, "isNode", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNode; - } }); - Object.defineProperty(exports2, "isNodeLike", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNodeLike; - } }); - Object.defineProperty(exports2, "isNodeRuntime", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNodeRuntime; - } }); - Object.defineProperty(exports2, "isDeno", { enumerable: true, get: function() { - return checkEnvironment_js_1.isDeno; - } }); - Object.defineProperty(exports2, "isReactNative", { enumerable: true, get: function() { - return checkEnvironment_js_1.isReactNative; - } }); - Object.defineProperty(exports2, "isWebWorker", { enumerable: true, get: function() { - return checkEnvironment_js_1.isWebWorker; - } }); - var bytesEncoding_js_1 = require_bytesEncoding(); - Object.defineProperty(exports2, "uint8ArrayToString", { enumerable: true, get: function() { - return bytesEncoding_js_1.uint8ArrayToString; - } }); - Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { - return bytesEncoding_js_1.stringToUint8Array; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js -var require_sanitizer = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Sanitizer = void 0; - var core_util_1 = require_commonjs3(); - var RedactedString = "REDACTED"; - var 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" - ]; - var defaultAllowedQueryParameters = ["api-version"]; - var Sanitizer = class { - static { - __name(this, "Sanitizer"); - } - constructor({ additionalAllowedHeaderNames: allowedHeaderNames = [], additionalAllowedQueryParameters: allowedQueryParameters = [] } = {}) { - allowedHeaderNames = defaultAllowedHeaderNames.concat(allowedHeaderNames); - allowedQueryParameters = defaultAllowedQueryParameters.concat(allowedQueryParameters); - this.allowedHeaderNames = new Set(allowedHeaderNames.map((n) => n.toLowerCase())); - this.allowedQueryParameters = new Set(allowedQueryParameters.map((p) => p.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 === "headers") { - 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) || (0, core_util_1.isObject)(value)) { - if (seen.has(value)) { - return "[Circular]"; - } - seen.add(value); - } - return value; - }, 2); - } - sanitizeUrl(value) { - if (typeof value !== "string" || value === null || value === "") { - return value; - } - const url = new URL(value); - if (!url.search) { - return value; - } - for (const [key] of url.searchParams) { - if (!this.allowedQueryParameters.has(key.toLowerCase())) { - url.searchParams.set(key, RedactedString); - } - } - return url.toString(); - } - sanitizeHeaders(obj) { - const sanitized = {}; - for (const key of Object.keys(obj)) { - if (this.allowedHeaderNames.has(key.toLowerCase())) { - sanitized[key] = obj[key]; - } else { - sanitized[key] = RedactedString; - } - } - return sanitized; - } - sanitizeQuery(value) { - if (typeof value !== "object" || value === null) { - return value; - } - const sanitized = {}; - for (const k of Object.keys(value)) { - if (this.allowedQueryParameters.has(k.toLowerCase())) { - sanitized[k] = value[k]; - } else { - sanitized[k] = RedactedString; - } - } - return sanitized; - } - }; - exports2.Sanitizer = Sanitizer; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js -var require_logPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.logPolicyName = void 0; - exports2.logPolicy = logPolicy; - var log_js_1 = require_log2(); - var sanitizer_js_1 = require_sanitizer(); - exports2.logPolicyName = "logPolicy"; - function logPolicy(options = {}) { - var _a; - const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : log_js_1.logger.info; - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedHeaderNames: options.additionalAllowedHeaderNames, - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - return { - name: exports2.logPolicyName, - async sendRequest(request, next) { - if (!logger.enabled) { - return next(request); - } - logger(`Request: ${sanitizer.sanitize(request)}`); - const response = await next(request); - logger(`Response status code: ${response.status}`); - logger(`Headers: ${sanitizer.sanitize(response.headers)}`); - return response; - } + __name(isTypeSpecRuntimeLogLevel, "isTypeSpecRuntimeLogLevel"); + function createLoggerContext(options) { + const registeredLoggers = /* @__PURE__ */ new Set(); + const logLevelFromEnv = typeof process !== "undefined" && process.env && process.env[options.logLevelEnvVarName] || void 0; + let logLevel; + const clientLogger = (0, debug_js_1.default)(options.namespace); + clientLogger.log = (...args) => { + debug_js_1.default.log(...args); }; - } - __name(logPolicy, "logPolicy"); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js -var require_redirectPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.redirectPolicyName = void 0; - exports2.redirectPolicy = redirectPolicy; - exports2.redirectPolicyName = "redirectPolicy"; - var allowedRedirect = ["GET", "HEAD"]; - function redirectPolicy(options = {}) { - const { maxRetries = 20 } = options; - return { - name: exports2.redirectPolicyName, - async sendRequest(request, next) { - const response = await next(request); - return handleRedirect(next, response, maxRetries); + function contextSetLogLevel(level) { + if (level && !isTypeSpecRuntimeLogLevel(level)) { + throw new Error(`Unknown log level '${level}'. Acceptable values: ${TYPESPEC_RUNTIME_LOG_LEVELS.join(",")}`); } - }; - } - __name(redirectPolicy, "redirectPolicy"); - async function handleRedirect(next, response, maxRetries, currentRetries = 0) { - const { request, status, headers } = response; - const locationHeader = headers.get("location"); - if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { - const url = new URL(locationHeader, request.url); - request.url = url.toString(); - if (status === 303) { - request.method = "GET"; - request.headers.delete("Content-Length"); - delete request.body; - } - request.headers.delete("Authorization"); - const res = await next(request); - return handleRedirect(next, res, maxRetries, currentRetries + 1); - } - return response; - } - __name(handleRedirect, "handleRedirect"); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js -var require_userAgentPlatform = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getHeaderName = getHeaderName; - exports2.setPlatformSpecificData = setPlatformSpecificData; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var os2 = tslib_1.__importStar(require("node:os")); - var process2 = tslib_1.__importStar(require("node:process")); - function getHeaderName() { - return "User-Agent"; - } - __name(getHeaderName, "getHeaderName"); - async function setPlatformSpecificData(map) { - if (process2 && process2.versions) { - const versions = process2.versions; - if (versions.bun) { - map.set("Bun", versions.bun); - } else if (versions.deno) { - map.set("Deno", versions.deno); - } else if (versions.node) { - map.set("Node", versions.node); - } - } - map.set("OS", `(${os2.arch()}-${os2.type()}-${os2.release()})`); - } - __name(setPlatformSpecificData, "setPlatformSpecificData"); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js -var require_constants8 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DEFAULT_RETRY_POLICY_COUNT = exports2.SDK_VERSION = void 0; - exports2.SDK_VERSION = "1.17.0"; - exports2.DEFAULT_RETRY_POLICY_COUNT = 3; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js -var require_userAgent = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getUserAgentHeaderName = getUserAgentHeaderName; - exports2.getUserAgentValue = getUserAgentValue; - var userAgentPlatform_js_1 = require_userAgentPlatform(); - var constants_js_1 = require_constants8(); - function getUserAgentString(telemetryInfo) { - const parts = []; - for (const [key, value] of telemetryInfo) { - const token = value ? `${key}/${value}` : key; - parts.push(token); - } - return parts.join(" "); - } - __name(getUserAgentString, "getUserAgentString"); - function getUserAgentHeaderName() { - return (0, userAgentPlatform_js_1.getHeaderName)(); - } - __name(getUserAgentHeaderName, "getUserAgentHeaderName"); - async function getUserAgentValue(prefix) { - const runtimeInfo = /* @__PURE__ */ new Map(); - runtimeInfo.set("core-rest-pipeline", constants_js_1.SDK_VERSION); - await (0, userAgentPlatform_js_1.setPlatformSpecificData)(runtimeInfo); - const defaultAgent = getUserAgentString(runtimeInfo); - const userAgentValue = prefix ? `${prefix} ${defaultAgent}` : defaultAgent; - return userAgentValue; - } - __name(getUserAgentValue, "getUserAgentValue"); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js -var require_userAgentPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.userAgentPolicyName = void 0; - exports2.userAgentPolicy = userAgentPolicy; - var userAgent_js_1 = require_userAgent(); - var UserAgentHeaderName = (0, userAgent_js_1.getUserAgentHeaderName)(); - exports2.userAgentPolicyName = "userAgentPolicy"; - function userAgentPolicy(options = {}) { - const userAgentValue = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - return { - name: exports2.userAgentPolicyName, - async sendRequest(request, next) { - if (!request.headers.has(UserAgentHeaderName)) { - request.headers.set(UserAgentHeaderName, await userAgentValue); + logLevel = level; + const enabledNamespaces = []; + for (const logger of registeredLoggers) { + if (shouldEnable(logger)) { + enabledNamespaces.push(logger.namespace); } - return next(request); } - }; - } - __name(userAgentPolicy, "userAgentPolicy"); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js -var require_typeGuards2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isNodeReadableStream = isNodeReadableStream; - exports2.isWebReadableStream = isWebReadableStream; - exports2.isReadableStream = isReadableStream; - exports2.isBlob = isBlob; - function isNodeReadableStream(x) { - return Boolean(x && typeof x["pipe"] === "function"); - } - __name(isNodeReadableStream, "isNodeReadableStream"); - function isWebReadableStream(x) { - return Boolean(x && typeof x.getReader === "function" && typeof x.tee === "function"); - } - __name(isWebReadableStream, "isWebReadableStream"); - function isReadableStream(x) { - return isNodeReadableStream(x) || isWebReadableStream(x); - } - __name(isReadableStream, "isReadableStream"); - function isBlob(x) { - return typeof x.stream === "function"; - } - __name(isBlob, "isBlob"); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/file.js -var require_file2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/file.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRawContent = getRawContent; - exports2.createFileFromStream = createFileFromStream; - exports2.createFile = createFile; - var core_util_1 = require_commonjs3(); - var typeGuards_js_1 = require_typeGuards2(); - var unimplementedMethods = { - arrayBuffer: () => { - throw new Error("Not implemented"); - }, - slice: () => { - throw new Error("Not implemented"); - }, - text: () => { - throw new Error("Not implemented"); + debug_js_1.default.enable(enabledNamespaces.join(",")); } - }; - var rawContent = Symbol("rawContent"); - function hasRawContent(x) { - return typeof x[rawContent] === "function"; - } - __name(hasRawContent, "hasRawContent"); - function getRawContent(blob) { - if (hasRawContent(blob)) { - return blob[rawContent](); - } else { - return blob.stream(); - } - } - __name(getRawContent, "getRawContent"); - function createFileFromStream(stream, name, options = {}) { - var _a, _b, _c, _d; - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: (_d = options.size) !== null && _d !== void 0 ? _d : -1, name, stream: () => { - const s = stream(); - if ((0, typeGuards_js_1.isNodeReadableStream)(s)) { - throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); - } - return s; - }, [rawContent]: stream }); - } - __name(createFileFromStream, "createFileFromStream"); - function createFile(content, name, options = {}) { - var _a, _b, _c; - if (core_util_1.isNodeLike) { - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: content.byteLength, name, arrayBuffer: async () => content.buffer, stream: () => new Blob([content]).stream(), [rawContent]: () => content }); - } else { - return new File([content], name, options); - } - } - __name(createFile, "createFile"); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js -var require_concat = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.concat = concat; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_stream_1 = require("node:stream"); - var typeGuards_js_1 = require_typeGuards2(); - var file_js_1 = require_file2(); - function streamAsyncIterator() { - return tslib_1.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* streamAsyncIterator_1() { - const reader = this.getReader(); - try { - while (true) { - const { done, value } = yield tslib_1.__await(reader.read()); - if (done) { - return yield tslib_1.__await(void 0); - } - yield yield tslib_1.__await(value); - } - } finally { - reader.releaseLock(); - } - }, "streamAsyncIterator_1")); - } - __name(streamAsyncIterator, "streamAsyncIterator"); - function makeAsyncIterable(webStream) { - if (!webStream[Symbol.asyncIterator]) { - webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); - } - if (!webStream.values) { - webStream.values = streamAsyncIterator.bind(webStream); - } - } - __name(makeAsyncIterable, "makeAsyncIterable"); - function ensureNodeStream(stream) { - if (stream instanceof ReadableStream) { - makeAsyncIterable(stream); - return node_stream_1.Readable.fromWeb(stream); - } else { - return stream; - } - } - __name(ensureNodeStream, "ensureNodeStream"); - function toStream(source) { - if (source instanceof Uint8Array) { - return node_stream_1.Readable.from(Buffer.from(source)); - } else if ((0, typeGuards_js_1.isBlob)(source)) { - return toStream((0, file_js_1.getRawContent)(source)); - } else { - return ensureNodeStream(source); - } - } - __name(toStream, "toStream"); - async function concat(sources) { - return function() { - const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); - return node_stream_1.Readable.from(function() { - return tslib_1.__asyncGenerator(this, arguments, function* () { - var _a, e_1, _b, _c; - for (const stream of streams) { - try { - for (var _d = true, stream_1 = (e_1 = void 0, tslib_1.__asyncValues(stream)), stream_1_1; stream_1_1 = yield tslib_1.__await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) { - _c = stream_1_1.value; - _d = false; - const chunk = _c; - yield yield tslib_1.__await(chunk); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = stream_1.return)) - yield tslib_1.__await(_b.call(stream_1)); - } finally { - if (e_1) - throw e_1.error; - } - } - } - }); - }()); - }; - } - __name(concat, "concat"); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js -var require_multipartPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.multipartPolicyName = void 0; - exports2.multipartPolicy = multipartPolicy; - var core_util_1 = require_commonjs3(); - var concat_js_1 = require_concat(); - var typeGuards_js_1 = require_typeGuards2(); - function generateBoundary() { - return `----AzSDKFormBoundary${(0, core_util_1.randomUUID)()}`; - } - __name(generateBoundary, "generateBoundary"); - function encodeHeaders(headers) { - let result = ""; - for (const [key, value] of headers) { - result += `${key}: ${value}\r -`; - } - return result; - } - __name(encodeHeaders, "encodeHeaders"); - function getLength(source) { - if (source instanceof Uint8Array) { - return source.byteLength; - } else if ((0, typeGuards_js_1.isBlob)(source)) { - return source.size === -1 ? void 0 : source.size; - } else { - return void 0; - } - } - __name(getLength, "getLength"); - function getTotalLength(sources) { - let total = 0; - for (const source of sources) { - const partLength = getLength(source); - if (partLength === void 0) { - return void 0; + __name(contextSetLogLevel, "contextSetLogLevel"); + if (logLevelFromEnv) { + if (isTypeSpecRuntimeLogLevel(logLevelFromEnv)) { + contextSetLogLevel(logLevelFromEnv); } else { - total += partLength; + console.error(`${options.logLevelEnvVarName} set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${TYPESPEC_RUNTIME_LOG_LEVELS.join(", ")}.`); } } - return total; - } - __name(getTotalLength, "getTotalLength"); - async function buildRequestBody(request, parts, boundary) { - const sources = [ - (0, core_util_1.stringToUint8Array)(`--${boundary}`, "utf-8"), - ...parts.flatMap((part) => [ - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - (0, core_util_1.stringToUint8Array)(encodeHeaders(part.headers), "utf-8"), - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - part.body, - (0, core_util_1.stringToUint8Array)(`\r ---${boundary}`, "utf-8") - ]), - (0, core_util_1.stringToUint8Array)("--\r\n\r\n", "utf-8") - ]; - const contentLength = getTotalLength(sources); - if (contentLength) { - request.headers.set("Content-Length", contentLength); + function shouldEnable(logger) { + return Boolean(logLevel && levelMap[logger.level] <= levelMap[logLevel]); } - request.body = await (0, concat_js_1.concat)(sources); - } - __name(buildRequestBody, "buildRequestBody"); - exports2.multipartPolicyName = "multipartPolicy"; - var maxBoundaryLength = 70; - var validBoundaryCharacters = new Set(`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?`); - function assertValidBoundary(boundary) { - if (boundary.length > maxBoundaryLength) { - throw new Error(`Multipart boundary "${boundary}" exceeds maximum length of 70 characters`); + __name(shouldEnable, "shouldEnable"); + function createLogger(parent, level) { + const logger = Object.assign(parent.extend(level), { + level + }); + patchLogMethod(parent, logger); + if (shouldEnable(logger)) { + const enabledNamespaces = debug_js_1.default.disable(); + debug_js_1.default.enable(enabledNamespaces + "," + logger.namespace); + } + registeredLoggers.add(logger); + return logger; } - if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { - throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); + __name(createLogger, "createLogger"); + function contextGetLogLevel() { + return logLevel; } - } - __name(assertValidBoundary, "assertValidBoundary"); - function multipartPolicy() { + __name(contextGetLogLevel, "contextGetLogLevel"); + function contextCreateClientLogger(namespace) { + const clientRootLogger = clientLogger.extend(namespace); + patchLogMethod(clientLogger, clientRootLogger); + return { + error: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose") + }; + } + __name(contextCreateClientLogger, "contextCreateClientLogger"); return { - name: exports2.multipartPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.multipartBody) { - return next(request); - } - if (request.body) { - throw new Error("multipartBody and regular body cannot be set at the same time"); - } - let boundary = request.multipartBody.boundary; - const contentTypeHeader = (_a = request.headers.get("Content-Type")) !== null && _a !== void 0 ? _a : "multipart/mixed"; - const parsedHeader = contentTypeHeader.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/); - if (!parsedHeader) { - throw new Error(`Got multipart request body, but content-type header was not multipart: ${contentTypeHeader}`); - } - const [, contentType, parsedBoundary] = parsedHeader; - if (parsedBoundary && boundary && parsedBoundary !== boundary) { - throw new Error(`Multipart boundary was specified as ${parsedBoundary} in the header, but got ${boundary} in the request body`); - } - boundary !== null && boundary !== void 0 ? boundary : boundary = parsedBoundary; - if (boundary) { - assertValidBoundary(boundary); - } else { - boundary = generateBoundary(); - } - request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); - await buildRequestBody(request, request.multipartBody.parts, boundary); - request.multipartBody = void 0; - return next(request); - } + setLogLevel: contextSetLogLevel, + getLogLevel: contextGetLogLevel, + createClientLogger: contextCreateClientLogger, + logger: clientLogger }; } - __name(multipartPolicy, "multipartPolicy"); + __name(createLoggerContext, "createLoggerContext"); + var context = createLoggerContext({ + logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", + namespace: "typeSpecRuntime" + }); + exports2.TypeSpecRuntimeLogger = context.logger; + function setLogLevel(logLevel) { + context.setLogLevel(logLevel); + } + __name(setLogLevel, "setLogLevel"); + function getLogLevel() { + return context.getLogLevel(); + } + __name(getLogLevel, "getLogLevel"); + function createClientLogger(namespace) { + return context.createClientLogger(namespace); + } + __name(createClientLogger, "createClientLogger"); } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js -var require_decompressResponsePolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.decompressResponsePolicyName = void 0; - exports2.decompressResponsePolicy = decompressResponsePolicy; - exports2.decompressResponsePolicyName = "decompressResponsePolicy"; - function decompressResponsePolicy() { - return { - name: exports2.decompressResponsePolicyName, - async sendRequest(request, next) { - if (request.method !== "HEAD") { - request.headers.set("Accept-Encoding", "gzip,deflate"); - } - return next(request); - } - }; - } - __name(decompressResponsePolicy, "decompressResponsePolicy"); - } -}); - -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AbortError = void 0; - var AbortError = class extends Error { - static { - __name(this, "AbortError"); - } - constructor(message) { - super(message); - this.name = "AbortError"; - } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs4 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AbortError = void 0; - var AbortError_js_1 = require_AbortError2(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/helpers.js -var require_helpers = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/helpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay; - exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; - var abort_controller_1 = require_commonjs4(); - var StandardAbortMessage = "The operation was aborted."; - function delay(delayInMs, value, options) { - return new Promise((resolve, reject) => { - let timer = void 0; - let onAborted = void 0; - const rejectOnAbort = /* @__PURE__ */ __name(() => { - return reject(new abort_controller_1.AbortError((options === null || options === void 0 ? void 0 : options.abortErrorMsg) ? options === null || options === void 0 ? void 0 : options.abortErrorMsg : StandardAbortMessage)); - }, "rejectOnAbort"); - const removeListeners = /* @__PURE__ */ __name(() => { - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) { - options.abortSignal.removeEventListener("abort", onAborted); - } - }, "removeListeners"); - onAborted = /* @__PURE__ */ __name(() => { - if (timer) { - clearTimeout(timer); - } - removeListeners(); - return rejectOnAbort(); - }, "onAborted"); - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) { - return rejectOnAbort(); - } - timer = setTimeout(() => { - removeListeners(); - resolve(value); - }, delayInMs); - if (options === null || options === void 0 ? void 0 : options.abortSignal) { - options.abortSignal.addEventListener("abort", onAborted); - } - }); - } - __name(delay, "delay"); - function parseHeaderValueAsNumber(response, headerName) { - const value = response.headers.get(headerName); - if (!value) - return; - const valueAsNum = Number(value); - if (Number.isNaN(valueAsNum)) - return; - return valueAsNum; - } - __name(parseHeaderValueAsNumber, "parseHeaderValueAsNumber"); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js -var require_throttlingRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isThrottlingRetryResponse = isThrottlingRetryResponse; - exports2.throttlingRetryStrategy = throttlingRetryStrategy; - var helpers_js_1 = require_helpers(); - var RetryAfterHeader = "Retry-After"; - var AllRetryAfterHeaders = ["retry-after-ms", "x-ms-retry-after-ms", RetryAfterHeader]; - function getRetryAfterInMs(response) { - if (!(response && [429, 503].includes(response.status))) - return void 0; - try { - for (const header of AllRetryAfterHeaders) { - const retryAfterValue = (0, helpers_js_1.parseHeaderValueAsNumber)(response, header); - if (retryAfterValue === 0 || retryAfterValue) { - const multiplyingFactor = header === RetryAfterHeader ? 1e3 : 1; - return retryAfterValue * multiplyingFactor; - } - } - const retryAfterHeader = response.headers.get(RetryAfterHeader); - if (!retryAfterHeader) - return; - const date = Date.parse(retryAfterHeader); - const diff = date - Date.now(); - return Number.isFinite(diff) ? Math.max(0, diff) : void 0; - } catch (_a) { - return void 0; - } - } - __name(getRetryAfterInMs, "getRetryAfterInMs"); - function isThrottlingRetryResponse(response) { - return Number.isFinite(getRetryAfterInMs(response)); - } - __name(isThrottlingRetryResponse, "isThrottlingRetryResponse"); - function throttlingRetryStrategy() { - return { - name: "throttlingRetryStrategy", - retry({ response }) { - const retryAfterInMs = getRetryAfterInMs(response); - if (!Number.isFinite(retryAfterInMs)) { - return { skipStrategy: true }; - } - return { - retryAfterInMs - }; - } - }; - } - __name(throttlingRetryStrategy, "throttlingRetryStrategy"); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js -var require_exponentialRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.exponentialRetryStrategy = exponentialRetryStrategy; - exports2.isExponentialRetryResponse = isExponentialRetryResponse; - exports2.isSystemError = isSystemError; - var core_util_1 = require_commonjs3(); - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var DEFAULT_CLIENT_RETRY_INTERVAL = 1e3; - var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1e3 * 64; - function exponentialRetryStrategy(options = {}) { - var _a, _b; - const retryInterval = (_a = options.retryDelayInMs) !== null && _a !== void 0 ? _a : DEFAULT_CLIENT_RETRY_INTERVAL; - const maxRetryInterval = (_b = options.maxRetryDelayInMs) !== null && _b !== void 0 ? _b : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - let retryAfterInMs = retryInterval; - return { - name: "exponentialRetryStrategy", - retry({ retryCount, response, responseError }) { - const matchedSystemError = isSystemError(responseError); - const ignoreSystemErrors = matchedSystemError && options.ignoreSystemErrors; - const isExponential = isExponentialRetryResponse(response); - const ignoreExponentialResponse = isExponential && options.ignoreHttpStatusCodes; - const unknownResponse = response && ((0, throttlingRetryStrategy_js_1.isThrottlingRetryResponse)(response) || !isExponential); - if (unknownResponse || ignoreExponentialResponse || ignoreSystemErrors) { - return { skipStrategy: true }; - } - if (responseError && !matchedSystemError && !isExponential) { - return { errorToThrow: responseError }; - } - const exponentialDelay = retryAfterInMs * Math.pow(2, retryCount); - const clampedExponentialDelay = Math.min(maxRetryInterval, exponentialDelay); - retryAfterInMs = clampedExponentialDelay / 2 + (0, core_util_1.getRandomIntegerInclusive)(0, clampedExponentialDelay / 2); - return { retryAfterInMs }; - } - }; - } - __name(exponentialRetryStrategy, "exponentialRetryStrategy"); - function isExponentialRetryResponse(response) { - return Boolean(response && response.status !== void 0 && (response.status >= 500 || response.status === 408) && response.status !== 501 && response.status !== 505); - } - __name(isExponentialRetryResponse, "isExponentialRetryResponse"); - function isSystemError(err) { - if (!err) { - return false; - } - return err.code === "ETIMEDOUT" || err.code === "ESOCKETTIMEDOUT" || err.code === "ECONNREFUSED" || err.code === "ECONNRESET" || err.code === "ENOENT" || err.code === "ENOTFOUND"; - } - __name(isSystemError, "isSystemError"); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js -var require_retryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryPolicy = retryPolicy; - var helpers_js_1 = require_helpers(); - var logger_1 = require_commonjs(); - var abort_controller_1 = require_commonjs4(); - var constants_js_1 = require_constants8(); - var retryPolicyLogger = (0, logger_1.createClientLogger)("core-rest-pipeline retryPolicy"); - var retryPolicyName = "retryPolicy"; - function retryPolicy(strategies, options = { maxRetries: constants_js_1.DEFAULT_RETRY_POLICY_COUNT }) { - const logger = options.logger || retryPolicyLogger; - return { - name: retryPolicyName, - async sendRequest(request, next) { - var _a, _b; - let response; - let responseError; - let retryCount = -1; - retryRequest: - while (true) { - retryCount += 1; - response = void 0; - responseError = void 0; - try { - logger.info(`Retry ${retryCount}: Attempting to send request`, request.requestId); - response = await next(request); - logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); - } catch (e) { - logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); - responseError = e; - if (!e || responseError.name !== "RestError") { - throw e; - } - response = responseError.response; - } - if ((_a = request.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - logger.error(`Retry ${retryCount}: Request aborted.`); - const abortError = new abort_controller_1.AbortError(); - throw abortError; - } - if (retryCount >= ((_b = options.maxRetries) !== null && _b !== void 0 ? _b : constants_js_1.DEFAULT_RETRY_POLICY_COUNT)) { - logger.info(`Retry ${retryCount}: Maximum retries reached. Returning the last received response, or throwing the last received error.`); - if (responseError) { - throw responseError; - } else if (response) { - return response; - } else { - throw new Error("Maximum retries reached with no response or error to throw"); - } - } - logger.info(`Retry ${retryCount}: Processing ${strategies.length} retry strategies.`); - strategiesLoop: - for (const strategy of strategies) { - const strategyLogger = strategy.logger || retryPolicyLogger; - strategyLogger.info(`Retry ${retryCount}: Processing retry strategy ${strategy.name}.`); - const modifiers = strategy.retry({ - retryCount, - response, - responseError - }); - if (modifiers.skipStrategy) { - strategyLogger.info(`Retry ${retryCount}: Skipped.`); - continue strategiesLoop; - } - const { errorToThrow, retryAfterInMs, redirectTo } = modifiers; - if (errorToThrow) { - strategyLogger.error(`Retry ${retryCount}: Retry strategy ${strategy.name} throws error:`, errorToThrow); - throw errorToThrow; - } - if (retryAfterInMs || retryAfterInMs === 0) { - strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} retries after ${retryAfterInMs}`); - await (0, helpers_js_1.delay)(retryAfterInMs, void 0, { abortSignal: request.abortSignal }); - continue retryRequest; - } - if (redirectTo) { - strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); - request.url = redirectTo; - continue retryRequest; - } - } - if (responseError) { - logger.info(`None of the retry strategies could work with the received error. Throwing it.`); - throw responseError; - } - if (response) { - logger.info(`None of the retry strategies could work with the received response. Returning it.`); - return response; - } - } - } - }; - } - __name(retryPolicy, "retryPolicy"); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js -var require_defaultRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.defaultRetryPolicyName = void 0; - exports2.defaultRetryPolicy = defaultRetryPolicy; - var exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); - var constants_js_1 = require_constants8(); - exports2.defaultRetryPolicyName = "defaultRetryPolicy"; - function defaultRetryPolicy(options = {}) { - var _a; - return { - name: exports2.defaultRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)(), (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(options)], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; - } - __name(defaultRetryPolicy, "defaultRetryPolicy"); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/httpHeaders.js var require_httpHeaders = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/httpHeaders.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createHttpHeaders = createHttpHeaders; @@ -28453,6 +26767,7 @@ var require_httpHeaders = __commonJS({ static { __name(this, "HttpHeadersImpl"); } + _headersMap; constructor(rawHeaders) { this._headersMap = /* @__PURE__ */ new Map(); if (rawHeaders) { @@ -28476,8 +26791,7 @@ var require_httpHeaders = __commonJS({ * @param name - The name of the header. This value is case-insensitive. */ get(name) { - var _a; - return (_a = this._headersMap.get(normalizeName(name))) === null || _a === void 0 ? void 0 : _a.value; + return this._headersMap.get(normalizeName(name))?.value; } /** * Get whether or not this header collection contains a header entry for the provided header name. @@ -28529,21 +26843,1479 @@ var require_httpHeaders = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/auth/schemes.js +var require_schemes = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/auth/schemes.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/auth/oauth2Flows.js +var require_oauth2Flows = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/auth/oauth2Flows.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/uuidUtils.js +var require_uuidUtils = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/uuidUtils.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.randomUUID = randomUUID; + function randomUUID() { + return crypto.randomUUID(); + } + __name(randomUUID, "randomUUID"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/pipelineRequest.js +var require_pipelineRequest = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/pipelineRequest.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createPipelineRequest = createPipelineRequest; + var httpHeaders_js_1 = require_httpHeaders(); + var uuidUtils_js_1 = require_uuidUtils(); + var PipelineRequestImpl = class { + static { + __name(this, "PipelineRequestImpl"); + } + url; + method; + headers; + timeout; + withCredentials; + body; + multipartBody; + formData; + streamResponseStatusCodes; + enableBrowserStreams; + proxySettings; + disableKeepAlive; + abortSignal; + requestId; + allowInsecureConnection; + onUploadProgress; + onDownloadProgress; + requestOverrides; + authSchemes; + constructor(options) { + this.url = options.url; + this.body = options.body; + this.headers = options.headers ?? (0, httpHeaders_js_1.createHttpHeaders)(); + this.method = options.method ?? "GET"; + this.timeout = options.timeout ?? 0; + this.multipartBody = options.multipartBody; + this.formData = options.formData; + this.disableKeepAlive = options.disableKeepAlive ?? false; + this.proxySettings = options.proxySettings; + this.streamResponseStatusCodes = options.streamResponseStatusCodes; + this.withCredentials = options.withCredentials ?? false; + this.abortSignal = options.abortSignal; + this.onUploadProgress = options.onUploadProgress; + this.onDownloadProgress = options.onDownloadProgress; + this.requestId = options.requestId || (0, uuidUtils_js_1.randomUUID)(); + this.allowInsecureConnection = options.allowInsecureConnection ?? false; + this.enableBrowserStreams = options.enableBrowserStreams ?? false; + this.requestOverrides = options.requestOverrides; + this.authSchemes = options.authSchemes; + } + }; + function createPipelineRequest(options) { + return new PipelineRequestImpl(options); + } + __name(createPipelineRequest, "createPipelineRequest"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/pipeline.js +var require_pipeline = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/pipeline.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createEmptyPipeline = createEmptyPipeline; + var ValidPhaseNames = /* @__PURE__ */ new Set(["Deserialize", "Serialize", "Retry", "Sign"]); + var HttpPipeline = class _HttpPipeline { + static { + __name(this, "HttpPipeline"); + } + _policies = []; + _orderedPolicies; + constructor(policies) { + this._policies = policies?.slice(0) ?? []; + this._orderedPolicies = void 0; + } + addPolicy(policy, options = {}) { + if (options.phase && options.afterPhase) { + throw new Error("Policies inside a phase cannot specify afterPhase."); + } + if (options.phase && !ValidPhaseNames.has(options.phase)) { + throw new Error(`Invalid phase name: ${options.phase}`); + } + if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { + throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); + } + this._policies.push({ + policy, + options + }); + this._orderedPolicies = void 0; + } + removePolicy(options) { + const removedPolicies = []; + this._policies = this._policies.filter((policyDescriptor) => { + if (options.name && policyDescriptor.policy.name === options.name || options.phase && policyDescriptor.options.phase === options.phase) { + removedPolicies.push(policyDescriptor.policy); + return false; + } else { + return true; + } + }); + this._orderedPolicies = void 0; + return removedPolicies; + } + sendRequest(httpClient, request) { + const policies = this.getOrderedPolicies(); + const pipeline = policies.reduceRight((next, policy) => { + return (req) => { + return policy.sendRequest(req, next); + }; + }, (req) => httpClient.sendRequest(req)); + return pipeline(request); + } + getOrderedPolicies() { + if (!this._orderedPolicies) { + this._orderedPolicies = this.orderPolicies(); + } + return this._orderedPolicies; + } + clone() { + return new _HttpPipeline(this._policies); + } + static create() { + return new _HttpPipeline(); + } + orderPolicies() { + const result = []; + const policyMap = /* @__PURE__ */ new Map(); + function createPhase(name) { + return { + name, + policies: /* @__PURE__ */ new Set(), + hasRun: false, + hasAfterPolicies: false + }; + } + __name(createPhase, "createPhase"); + const serializePhase = createPhase("Serialize"); + const noPhase = createPhase("None"); + const deserializePhase = createPhase("Deserialize"); + const retryPhase = createPhase("Retry"); + const signPhase = createPhase("Sign"); + const orderedPhases = [serializePhase, noPhase, deserializePhase, retryPhase, signPhase]; + function getPhase(phase) { + if (phase === "Retry") { + return retryPhase; + } else if (phase === "Serialize") { + return serializePhase; + } else if (phase === "Deserialize") { + return deserializePhase; + } else if (phase === "Sign") { + return signPhase; + } else { + return noPhase; + } + } + __name(getPhase, "getPhase"); + for (const descriptor of this._policies) { + const policy = descriptor.policy; + const options = descriptor.options; + const policyName = policy.name; + if (policyMap.has(policyName)) { + throw new Error("Duplicate policy names not allowed in pipeline"); + } + const node = { + policy, + dependsOn: /* @__PURE__ */ new Set(), + dependants: /* @__PURE__ */ new Set() + }; + if (options.afterPhase) { + node.afterPhase = getPhase(options.afterPhase); + node.afterPhase.hasAfterPolicies = true; + } + policyMap.set(policyName, node); + const phase = getPhase(options.phase); + phase.policies.add(node); + } + for (const descriptor of this._policies) { + const { policy, options } = descriptor; + const policyName = policy.name; + const node = policyMap.get(policyName); + if (!node) { + throw new Error(`Missing node for policy ${policyName}`); + } + if (options.afterPolicies) { + for (const afterPolicyName of options.afterPolicies) { + const afterNode = policyMap.get(afterPolicyName); + if (afterNode) { + node.dependsOn.add(afterNode); + afterNode.dependants.add(node); + } + } + } + if (options.beforePolicies) { + for (const beforePolicyName of options.beforePolicies) { + const beforeNode = policyMap.get(beforePolicyName); + if (beforeNode) { + beforeNode.dependsOn.add(node); + node.dependants.add(beforeNode); + } + } + } + } + function walkPhase(phase) { + phase.hasRun = true; + for (const node of phase.policies) { + if (node.afterPhase && (!node.afterPhase.hasRun || node.afterPhase.policies.size)) { + continue; + } + if (node.dependsOn.size === 0) { + result.push(node.policy); + for (const dependant of node.dependants) { + dependant.dependsOn.delete(node); + } + policyMap.delete(node.policy.name); + phase.policies.delete(node); + } + } + } + __name(walkPhase, "walkPhase"); + function walkPhases() { + for (const phase of orderedPhases) { + walkPhase(phase); + if (phase.policies.size > 0 && phase !== noPhase) { + if (!noPhase.hasRun) { + walkPhase(noPhase); + } + return; + } + if (phase.hasAfterPolicies) { + walkPhase(noPhase); + } + } + } + __name(walkPhases, "walkPhases"); + let iteration = 0; + while (policyMap.size > 0) { + iteration++; + const initialResultLength = result.length; + walkPhases(); + if (result.length <= initialResultLength && iteration > 1) { + throw new Error("Cannot satisfy policy dependencies due to requirements cycle."); + } + } + return result; + } + }; + function createEmptyPipeline() { + return HttpPipeline.create(); + } + __name(createEmptyPipeline, "createEmptyPipeline"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js +var require_object = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isObject = isObject; + function isObject(input) { + return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); + } + __name(isObject, "isObject"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/error.js +var require_error = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/error.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isError = isError; + var object_js_1 = require_object(); + function isError(e) { + if ((0, object_js_1.isObject)(e)) { + const hasName = typeof e.name === "string"; + const hasMessage = typeof e.message === "string"; + return hasName && hasMessage; + } + return false; + } + __name(isError, "isError"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.js +var require_inspect = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.custom = void 0; + var node_util_1 = require("node:util"); + exports2.custom = node_util_1.inspect.custom; + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/sanitizer.js +var require_sanitizer = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/sanitizer.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Sanitizer = void 0; + var object_js_1 = require_object(); + var RedactedString = "REDACTED"; + var 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" + ]; + var defaultAllowedQueryParameters = ["api-version"]; + var Sanitizer = class { + static { + __name(this, "Sanitizer"); + } + allowedHeaderNames; + allowedQueryParameters; + constructor({ additionalAllowedHeaderNames: allowedHeaderNames = [], additionalAllowedQueryParameters: allowedQueryParameters = [] } = {}) { + allowedHeaderNames = defaultAllowedHeaderNames.concat(allowedHeaderNames); + allowedQueryParameters = defaultAllowedQueryParameters.concat(allowedQueryParameters); + this.allowedHeaderNames = new Set(allowedHeaderNames.map((n) => n.toLowerCase())); + this.allowedQueryParameters = new Set(allowedQueryParameters.map((p) => p.toLowerCase())); + } + /** + * Sanitizes an object for logging. + * @param obj - The object to sanitize + * @returns - The sanitized object as a string + */ + sanitize(obj) { + const seen = /* @__PURE__ */ new Set(); + return JSON.stringify(obj, (key, value) => { + if (value instanceof Error) { + return { + ...value, + name: value.name, + message: value.message + }; + } + if (key === "headers") { + 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) || (0, object_js_1.isObject)(value)) { + if (seen.has(value)) { + return "[Circular]"; + } + seen.add(value); + } + return value; + }, 2); + } + /** + * Sanitizes a URL for logging. + * @param value - The URL to sanitize + * @returns - The sanitized URL as a string + */ + sanitizeUrl(value) { + if (typeof value !== "string" || value === null || value === "") { + return value; + } + const url = new URL(value); + if (!url.search) { + return value; + } + for (const [key] of url.searchParams) { + if (!this.allowedQueryParameters.has(key.toLowerCase())) { + url.searchParams.set(key, RedactedString); + } + } + return url.toString(); + } + sanitizeHeaders(obj) { + const sanitized = {}; + for (const key of Object.keys(obj)) { + if (this.allowedHeaderNames.has(key.toLowerCase())) { + sanitized[key] = obj[key]; + } else { + sanitized[key] = RedactedString; + } + } + return sanitized; + } + sanitizeQuery(value) { + if (typeof value !== "object" || value === null) { + return value; + } + const sanitized = {}; + for (const k of Object.keys(value)) { + if (this.allowedQueryParameters.has(k.toLowerCase())) { + sanitized[k] = value[k]; + } else { + sanitized[k] = RedactedString; + } + } + return sanitized; + } + }; + exports2.Sanitizer = Sanitizer; + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/restError.js +var require_restError = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/restError.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.RestError = void 0; + exports2.isRestError = isRestError; + var error_js_1 = require_error(); + var inspect_js_1 = require_inspect(); + var sanitizer_js_1 = require_sanitizer(); + var errorSanitizer = new sanitizer_js_1.Sanitizer(); + var RestError = class _RestError extends Error { + static { + __name(this, "RestError"); + } + /** + * Something went wrong when making the request. + * This means the actual request failed for some reason, + * such as a DNS issue or the connection being lost. + */ + static REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; + /** + * This means that parsing the response from the server failed. + * It may have been malformed. + */ + static PARSE_ERROR = "PARSE_ERROR"; + /** + * The code of the error itself (use statics on RestError if possible.) + */ + code; + /** + * The HTTP status code of the request (if applicable.) + */ + statusCode; + /** + * The request that was made. + * This property is non-enumerable. + */ + request; + /** + * The response received (if any.) + * This property is non-enumerable. + */ + response; + /** + * Bonus property set by the throw site. + */ + details; + constructor(message, options = {}) { + super(message); + this.name = "RestError"; + this.code = options.code; + this.statusCode = options.statusCode; + Object.defineProperty(this, "request", { value: options.request, enumerable: false }); + Object.defineProperty(this, "response", { value: options.response, enumerable: false }); + const agent = this.request?.agent ? { + maxFreeSockets: this.request.agent.maxFreeSockets, + maxSockets: this.request.agent.maxSockets + } : void 0; + Object.defineProperty(this, inspect_js_1.custom, { + value: () => { + return `RestError: ${this.message} + ${errorSanitizer.sanitize({ + ...this, + request: { ...this.request, agent }, + response: this.response + })}`; + }, + enumerable: false + }); + Object.setPrototypeOf(this, _RestError.prototype); + } + }; + exports2.RestError = RestError; + function isRestError(e) { + if (e instanceof RestError) { + return true; + } + return (0, error_js_1.isError)(e) && e.name === "RestError"; + } + __name(isRestError, "isRestError"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/bytesEncoding.js +var require_bytesEncoding = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/bytesEncoding.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.uint8ArrayToString = uint8ArrayToString; + exports2.stringToUint8Array = stringToUint8Array; + function uint8ArrayToString(bytes, format) { + return Buffer.from(bytes).toString(format); + } + __name(uint8ArrayToString, "uint8ArrayToString"); + function stringToUint8Array(value, format) { + return Buffer.from(value, format); + } + __name(stringToUint8Array, "stringToUint8Array"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/log.js +var require_log2 = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/log.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.logger = void 0; + var logger_js_1 = require_logger(); + exports2.logger = (0, logger_js_1.createClientLogger)("ts-http-runtime"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/nodeHttpClient.js +var require_nodeHttpClient = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/nodeHttpClient.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getBodyLength = getBodyLength; + exports2.createNodeHttpClient = createNodeHttpClient; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var node_http_1 = tslib_1.__importDefault(require("node:http")); + var node_https_1 = tslib_1.__importDefault(require("node:https")); + var node_zlib_1 = tslib_1.__importDefault(require("node:zlib")); + var node_stream_1 = require("node:stream"); + var AbortError_js_1 = require_AbortError(); + var httpHeaders_js_1 = require_httpHeaders(); + var restError_js_1 = require_restError(); + var log_js_1 = require_log2(); + var sanitizer_js_1 = require_sanitizer(); + var DEFAULT_TLS_SETTINGS = {}; + function isReadableStream(body) { + return body && typeof body.pipe === "function"; + } + __name(isReadableStream, "isReadableStream"); + function isStreamComplete(stream) { + if (stream.readable === false) { + return Promise.resolve(); + } + return new Promise((resolve) => { + const handler = /* @__PURE__ */ __name(() => { + resolve(); + stream.removeListener("close", handler); + stream.removeListener("end", handler); + stream.removeListener("error", handler); + }, "handler"); + stream.on("close", handler); + stream.on("end", handler); + stream.on("error", handler); + }); + } + __name(isStreamComplete, "isStreamComplete"); + function isArrayBuffer(body) { + return body && typeof body.byteLength === "number"; + } + __name(isArrayBuffer, "isArrayBuffer"); + var ReportTransform = class extends node_stream_1.Transform { + static { + __name(this, "ReportTransform"); + } + loadedBytes = 0; + progressCallback; + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + _transform(chunk, _encoding, callback) { + this.push(chunk); + this.loadedBytes += chunk.length; + try { + this.progressCallback({ loadedBytes: this.loadedBytes }); + callback(); + } catch (e) { + callback(e); + } + } + constructor(progressCallback) { + super(); + this.progressCallback = progressCallback; + } + }; + var NodeHttpClient = class { + static { + __name(this, "NodeHttpClient"); + } + cachedHttpAgent; + cachedHttpsAgents = /* @__PURE__ */ new WeakMap(); + /** + * Makes a request over an underlying transport layer and returns the response. + * @param request - The request to be made. + */ + async sendRequest(request) { + const abortController = new AbortController(); + let abortListener; + if (request.abortSignal) { + if (request.abortSignal.aborted) { + throw new AbortError_js_1.AbortError("The operation was aborted. Request has already been canceled."); + } + abortListener = /* @__PURE__ */ __name((event) => { + if (event.type === "abort") { + abortController.abort(); + } + }, "abortListener"); + request.abortSignal.addEventListener("abort", abortListener); + } + let timeoutId; + if (request.timeout > 0) { + timeoutId = setTimeout(() => { + const sanitizer = new sanitizer_js_1.Sanitizer(); + log_js_1.logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`); + abortController.abort(); + }, request.timeout); + } + const acceptEncoding = request.headers.get("Accept-Encoding"); + const shouldDecompress = acceptEncoding?.includes("gzip") || acceptEncoding?.includes("deflate"); + let body = typeof request.body === "function" ? request.body() : request.body; + if (body && !request.headers.has("Content-Length")) { + const bodyLength = getBodyLength(body); + if (bodyLength !== null) { + request.headers.set("Content-Length", bodyLength); + } + } + let responseStream; + try { + if (body && request.onUploadProgress) { + const onUploadProgress = request.onUploadProgress; + const uploadReportStream = new ReportTransform(onUploadProgress); + uploadReportStream.on("error", (e) => { + log_js_1.logger.error("Error in upload progress", e); + }); + if (isReadableStream(body)) { + body.pipe(uploadReportStream); + } else { + uploadReportStream.end(body); + } + body = uploadReportStream; + } + const res = await this.makeRequest(request, abortController, body); + if (timeoutId !== void 0) { + clearTimeout(timeoutId); + } + const headers = getResponseHeaders(res); + const status = res.statusCode ?? 0; + const response = { + status, + headers, + request + }; + if (request.method === "HEAD") { + res.resume(); + return response; + } + responseStream = shouldDecompress ? getDecodedResponseStream(res, headers) : res; + const onDownloadProgress = request.onDownloadProgress; + if (onDownloadProgress) { + const downloadReportStream = new ReportTransform(onDownloadProgress); + downloadReportStream.on("error", (e) => { + log_js_1.logger.error("Error in download progress", e); + }); + responseStream.pipe(downloadReportStream); + responseStream = downloadReportStream; + } + if ( + // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code + request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) || request.streamResponseStatusCodes?.has(response.status) + ) { + response.readableStreamBody = responseStream; + } else { + response.bodyAsText = await streamToText(responseStream); + } + return response; + } finally { + if (request.abortSignal && abortListener) { + let uploadStreamDone = Promise.resolve(); + if (isReadableStream(body)) { + uploadStreamDone = isStreamComplete(body); + } + let downloadStreamDone = Promise.resolve(); + if (isReadableStream(responseStream)) { + downloadStreamDone = isStreamComplete(responseStream); + } + Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { + if (abortListener) { + request.abortSignal?.removeEventListener("abort", abortListener); + } + }).catch((e) => { + log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); + }); + } + } + } + makeRequest(request, abortController, body) { + const url = new URL(request.url); + const isInsecure = url.protocol !== "https:"; + if (isInsecure && !request.allowInsecureConnection) { + throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); + } + const agent = request.agent ?? this.getOrCreateAgent(request, isInsecure); + const options = { + agent, + hostname: url.hostname, + path: `${url.pathname}${url.search}`, + port: url.port, + method: request.method, + headers: request.headers.toJSON({ preserveCase: true }), + ...request.requestOverrides + }; + return new Promise((resolve, reject) => { + const req = isInsecure ? node_http_1.default.request(options, resolve) : node_https_1.default.request(options, resolve); + req.once("error", (err) => { + reject(new restError_js_1.RestError(err.message, { code: err.code ?? restError_js_1.RestError.REQUEST_SEND_ERROR, request })); + }); + abortController.signal.addEventListener("abort", () => { + const abortError = new AbortError_js_1.AbortError("The operation was aborted. Rejecting from abort signal callback while making request."); + req.destroy(abortError); + reject(abortError); + }); + if (body && isReadableStream(body)) { + body.pipe(req); + } else if (body) { + if (typeof body === "string" || Buffer.isBuffer(body)) { + req.end(body); + } else if (isArrayBuffer(body)) { + req.end(ArrayBuffer.isView(body) ? Buffer.from(body.buffer) : Buffer.from(body)); + } else { + log_js_1.logger.error("Unrecognized body type", body); + reject(new restError_js_1.RestError("Unrecognized body type")); + } + } else { + req.end(); + } + }); + } + getOrCreateAgent(request, isInsecure) { + const disableKeepAlive = request.disableKeepAlive; + if (isInsecure) { + if (disableKeepAlive) { + return node_http_1.default.globalAgent; + } + if (!this.cachedHttpAgent) { + this.cachedHttpAgent = new node_http_1.default.Agent({ keepAlive: true }); + } + return this.cachedHttpAgent; + } else { + if (disableKeepAlive && !request.tlsSettings) { + return node_https_1.default.globalAgent; + } + const tlsSettings = request.tlsSettings ?? DEFAULT_TLS_SETTINGS; + let agent = this.cachedHttpsAgents.get(tlsSettings); + if (agent && agent.options.keepAlive === !disableKeepAlive) { + return agent; + } + log_js_1.logger.info("No cached TLS Agent exist, creating a new Agent"); + agent = new node_https_1.default.Agent({ + // keepAlive is true if disableKeepAlive is false. + keepAlive: !disableKeepAlive, + // Since we are spreading, if no tslSettings were provided, nothing is added to the agent options. + ...tlsSettings + }); + this.cachedHttpsAgents.set(tlsSettings, agent); + return agent; + } + } + }; + function getResponseHeaders(res) { + const headers = (0, httpHeaders_js_1.createHttpHeaders)(); + for (const header of Object.keys(res.headers)) { + const value = res.headers[header]; + if (Array.isArray(value)) { + if (value.length > 0) { + headers.set(header, value[0]); + } + } else if (value) { + headers.set(header, value); + } + } + return headers; + } + __name(getResponseHeaders, "getResponseHeaders"); + function getDecodedResponseStream(stream, headers) { + const contentEncoding = headers.get("Content-Encoding"); + if (contentEncoding === "gzip") { + const unzip = node_zlib_1.default.createGunzip(); + stream.pipe(unzip); + return unzip; + } else if (contentEncoding === "deflate") { + const inflate = node_zlib_1.default.createInflate(); + stream.pipe(inflate); + return inflate; + } + return stream; + } + __name(getDecodedResponseStream, "getDecodedResponseStream"); + function streamToText(stream) { + return new Promise((resolve, reject) => { + const buffer = []; + stream.on("data", (chunk) => { + if (Buffer.isBuffer(chunk)) { + buffer.push(chunk); + } else { + buffer.push(Buffer.from(chunk)); + } + }); + stream.on("end", () => { + resolve(Buffer.concat(buffer).toString("utf8")); + }); + stream.on("error", (e) => { + if (e && e?.name === "AbortError") { + reject(e); + } else { + reject(new restError_js_1.RestError(`Error reading response as text: ${e.message}`, { + code: restError_js_1.RestError.PARSE_ERROR + })); + } + }); + }); + } + __name(streamToText, "streamToText"); + function getBodyLength(body) { + if (!body) { + return 0; + } else if (Buffer.isBuffer(body)) { + return body.length; + } else if (isReadableStream(body)) { + return null; + } else if (isArrayBuffer(body)) { + return body.byteLength; + } else if (typeof body === "string") { + return Buffer.from(body).length; + } else { + return null; + } + } + __name(getBodyLength, "getBodyLength"); + function createNodeHttpClient() { + return new NodeHttpClient(); + } + __name(createNodeHttpClient, "createNodeHttpClient"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js +var require_defaultHttpClient = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createDefaultHttpClient = createDefaultHttpClient; + var nodeHttpClient_js_1 = require_nodeHttpClient(); + function createDefaultHttpClient() { + return (0, nodeHttpClient_js_1.createNodeHttpClient)(); + } + __name(createDefaultHttpClient, "createDefaultHttpClient"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/logPolicy.js +var require_logPolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/logPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.logPolicyName = void 0; + exports2.logPolicy = logPolicy; + var log_js_1 = require_log2(); + var sanitizer_js_1 = require_sanitizer(); + exports2.logPolicyName = "logPolicy"; + function logPolicy(options = {}) { + const logger = options.logger ?? log_js_1.logger.info; + const sanitizer = new sanitizer_js_1.Sanitizer({ + additionalAllowedHeaderNames: options.additionalAllowedHeaderNames, + additionalAllowedQueryParameters: options.additionalAllowedQueryParameters + }); + return { + name: exports2.logPolicyName, + async sendRequest(request, next) { + if (!logger.enabled) { + return next(request); + } + logger(`Request: ${sanitizer.sanitize(request)}`); + const response = await next(request); + logger(`Response status code: ${response.status}`); + logger(`Headers: ${sanitizer.sanitize(response.headers)}`); + return response; + } + }; + } + __name(logPolicy, "logPolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/redirectPolicy.js +var require_redirectPolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/redirectPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.redirectPolicyName = void 0; + exports2.redirectPolicy = redirectPolicy; + exports2.redirectPolicyName = "redirectPolicy"; + var allowedRedirect = ["GET", "HEAD"]; + function redirectPolicy(options = {}) { + const { maxRetries = 20 } = options; + return { + name: exports2.redirectPolicyName, + async sendRequest(request, next) { + const response = await next(request); + return handleRedirect(next, response, maxRetries); + } + }; + } + __name(redirectPolicy, "redirectPolicy"); + async function handleRedirect(next, response, maxRetries, currentRetries = 0) { + const { request, status, headers } = response; + const locationHeader = headers.get("location"); + if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { + const url = new URL(locationHeader, request.url); + request.url = url.toString(); + if (status === 303) { + request.method = "GET"; + request.headers.delete("Content-Length"); + delete request.body; + } + request.headers.delete("Authorization"); + const res = await next(request); + return handleRedirect(next, res, maxRetries, currentRetries + 1); + } + return response; + } + __name(handleRedirect, "handleRedirect"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/userAgentPlatform.js +var require_userAgentPlatform = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/userAgentPlatform.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getHeaderName = getHeaderName; + exports2.setPlatformSpecificData = setPlatformSpecificData; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var node_os_1 = tslib_1.__importDefault(require("node:os")); + var node_process_1 = tslib_1.__importDefault(require("node:process")); + function getHeaderName() { + return "User-Agent"; + } + __name(getHeaderName, "getHeaderName"); + async function setPlatformSpecificData(map) { + if (node_process_1.default && node_process_1.default.versions) { + const osInfo = `${node_os_1.default.type()} ${node_os_1.default.release()}; ${node_os_1.default.arch()}`; + const versions = node_process_1.default.versions; + if (versions.bun) { + map.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map.set("Node", `${versions.node} (${osInfo})`); + } + } + } + __name(setPlatformSpecificData, "setPlatformSpecificData"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/constants.js +var require_constants8 = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/constants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DEFAULT_RETRY_POLICY_COUNT = exports2.SDK_VERSION = void 0; + exports2.SDK_VERSION = "0.3.2"; + exports2.DEFAULT_RETRY_POLICY_COUNT = 3; + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/userAgent.js +var require_userAgent = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/userAgent.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getUserAgentHeaderName = getUserAgentHeaderName; + exports2.getUserAgentValue = getUserAgentValue; + var userAgentPlatform_js_1 = require_userAgentPlatform(); + var constants_js_1 = require_constants8(); + function getUserAgentString(telemetryInfo) { + const parts = []; + for (const [key, value] of telemetryInfo) { + const token = value ? `${key}/${value}` : key; + parts.push(token); + } + return parts.join(" "); + } + __name(getUserAgentString, "getUserAgentString"); + function getUserAgentHeaderName() { + return (0, userAgentPlatform_js_1.getHeaderName)(); + } + __name(getUserAgentHeaderName, "getUserAgentHeaderName"); + async function getUserAgentValue(prefix) { + const runtimeInfo = /* @__PURE__ */ new Map(); + runtimeInfo.set("ts-http-runtime", constants_js_1.SDK_VERSION); + await (0, userAgentPlatform_js_1.setPlatformSpecificData)(runtimeInfo); + const defaultAgent = getUserAgentString(runtimeInfo); + const userAgentValue = prefix ? `${prefix} ${defaultAgent}` : defaultAgent; + return userAgentValue; + } + __name(getUserAgentValue, "getUserAgentValue"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/userAgentPolicy.js +var require_userAgentPolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/userAgentPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.userAgentPolicyName = void 0; + exports2.userAgentPolicy = userAgentPolicy; + var userAgent_js_1 = require_userAgent(); + var UserAgentHeaderName = (0, userAgent_js_1.getUserAgentHeaderName)(); + exports2.userAgentPolicyName = "userAgentPolicy"; + function userAgentPolicy(options = {}) { + const userAgentValue = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); + return { + name: exports2.userAgentPolicyName, + async sendRequest(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); + } + return next(request); + } + }; + } + __name(userAgentPolicy, "userAgentPolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/decompressResponsePolicy.js +var require_decompressResponsePolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/decompressResponsePolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.decompressResponsePolicyName = void 0; + exports2.decompressResponsePolicy = decompressResponsePolicy; + exports2.decompressResponsePolicyName = "decompressResponsePolicy"; + function decompressResponsePolicy() { + return { + name: exports2.decompressResponsePolicyName, + async sendRequest(request, next) { + if (request.method !== "HEAD") { + request.headers.set("Accept-Encoding", "gzip,deflate"); + } + return next(request); + } + }; + } + __name(decompressResponsePolicy, "decompressResponsePolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/random.js +var require_random = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/random.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; + function getRandomIntegerInclusive(min, max) { + min = Math.ceil(min); + max = Math.floor(max); + const offset = Math.floor(Math.random() * (max - min + 1)); + return offset + min; + } + __name(getRandomIntegerInclusive, "getRandomIntegerInclusive"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/delay.js +var require_delay = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/delay.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.calculateRetryDelay = calculateRetryDelay; + var random_js_1 = require_random(); + function calculateRetryDelay(retryAttempt, config) { + const exponentialDelay = config.retryDelayInMs * Math.pow(2, retryAttempt); + const clampedDelay = Math.min(config.maxRetryDelayInMs, exponentialDelay); + const retryAfterInMs = clampedDelay / 2 + (0, random_js_1.getRandomIntegerInclusive)(0, clampedDelay / 2); + return { retryAfterInMs }; + } + __name(calculateRetryDelay, "calculateRetryDelay"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/helpers.js +var require_helpers = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/helpers.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.delay = delay; + exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; + var AbortError_js_1 = require_AbortError(); + var StandardAbortMessage = "The operation was aborted."; + function delay(delayInMs, value, options) { + return new Promise((resolve, reject) => { + let timer = void 0; + let onAborted = void 0; + const rejectOnAbort = /* @__PURE__ */ __name(() => { + return reject(new AbortError_js_1.AbortError(options?.abortErrorMsg ? options?.abortErrorMsg : StandardAbortMessage)); + }, "rejectOnAbort"); + const removeListeners = /* @__PURE__ */ __name(() => { + if (options?.abortSignal && onAborted) { + options.abortSignal.removeEventListener("abort", onAborted); + } + }, "removeListeners"); + onAborted = /* @__PURE__ */ __name(() => { + if (timer) { + clearTimeout(timer); + } + removeListeners(); + return rejectOnAbort(); + }, "onAborted"); + if (options?.abortSignal && options.abortSignal.aborted) { + return rejectOnAbort(); + } + timer = setTimeout(() => { + removeListeners(); + resolve(value); + }, delayInMs); + if (options?.abortSignal) { + options.abortSignal.addEventListener("abort", onAborted); + } + }); + } + __name(delay, "delay"); + function parseHeaderValueAsNumber(response, headerName) { + const value = response.headers.get(headerName); + if (!value) + return; + const valueAsNum = Number(value); + if (Number.isNaN(valueAsNum)) + return; + return valueAsNum; + } + __name(parseHeaderValueAsNumber, "parseHeaderValueAsNumber"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/retryStrategies/throttlingRetryStrategy.js +var require_throttlingRetryStrategy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/retryStrategies/throttlingRetryStrategy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isThrottlingRetryResponse = isThrottlingRetryResponse; + exports2.throttlingRetryStrategy = throttlingRetryStrategy; + var helpers_js_1 = require_helpers(); + var RetryAfterHeader = "Retry-After"; + var AllRetryAfterHeaders = ["retry-after-ms", "x-ms-retry-after-ms", RetryAfterHeader]; + function getRetryAfterInMs(response) { + if (!(response && [429, 503].includes(response.status))) + return void 0; + try { + for (const header of AllRetryAfterHeaders) { + const retryAfterValue = (0, helpers_js_1.parseHeaderValueAsNumber)(response, header); + if (retryAfterValue === 0 || retryAfterValue) { + const multiplyingFactor = header === RetryAfterHeader ? 1e3 : 1; + return retryAfterValue * multiplyingFactor; + } + } + const retryAfterHeader = response.headers.get(RetryAfterHeader); + if (!retryAfterHeader) + return; + const date = Date.parse(retryAfterHeader); + const diff = date - Date.now(); + return Number.isFinite(diff) ? Math.max(0, diff) : void 0; + } catch { + return void 0; + } + } + __name(getRetryAfterInMs, "getRetryAfterInMs"); + function isThrottlingRetryResponse(response) { + return Number.isFinite(getRetryAfterInMs(response)); + } + __name(isThrottlingRetryResponse, "isThrottlingRetryResponse"); + function throttlingRetryStrategy() { + return { + name: "throttlingRetryStrategy", + retry({ response }) { + const retryAfterInMs = getRetryAfterInMs(response); + if (!Number.isFinite(retryAfterInMs)) { + return { skipStrategy: true }; + } + return { + retryAfterInMs + }; + } + }; + } + __name(throttlingRetryStrategy, "throttlingRetryStrategy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/retryStrategies/exponentialRetryStrategy.js +var require_exponentialRetryStrategy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/retryStrategies/exponentialRetryStrategy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.exponentialRetryStrategy = exponentialRetryStrategy; + exports2.isExponentialRetryResponse = isExponentialRetryResponse; + exports2.isSystemError = isSystemError; + var delay_js_1 = require_delay(); + var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); + var DEFAULT_CLIENT_RETRY_INTERVAL = 1e3; + var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1e3 * 64; + function exponentialRetryStrategy(options = {}) { + const retryInterval = options.retryDelayInMs ?? DEFAULT_CLIENT_RETRY_INTERVAL; + const maxRetryInterval = options.maxRetryDelayInMs ?? DEFAULT_CLIENT_MAX_RETRY_INTERVAL; + return { + name: "exponentialRetryStrategy", + retry({ retryCount, response, responseError }) { + const matchedSystemError = isSystemError(responseError); + const ignoreSystemErrors = matchedSystemError && options.ignoreSystemErrors; + const isExponential = isExponentialRetryResponse(response); + const ignoreExponentialResponse = isExponential && options.ignoreHttpStatusCodes; + const unknownResponse = response && ((0, throttlingRetryStrategy_js_1.isThrottlingRetryResponse)(response) || !isExponential); + if (unknownResponse || ignoreExponentialResponse || ignoreSystemErrors) { + return { skipStrategy: true }; + } + if (responseError && !matchedSystemError && !isExponential) { + return { errorToThrow: responseError }; + } + return (0, delay_js_1.calculateRetryDelay)(retryCount, { + retryDelayInMs: retryInterval, + maxRetryDelayInMs: maxRetryInterval + }); + } + }; + } + __name(exponentialRetryStrategy, "exponentialRetryStrategy"); + function isExponentialRetryResponse(response) { + return Boolean(response && response.status !== void 0 && (response.status >= 500 || response.status === 408) && response.status !== 501 && response.status !== 505); + } + __name(isExponentialRetryResponse, "isExponentialRetryResponse"); + function isSystemError(err) { + if (!err) { + return false; + } + return err.code === "ETIMEDOUT" || err.code === "ESOCKETTIMEDOUT" || err.code === "ECONNREFUSED" || err.code === "ECONNRESET" || err.code === "ENOENT" || err.code === "ENOTFOUND"; + } + __name(isSystemError, "isSystemError"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/retryPolicy.js +var require_retryPolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/retryPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.retryPolicy = retryPolicy; + var helpers_js_1 = require_helpers(); + var AbortError_js_1 = require_AbortError(); + var logger_js_1 = require_logger(); + var constants_js_1 = require_constants8(); + var retryPolicyLogger = (0, logger_js_1.createClientLogger)("ts-http-runtime retryPolicy"); + var retryPolicyName = "retryPolicy"; + function retryPolicy(strategies, options = { maxRetries: constants_js_1.DEFAULT_RETRY_POLICY_COUNT }) { + const logger = options.logger || retryPolicyLogger; + return { + name: retryPolicyName, + async sendRequest(request, next) { + let response; + let responseError; + let retryCount = -1; + retryRequest: + while (true) { + retryCount += 1; + response = void 0; + responseError = void 0; + try { + logger.info(`Retry ${retryCount}: Attempting to send request`, request.requestId); + response = await next(request); + logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); + } catch (e) { + logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); + responseError = e; + if (!e || responseError.name !== "RestError") { + throw e; + } + response = responseError.response; + } + if (request.abortSignal?.aborted) { + logger.error(`Retry ${retryCount}: Request aborted.`); + const abortError = new AbortError_js_1.AbortError(); + throw abortError; + } + if (retryCount >= (options.maxRetries ?? constants_js_1.DEFAULT_RETRY_POLICY_COUNT)) { + logger.info(`Retry ${retryCount}: Maximum retries reached. Returning the last received response, or throwing the last received error.`); + if (responseError) { + throw responseError; + } else if (response) { + return response; + } else { + throw new Error("Maximum retries reached with no response or error to throw"); + } + } + logger.info(`Retry ${retryCount}: Processing ${strategies.length} retry strategies.`); + strategiesLoop: + for (const strategy of strategies) { + const strategyLogger = strategy.logger || logger; + strategyLogger.info(`Retry ${retryCount}: Processing retry strategy ${strategy.name}.`); + const modifiers = strategy.retry({ + retryCount, + response, + responseError + }); + if (modifiers.skipStrategy) { + strategyLogger.info(`Retry ${retryCount}: Skipped.`); + continue strategiesLoop; + } + const { errorToThrow, retryAfterInMs, redirectTo } = modifiers; + if (errorToThrow) { + strategyLogger.error(`Retry ${retryCount}: Retry strategy ${strategy.name} throws error:`, errorToThrow); + throw errorToThrow; + } + if (retryAfterInMs || retryAfterInMs === 0) { + strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} retries after ${retryAfterInMs}`); + await (0, helpers_js_1.delay)(retryAfterInMs, void 0, { abortSignal: request.abortSignal }); + continue retryRequest; + } + if (redirectTo) { + strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); + request.url = redirectTo; + continue retryRequest; + } + } + if (responseError) { + logger.info(`None of the retry strategies could work with the received error. Throwing it.`); + throw responseError; + } + if (response) { + logger.info(`None of the retry strategies could work with the received response. Returning it.`); + return response; + } + } + } + }; + } + __name(retryPolicy, "retryPolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/defaultRetryPolicy.js +var require_defaultRetryPolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/defaultRetryPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.defaultRetryPolicyName = void 0; + exports2.defaultRetryPolicy = defaultRetryPolicy; + var exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); + var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); + var retryPolicy_js_1 = require_retryPolicy(); + var constants_js_1 = require_constants8(); + exports2.defaultRetryPolicyName = "defaultRetryPolicy"; + function defaultRetryPolicy(options = {}) { + return { + name: exports2.defaultRetryPolicyName, + sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)(), (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(options)], { + maxRetries: options.maxRetries ?? constants_js_1.DEFAULT_RETRY_POLICY_COUNT + }).sendRequest + }; + } + __name(defaultRetryPolicy, "defaultRetryPolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/checkEnvironment.js +var require_checkEnvironment = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/checkEnvironment.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isReactNative = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isBun = exports2.isDeno = exports2.isWebWorker = exports2.isBrowser = void 0; + exports2.isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; + exports2.isWebWorker = typeof self === "object" && typeof self?.importScripts === "function" && (self.constructor?.name === "DedicatedWorkerGlobalScope" || self.constructor?.name === "ServiceWorkerGlobalScope" || self.constructor?.name === "SharedWorkerGlobalScope"); + exports2.isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined"; + exports2.isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined"; + exports2.isNodeLike = typeof globalThis.process !== "undefined" && Boolean(globalThis.process.version) && Boolean(globalThis.process.versions?.node); + exports2.isNodeRuntime = exports2.isNodeLike && !exports2.isBun && !exports2.isDeno; + exports2.isReactNative = typeof navigator !== "undefined" && navigator?.product === "ReactNative"; + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/formDataPolicy.js var require_formDataPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/formDataPolicy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.formDataPolicyName = void 0; exports2.formDataPolicy = formDataPolicy; - var core_util_1 = require_commonjs3(); + var bytesEncoding_js_1 = require_bytesEncoding(); + var checkEnvironment_js_1 = require_checkEnvironment(); var httpHeaders_js_1 = require_httpHeaders(); exports2.formDataPolicyName = "formDataPolicy"; function formDataToFormDataMap(formData) { - var _a; const formDataMap = {}; for (const [key, value] of formData.entries()) { - (_a = formDataMap[key]) !== null && _a !== void 0 ? _a : formDataMap[key] = []; + formDataMap[key] ??= []; formDataMap[key].push(value); } return formDataMap; @@ -28553,7 +28325,7 @@ var require_formDataPolicy = __commonJS({ return { name: exports2.formDataPolicyName, async sendRequest(request, next) { - if (core_util_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { + if (checkEnvironment_js_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { request.formData = formDataToFormDataMap(request.body); request.body = void 0; } @@ -28590,7 +28362,7 @@ var require_formDataPolicy = __commonJS({ if (contentType && !contentType.startsWith("multipart/form-data")) { return; } - request.headers.set("Content-Type", contentType !== null && contentType !== void 0 ? contentType : "multipart/form-data"); + request.headers.set("Content-Type", contentType ?? "multipart/form-data"); const parts = []; for (const [fieldName, values] of Object.entries(formData)) { for (const value of Array.isArray(values) ? values : [values]) { @@ -28599,7 +28371,7 @@ var require_formDataPolicy = __commonJS({ headers: (0, httpHeaders_js_1.createHttpHeaders)({ "Content-Disposition": `form-data; name="${fieldName}"` }), - body: (0, core_util_1.stringToUint8Array)(value, "utf-8") + body: (0, bytesEncoding_js_1.stringToUint8Array)(value, "utf-8") }); } else if (value === void 0 || value === null || typeof value !== "object") { throw new Error(`Unexpected value for key ${fieldName}: ${value}. Value should be serialized to string first.`); @@ -28630,19 +28402,19 @@ var require_ms = __commonJS({ var d = h * 24; var w = d * 7; var y = d * 365.25; - module2.exports = function(val2, options) { + module2.exports = function(val, options) { options = options || {}; - var type = typeof val2; - if (type === "string" && val2.length > 0) { - return parse2(val2); - } else if (type === "number" && isFinite(val2)) { - return options.long ? fmtLong(val2) : fmtShort(val2); + var type = typeof val; + if (type === "string" && val.length > 0) { + return parse(val); + } else if (type === "number" && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2) + "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) ); }; - function parse2(str) { + function parse(str) { str = String(str); if (str.length > 100) { return; @@ -28698,7 +28470,7 @@ var require_ms = __commonJS({ return void 0; } } - __name(parse2, "parse"); + __name(parse, "parse"); function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { @@ -28797,8 +28569,8 @@ var require_common = __commonJS({ index++; const formatter = createDebug.formatters[format]; if (typeof formatter === "function") { - const val2 = args[index]; - match = formatter.call(self2, val2); + const val = args[index]; + match = formatter.call(self2, val); args.splice(index, 1); index--; } @@ -28848,59 +28620,73 @@ var require_common = __commonJS({ createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; - let i; - const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/); - const len = split.length; - for (i = 0; i < len; i++) { - if (!split[i]) { - continue; - } - namespaces = split[i].replace(/\*/g, ".*?"); - if (namespaces[0] === "-") { - createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$")); + const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); + for (const ns of split) { + if (ns[0] === "-") { + createDebug.skips.push(ns.slice(1)); } else { - createDebug.names.push(new RegExp("^" + namespaces + "$")); + createDebug.names.push(ns); } } } __name(enable, "enable"); + function matchesTemplate(search, template) { + let searchIndex = 0; + let templateIndex = 0; + let starIndex = -1; + let matchIndex = 0; + while (searchIndex < search.length) { + if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) { + if (template[templateIndex] === "*") { + starIndex = templateIndex; + matchIndex = searchIndex; + templateIndex++; + } else { + searchIndex++; + templateIndex++; + } + } else if (starIndex !== -1) { + templateIndex = starIndex + 1; + matchIndex++; + searchIndex = matchIndex; + } else { + return false; + } + } + while (templateIndex < template.length && template[templateIndex] === "*") { + templateIndex++; + } + return templateIndex === template.length; + } + __name(matchesTemplate, "matchesTemplate"); function disable() { const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace) + ...createDebug.names, + ...createDebug.skips.map((namespace) => "-" + namespace) ].join(","); createDebug.enable(""); return namespaces; } __name(disable, "disable"); function enabled(name) { - if (name[name.length - 1] === "*") { - return true; - } - let i; - let len; - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { return false; } } - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { return true; } } return false; } __name(enabled, "enabled"); - function toNamespace(regexp) { - return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*"); - } - __name(toNamespace, "toNamespace"); - function coerce(val2) { - if (val2 instanceof Error) { - return val2.stack || val2.message; + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; } - return val2; + return val; } __name(coerce, "coerce"); function destroy() { @@ -29062,7 +28848,7 @@ var require_browser = __commonJS({ function load() { let r; try { - r = exports2.storage.getItem("debug"); + r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); } catch (error) { } if (!r && typeof process !== "undefined" && "env" in process) { @@ -29175,10 +28961,10 @@ var require_supports_color = __commonJS({ return 3; } if ("TERM_PROGRAM" in env) { - const version2 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); switch (env.TERM_PROGRAM) { case "iTerm.app": - return version2 >= 3 ? 3 : 2; + return version >= 3 ? 3 : 2; case "Apple_Terminal": return 2; } @@ -29315,17 +29101,17 @@ var require_node = __commonJS({ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => { return k.toUpperCase(); }); - let val2 = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val2)) { - val2 = true; - } else if (/^(no|off|false|disabled)$/i.test(val2)) { - val2 = false; - } else if (val2 === "null") { - val2 = null; + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === "null") { + val = null; } else { - val2 = Number(val2); + val = Number(val); } - obj[prop] = val2; + obj[prop] = val; return obj; }, {}); function useColors() { @@ -29586,7 +29372,7 @@ var require_dist = __commonJS({ // In order to properly update the socket pool, we need to call `getName()` on // the core `https.Agent` if it is a secureEndpoint. getName(options) { - const secureEndpoint = typeof options.secureEndpoint === "boolean" ? options.secureEndpoint : this.isSecureEndpoint(options); + const secureEndpoint = this.isSecureEndpoint(options); if (secureEndpoint) { return https_1.Agent.prototype.getName.call(this, options); } @@ -29602,7 +29388,11 @@ var require_dist = __commonJS({ Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => { this.decrementSockets(name, fakeSocket); if (socket instanceof http.Agent) { - return socket.addRequest(req, connectOpts); + try { + return socket.addRequest(req, connectOpts); + } catch (err) { + return cb(err); + } } this[INTERNAL].currentSocket = socket; super.createSocket(req, options, cb); @@ -29791,6 +29581,15 @@ var require_dist2 = __commonJS({ var url_1 = require("url"); var parse_proxy_response_1 = require_parse_proxy_response(); var debug = (0, debug_1.default)("https-proxy-agent"); + var setServernameFromNonIpHost = /* @__PURE__ */ __name((options) => { + if (options.servername === void 0 && options.host && !net.isIP(options.host)) { + return { + ...options, + servername: options.host + }; + } + return options; + }, "setServernameFromNonIpHost"); var HttpsProxyAgent = class extends agent_base_1.Agent { static { __name(this, "HttpsProxyAgent"); @@ -29823,11 +29622,7 @@ var require_dist2 = __commonJS({ let socket; if (proxy.protocol === "https:") { debug("Creating `tls.Socket`: %o", this.connectOpts); - const servername = this.connectOpts.servername || this.connectOpts.host; - socket = tls.connect({ - ...this.connectOpts, - servername - }); + socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); } else { debug("Creating `net.Socket`: %o", this.connectOpts); socket = net.connect(this.connectOpts); @@ -29858,11 +29653,9 @@ var require_dist2 = __commonJS({ req.once("socket", resume); if (opts.secureEndpoint) { debug("Upgrading socket connection to TLS"); - const servername = opts.servername || opts.host; return tls.connect({ - ...omit(opts, "host", "path", "port"), - socket, - servername + ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), + socket }); } return socket; @@ -30038,9 +29831,9 @@ var require_dist3 = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/proxyPolicy.js var require_proxyPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/proxyPolicy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.globalNoProxyList = exports2.proxyPolicyName = void 0; @@ -30082,7 +29875,7 @@ var require_proxyPolicy = __commonJS({ return false; } const host = new URL(uri).hostname; - if (bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.has(host)) { + if (bypassedMap?.has(host)) { return bypassedMap.get(host); } let isBypassedFlag = false; @@ -30101,7 +29894,7 @@ var require_proxyPolicy = __commonJS({ } } } - bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.set(host, isBypassedFlag); + bypassedMap?.set(host, isBypassedFlag); return isBypassedFlag; } __name(isBypassed, "isBypassed"); @@ -30140,7 +29933,7 @@ var require_proxyPolicy = __commonJS({ let parsedProxyUrl; try { parsedProxyUrl = new URL(settings.host); - } catch (_a) { + } catch { throw new Error(`Expecting a valid host string in proxy settings, but found "${settings.host}".`); } parsedProxyUrl.port = String(settings.port); @@ -30185,8 +29978,7 @@ var require_proxyPolicy = __commonJS({ return { name: exports2.proxyPolicyName, async sendRequest(request, next) { - var _a; - if (!request.proxySettings && defaultProxy && !isBypassed(request.url, (_a = options === null || options === void 0 ? void 0 : options.customNoProxyList) !== null && _a !== void 0 ? _a : exports2.globalNoProxyList, (options === null || options === void 0 ? void 0 : options.customNoProxyList) ? void 0 : globalBypassedMap)) { + if (!request.proxySettings && defaultProxy && !isBypassed(request.url, options?.customNoProxyList ?? exports2.globalNoProxyList, options?.customNoProxyList ? void 0 : globalBypassedMap)) { setProxyAgentOnRequest(request, cachedAgents, defaultProxy); } else if (request.proxySettings) { setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); @@ -30199,6 +29991,2130 @@ var require_proxyPolicy = __commonJS({ } }); +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/agentPolicy.js +var require_agentPolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/agentPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.agentPolicyName = void 0; + exports2.agentPolicy = agentPolicy; + exports2.agentPolicyName = "agentPolicy"; + function agentPolicy(agent) { + return { + name: exports2.agentPolicyName, + sendRequest: async (req, next) => { + if (!req.agent) { + req.agent = agent; + } + return next(req); + } + }; + } + __name(agentPolicy, "agentPolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/tlsPolicy.js +var require_tlsPolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/tlsPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.tlsPolicyName = void 0; + exports2.tlsPolicy = tlsPolicy; + exports2.tlsPolicyName = "tlsPolicy"; + function tlsPolicy(tlsSettings) { + return { + name: exports2.tlsPolicyName, + sendRequest: async (req, next) => { + if (!req.tlsSettings) { + req.tlsSettings = tlsSettings; + } + return next(req); + } + }; + } + __name(tlsPolicy, "tlsPolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/typeGuards.js +var require_typeGuards = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/typeGuards.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isNodeReadableStream = isNodeReadableStream; + exports2.isWebReadableStream = isWebReadableStream; + exports2.isBinaryBody = isBinaryBody; + exports2.isReadableStream = isReadableStream; + exports2.isBlob = isBlob; + function isNodeReadableStream(x) { + return Boolean(x && typeof x["pipe"] === "function"); + } + __name(isNodeReadableStream, "isNodeReadableStream"); + function isWebReadableStream(x) { + return Boolean(x && typeof x.getReader === "function" && typeof x.tee === "function"); + } + __name(isWebReadableStream, "isWebReadableStream"); + function isBinaryBody(body) { + return body !== void 0 && (body instanceof Uint8Array || isReadableStream(body) || typeof body === "function" || body instanceof Blob); + } + __name(isBinaryBody, "isBinaryBody"); + function isReadableStream(x) { + return isNodeReadableStream(x) || isWebReadableStream(x); + } + __name(isReadableStream, "isReadableStream"); + function isBlob(x) { + return typeof x.stream === "function"; + } + __name(isBlob, "isBlob"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/concat.js +var require_concat = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/concat.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.concat = concat; + var stream_1 = require("stream"); + var typeGuards_js_1 = require_typeGuards(); + async function* streamAsyncIterator() { + const reader = this.getReader(); + try { + while (true) { + const { done, value } = await reader.read(); + if (done) { + return; + } + yield value; + } + } finally { + reader.releaseLock(); + } + } + __name(streamAsyncIterator, "streamAsyncIterator"); + function makeAsyncIterable(webStream) { + if (!webStream[Symbol.asyncIterator]) { + webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); + } + if (!webStream.values) { + webStream.values = streamAsyncIterator.bind(webStream); + } + } + __name(makeAsyncIterable, "makeAsyncIterable"); + function ensureNodeStream(stream) { + if (stream instanceof ReadableStream) { + makeAsyncIterable(stream); + return stream_1.Readable.fromWeb(stream); + } else { + return stream; + } + } + __name(ensureNodeStream, "ensureNodeStream"); + function toStream(source) { + if (source instanceof Uint8Array) { + return stream_1.Readable.from(Buffer.from(source)); + } else if ((0, typeGuards_js_1.isBlob)(source)) { + return ensureNodeStream(source.stream()); + } else { + return ensureNodeStream(source); + } + } + __name(toStream, "toStream"); + async function concat(sources) { + return function() { + const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); + return stream_1.Readable.from(async function* () { + for (const stream of streams) { + for await (const chunk of stream) { + yield chunk; + } + } + }()); + }; + } + __name(concat, "concat"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/multipartPolicy.js +var require_multipartPolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/multipartPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.multipartPolicyName = void 0; + exports2.multipartPolicy = multipartPolicy; + var bytesEncoding_js_1 = require_bytesEncoding(); + var typeGuards_js_1 = require_typeGuards(); + var uuidUtils_js_1 = require_uuidUtils(); + var concat_js_1 = require_concat(); + function generateBoundary() { + return `----AzSDKFormBoundary${(0, uuidUtils_js_1.randomUUID)()}`; + } + __name(generateBoundary, "generateBoundary"); + function encodeHeaders(headers) { + let result = ""; + for (const [key, value] of headers) { + result += `${key}: ${value}\r +`; + } + return result; + } + __name(encodeHeaders, "encodeHeaders"); + function getLength(source) { + if (source instanceof Uint8Array) { + return source.byteLength; + } else if ((0, typeGuards_js_1.isBlob)(source)) { + return source.size === -1 ? void 0 : source.size; + } else { + return void 0; + } + } + __name(getLength, "getLength"); + function getTotalLength(sources) { + let total = 0; + for (const source of sources) { + const partLength = getLength(source); + if (partLength === void 0) { + return void 0; + } else { + total += partLength; + } + } + return total; + } + __name(getTotalLength, "getTotalLength"); + async function buildRequestBody(request, parts, boundary) { + const sources = [ + (0, bytesEncoding_js_1.stringToUint8Array)(`--${boundary}`, "utf-8"), + ...parts.flatMap((part) => [ + (0, bytesEncoding_js_1.stringToUint8Array)("\r\n", "utf-8"), + (0, bytesEncoding_js_1.stringToUint8Array)(encodeHeaders(part.headers), "utf-8"), + (0, bytesEncoding_js_1.stringToUint8Array)("\r\n", "utf-8"), + part.body, + (0, bytesEncoding_js_1.stringToUint8Array)(`\r +--${boundary}`, "utf-8") + ]), + (0, bytesEncoding_js_1.stringToUint8Array)("--\r\n\r\n", "utf-8") + ]; + const contentLength = getTotalLength(sources); + if (contentLength) { + request.headers.set("Content-Length", contentLength); + } + request.body = await (0, concat_js_1.concat)(sources); + } + __name(buildRequestBody, "buildRequestBody"); + exports2.multipartPolicyName = "multipartPolicy"; + var maxBoundaryLength = 70; + var validBoundaryCharacters = new Set(`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?`); + function assertValidBoundary(boundary) { + if (boundary.length > maxBoundaryLength) { + throw new Error(`Multipart boundary "${boundary}" exceeds maximum length of 70 characters`); + } + if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { + throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); + } + } + __name(assertValidBoundary, "assertValidBoundary"); + function multipartPolicy() { + return { + name: exports2.multipartPolicyName, + async sendRequest(request, next) { + if (!request.multipartBody) { + return next(request); + } + if (request.body) { + throw new Error("multipartBody and regular body cannot be set at the same time"); + } + let boundary = request.multipartBody.boundary; + const contentTypeHeader = request.headers.get("Content-Type") ?? "multipart/mixed"; + const parsedHeader = contentTypeHeader.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/); + if (!parsedHeader) { + throw new Error(`Got multipart request body, but content-type header was not multipart: ${contentTypeHeader}`); + } + const [, contentType, parsedBoundary] = parsedHeader; + if (parsedBoundary && boundary && parsedBoundary !== boundary) { + throw new Error(`Multipart boundary was specified as ${parsedBoundary} in the header, but got ${boundary} in the request body`); + } + boundary ??= parsedBoundary; + if (boundary) { + assertValidBoundary(boundary); + } else { + boundary = generateBoundary(); + } + request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); + await buildRequestBody(request, request.multipartBody.parts, boundary); + request.multipartBody = void 0; + return next(request); + } + }; + } + __name(multipartPolicy, "multipartPolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/createPipelineFromOptions.js +var require_createPipelineFromOptions = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/createPipelineFromOptions.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createPipelineFromOptions = createPipelineFromOptions; + var logPolicy_js_1 = require_logPolicy(); + var pipeline_js_1 = require_pipeline(); + var redirectPolicy_js_1 = require_redirectPolicy(); + var userAgentPolicy_js_1 = require_userAgentPolicy(); + var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); + var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); + var formDataPolicy_js_1 = require_formDataPolicy(); + var checkEnvironment_js_1 = require_checkEnvironment(); + var proxyPolicy_js_1 = require_proxyPolicy(); + var agentPolicy_js_1 = require_agentPolicy(); + var tlsPolicy_js_1 = require_tlsPolicy(); + var multipartPolicy_js_1 = require_multipartPolicy(); + function createPipelineFromOptions(options) { + const pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (checkEnvironment_js_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); + } + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); + } + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + if (checkEnvironment_js_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); + } + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; + } + __name(createPipelineFromOptions, "createPipelineFromOptions"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/apiVersionPolicy.js +var require_apiVersionPolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/apiVersionPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.apiVersionPolicyName = void 0; + exports2.apiVersionPolicy = apiVersionPolicy; + exports2.apiVersionPolicyName = "ApiVersionPolicy"; + function apiVersionPolicy(options) { + return { + name: exports2.apiVersionPolicyName, + sendRequest: (req, next) => { + const url = new URL(req.url); + if (!url.searchParams.get("api-version") && options.apiVersion) { + req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${options.apiVersion}`; + } + return next(req); + } + }; + } + __name(apiVersionPolicy, "apiVersionPolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/auth/credentials.js +var require_credentials = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/auth/credentials.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isOAuth2TokenCredential = isOAuth2TokenCredential; + exports2.isBearerTokenCredential = isBearerTokenCredential; + exports2.isBasicCredential = isBasicCredential; + exports2.isApiKeyCredential = isApiKeyCredential; + function isOAuth2TokenCredential(credential) { + return "getOAuth2Token" in credential; + } + __name(isOAuth2TokenCredential, "isOAuth2TokenCredential"); + function isBearerTokenCredential(credential) { + return "getBearerToken" in credential; + } + __name(isBearerTokenCredential, "isBearerTokenCredential"); + function isBasicCredential(credential) { + return "username" in credential && "password" in credential; + } + __name(isBasicCredential, "isBasicCredential"); + function isApiKeyCredential(credential) { + return "key" in credential; + } + __name(isApiKeyCredential, "isApiKeyCredential"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/checkInsecureConnection.js +var require_checkInsecureConnection = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/checkInsecureConnection.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ensureSecureConnection = ensureSecureConnection; + var log_js_1 = require_log2(); + var insecureConnectionWarningEmmitted = false; + function allowInsecureConnection(request, options) { + if (options.allowInsecureConnection && request.allowInsecureConnection) { + const url = new URL(request.url); + if (url.hostname === "localhost" || url.hostname === "127.0.0.1") { + return true; + } + } + return false; + } + __name(allowInsecureConnection, "allowInsecureConnection"); + function emitInsecureConnectionWarning() { + const warning = "Sending token over insecure transport. Assume any token issued is compromised."; + log_js_1.logger.warning(warning); + if (typeof process?.emitWarning === "function" && !insecureConnectionWarningEmmitted) { + insecureConnectionWarningEmmitted = true; + process.emitWarning(warning); + } + } + __name(emitInsecureConnectionWarning, "emitInsecureConnectionWarning"); + function ensureSecureConnection(request, options) { + if (!request.url.toLowerCase().startsWith("https://")) { + if (allowInsecureConnection(request, options)) { + emitInsecureConnectionWarning(); + } else { + throw new Error("Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false."); + } + } + } + __name(ensureSecureConnection, "ensureSecureConnection"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/apiKeyAuthenticationPolicy.js +var require_apiKeyAuthenticationPolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/apiKeyAuthenticationPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.apiKeyAuthenticationPolicyName = void 0; + exports2.apiKeyAuthenticationPolicy = apiKeyAuthenticationPolicy; + var checkInsecureConnection_js_1 = require_checkInsecureConnection(); + exports2.apiKeyAuthenticationPolicyName = "apiKeyAuthenticationPolicy"; + function apiKeyAuthenticationPolicy(options) { + return { + name: exports2.apiKeyAuthenticationPolicyName, + async sendRequest(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "apiKey"); + if (!scheme) { + return next(request); + } + if (scheme.apiKeyLocation !== "header") { + throw new Error(`Unsupported API key location: ${scheme.apiKeyLocation}`); + } + request.headers.set(scheme.name, options.credential.key); + return next(request); + } + }; + } + __name(apiKeyAuthenticationPolicy, "apiKeyAuthenticationPolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/basicAuthenticationPolicy.js +var require_basicAuthenticationPolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/basicAuthenticationPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.basicAuthenticationPolicyName = void 0; + exports2.basicAuthenticationPolicy = basicAuthenticationPolicy; + var bytesEncoding_js_1 = require_bytesEncoding(); + var checkInsecureConnection_js_1 = require_checkInsecureConnection(); + exports2.basicAuthenticationPolicyName = "bearerAuthenticationPolicy"; + function basicAuthenticationPolicy(options) { + return { + name: exports2.basicAuthenticationPolicyName, + async sendRequest(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "basic"); + if (!scheme) { + return next(request); + } + const { username, password } = options.credential; + const headerValue = (0, bytesEncoding_js_1.uint8ArrayToString)((0, bytesEncoding_js_1.stringToUint8Array)(`${username}:${password}`, "utf-8"), "base64"); + request.headers.set("Authorization", `Basic ${headerValue}`); + return next(request); + } + }; + } + __name(basicAuthenticationPolicy, "basicAuthenticationPolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/bearerAuthenticationPolicy.js +var require_bearerAuthenticationPolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/bearerAuthenticationPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.bearerAuthenticationPolicyName = void 0; + exports2.bearerAuthenticationPolicy = bearerAuthenticationPolicy; + var checkInsecureConnection_js_1 = require_checkInsecureConnection(); + exports2.bearerAuthenticationPolicyName = "bearerAuthenticationPolicy"; + function bearerAuthenticationPolicy(options) { + return { + name: exports2.bearerAuthenticationPolicyName, + async sendRequest(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "bearer"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getBearerToken({ + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); + } + }; + } + __name(bearerAuthenticationPolicy, "bearerAuthenticationPolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/oauth2AuthenticationPolicy.js +var require_oauth2AuthenticationPolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/auth/oauth2AuthenticationPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.oauth2AuthenticationPolicyName = void 0; + exports2.oauth2AuthenticationPolicy = oauth2AuthenticationPolicy; + var checkInsecureConnection_js_1 = require_checkInsecureConnection(); + exports2.oauth2AuthenticationPolicyName = "oauth2AuthenticationPolicy"; + function oauth2AuthenticationPolicy(options) { + return { + name: exports2.oauth2AuthenticationPolicyName, + async sendRequest(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "oauth2"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getOAuth2Token(scheme.flows, { + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); + } + }; + } + __name(oauth2AuthenticationPolicy, "oauth2AuthenticationPolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/clientHelpers.js +var require_clientHelpers = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/clientHelpers.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createDefaultPipeline = createDefaultPipeline; + exports2.getCachedDefaultHttpsClient = getCachedDefaultHttpsClient; + var defaultHttpClient_js_1 = require_defaultHttpClient(); + var createPipelineFromOptions_js_1 = require_createPipelineFromOptions(); + var apiVersionPolicy_js_1 = require_apiVersionPolicy(); + var credentials_js_1 = require_credentials(); + var apiKeyAuthenticationPolicy_js_1 = require_apiKeyAuthenticationPolicy(); + var basicAuthenticationPolicy_js_1 = require_basicAuthenticationPolicy(); + var bearerAuthenticationPolicy_js_1 = require_bearerAuthenticationPolicy(); + var oauth2AuthenticationPolicy_js_1 = require_oauth2AuthenticationPolicy(); + var cachedHttpClient; + function createDefaultPipeline(options = {}) { + const pipeline = (0, createPipelineFromOptions_js_1.createPipelineFromOptions)(options); + pipeline.addPolicy((0, apiVersionPolicy_js_1.apiVersionPolicy)(options)); + const { credential, authSchemes, allowInsecureConnection } = options; + if (credential) { + if ((0, credentials_js_1.isApiKeyCredential)(credential)) { + pipeline.addPolicy((0, apiKeyAuthenticationPolicy_js_1.apiKeyAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBasicCredential)(credential)) { + pipeline.addPolicy((0, basicAuthenticationPolicy_js_1.basicAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBearerTokenCredential)(credential)) { + pipeline.addPolicy((0, bearerAuthenticationPolicy_js_1.bearerAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isOAuth2TokenCredential)(credential)) { + pipeline.addPolicy((0, oauth2AuthenticationPolicy_js_1.oauth2AuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } + } + return pipeline; + } + __name(createDefaultPipeline, "createDefaultPipeline"); + function getCachedDefaultHttpsClient() { + if (!cachedHttpClient) { + cachedHttpClient = (0, defaultHttpClient_js_1.createDefaultHttpClient)(); + } + return cachedHttpClient; + } + __name(getCachedDefaultHttpsClient, "getCachedDefaultHttpsClient"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/multipart.js +var require_multipart2 = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/multipart.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.buildBodyPart = buildBodyPart; + exports2.buildMultipartBody = buildMultipartBody; + var restError_js_1 = require_restError(); + var httpHeaders_js_1 = require_httpHeaders(); + var bytesEncoding_js_1 = require_bytesEncoding(); + var typeGuards_js_1 = require_typeGuards(); + function getHeaderValue(descriptor, headerName) { + if (descriptor.headers) { + const actualHeaderName = Object.keys(descriptor.headers).find((x) => x.toLowerCase() === headerName.toLowerCase()); + if (actualHeaderName) { + return descriptor.headers[actualHeaderName]; + } + } + return void 0; + } + __name(getHeaderValue, "getHeaderValue"); + function getPartContentType(descriptor) { + const contentTypeHeader = getHeaderValue(descriptor, "content-type"); + if (contentTypeHeader) { + return contentTypeHeader; + } + if (descriptor.contentType === null) { + return void 0; + } + if (descriptor.contentType) { + return descriptor.contentType; + } + const { body } = descriptor; + if (body === null || body === void 0) { + return void 0; + } + if (typeof body === "string" || typeof body === "number" || typeof body === "boolean") { + return "text/plain; charset=UTF-8"; + } + if (body instanceof Blob) { + return body.type || "application/octet-stream"; + } + if ((0, typeGuards_js_1.isBinaryBody)(body)) { + return "application/octet-stream"; + } + return "application/json"; + } + __name(getPartContentType, "getPartContentType"); + function escapeDispositionField(value) { + return JSON.stringify(value); + } + __name(escapeDispositionField, "escapeDispositionField"); + function getContentDisposition(descriptor) { + const contentDispositionHeader = getHeaderValue(descriptor, "content-disposition"); + if (contentDispositionHeader) { + return contentDispositionHeader; + } + if (descriptor.dispositionType === void 0 && descriptor.name === void 0 && descriptor.filename === void 0) { + return void 0; + } + const dispositionType = descriptor.dispositionType ?? "form-data"; + let disposition = dispositionType; + if (descriptor.name) { + disposition += `; name=${escapeDispositionField(descriptor.name)}`; + } + let filename = void 0; + if (descriptor.filename) { + filename = descriptor.filename; + } else if (typeof File !== "undefined" && descriptor.body instanceof File) { + const filenameFromFile = descriptor.body.name; + if (filenameFromFile !== "") { + filename = filenameFromFile; + } + } + if (filename) { + disposition += `; filename=${escapeDispositionField(filename)}`; + } + return disposition; + } + __name(getContentDisposition, "getContentDisposition"); + function normalizeBody(body, contentType) { + if (body === void 0) { + return new Uint8Array([]); + } + if ((0, typeGuards_js_1.isBinaryBody)(body)) { + return body; + } + if (typeof body === "string" || typeof body === "number" || typeof body === "boolean") { + return (0, bytesEncoding_js_1.stringToUint8Array)(String(body), "utf-8"); + } + if (contentType && /application\/(.+\+)?json(;.+)?/i.test(String(contentType))) { + return (0, bytesEncoding_js_1.stringToUint8Array)(JSON.stringify(body), "utf-8"); + } + throw new restError_js_1.RestError(`Unsupported body/content-type combination: ${body}, ${contentType}`); + } + __name(normalizeBody, "normalizeBody"); + function buildBodyPart(descriptor) { + const contentType = getPartContentType(descriptor); + const contentDisposition = getContentDisposition(descriptor); + const headers = (0, httpHeaders_js_1.createHttpHeaders)(descriptor.headers ?? {}); + if (contentType) { + headers.set("content-type", contentType); + } + if (contentDisposition) { + headers.set("content-disposition", contentDisposition); + } + const body = normalizeBody(descriptor.body, contentType); + return { + headers, + body + }; + } + __name(buildBodyPart, "buildBodyPart"); + function buildMultipartBody(parts) { + return { parts: parts.map(buildBodyPart) }; + } + __name(buildMultipartBody, "buildMultipartBody"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/sendRequest.js +var require_sendRequest = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/sendRequest.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.sendRequest = sendRequest; + var restError_js_1 = require_restError(); + var httpHeaders_js_1 = require_httpHeaders(); + var pipelineRequest_js_1 = require_pipelineRequest(); + var clientHelpers_js_1 = require_clientHelpers(); + var typeGuards_js_1 = require_typeGuards(); + var multipart_js_1 = require_multipart2(); + async function sendRequest(method, url, pipeline, options = {}, customHttpClient) { + const httpClient = customHttpClient ?? (0, clientHelpers_js_1.getCachedDefaultHttpsClient)(); + const request = buildPipelineRequest(method, url, options); + try { + const response = await pipeline.sendRequest(httpClient, request); + const headers = response.headers.toJSON(); + const stream = response.readableStreamBody ?? response.browserStreamBody; + const parsedBody = options.responseAsStream || stream !== void 0 ? void 0 : getResponseBody(response); + const body = stream ?? parsedBody; + if (options?.onResponse) { + options.onResponse({ ...response, request, rawHeaders: headers, parsedBody }); + } + return { + request, + headers, + status: `${response.status}`, + body + }; + } catch (e) { + if ((0, restError_js_1.isRestError)(e) && e.response && options.onResponse) { + const { response } = e; + const rawHeaders = response.headers.toJSON(); + options?.onResponse({ ...response, request, rawHeaders }, e); + } + throw e; + } + } + __name(sendRequest, "sendRequest"); + function getRequestContentType(options = {}) { + return options.contentType ?? options.headers?.["content-type"] ?? getContentType(options.body); + } + __name(getRequestContentType, "getRequestContentType"); + function getContentType(body) { + if (ArrayBuffer.isView(body)) { + return "application/octet-stream"; + } + if (typeof body === "string") { + try { + JSON.parse(body); + return "application/json"; + } catch (error) { + return void 0; + } + } + return "application/json"; + } + __name(getContentType, "getContentType"); + function buildPipelineRequest(method, url, options = {}) { + const requestContentType = getRequestContentType(options); + const { body, multipartBody } = getRequestBody(options.body, requestContentType); + const hasContent = body !== void 0 || multipartBody !== void 0; + const headers = (0, httpHeaders_js_1.createHttpHeaders)({ + ...options.headers ? options.headers : {}, + accept: options.accept ?? options.headers?.accept ?? "application/json", + ...hasContent && requestContentType && { + "content-type": requestContentType + } + }); + return (0, pipelineRequest_js_1.createPipelineRequest)({ + url, + method, + body, + multipartBody, + headers, + allowInsecureConnection: options.allowInsecureConnection, + abortSignal: options.abortSignal, + onUploadProgress: options.onUploadProgress, + onDownloadProgress: options.onDownloadProgress, + timeout: options.timeout, + enableBrowserStreams: true, + streamResponseStatusCodes: options.responseAsStream ? /* @__PURE__ */ new Set([Number.POSITIVE_INFINITY]) : void 0 + }); + } + __name(buildPipelineRequest, "buildPipelineRequest"); + function getRequestBody(body, contentType = "") { + if (body === void 0) { + return { body: void 0 }; + } + if (typeof FormData !== "undefined" && body instanceof FormData) { + return { body }; + } + if ((0, typeGuards_js_1.isReadableStream)(body)) { + return { body }; + } + if (ArrayBuffer.isView(body)) { + return { body: body instanceof Uint8Array ? body : JSON.stringify(body) }; + } + const firstType = contentType.split(";")[0]; + switch (firstType) { + case "application/json": + return { body: JSON.stringify(body) }; + case "multipart/form-data": + if (Array.isArray(body)) { + return { multipartBody: (0, multipart_js_1.buildMultipartBody)(body) }; + } + return { body: JSON.stringify(body) }; + case "text/plain": + return { body: String(body) }; + default: + if (typeof body === "string") { + return { body }; + } + return { body: JSON.stringify(body) }; + } + } + __name(getRequestBody, "getRequestBody"); + function getResponseBody(response) { + const contentType = response.headers.get("content-type") ?? ""; + const firstType = contentType.split(";")[0]; + const bodyToParse = response.bodyAsText ?? ""; + if (firstType === "text/plain") { + return String(bodyToParse); + } + try { + return bodyToParse ? JSON.parse(bodyToParse) : void 0; + } catch (error) { + if (firstType === "application/json") { + throw createParseError(response, error); + } + return String(bodyToParse); + } + } + __name(getResponseBody, "getResponseBody"); + function createParseError(response, err) { + const msg = `Error "${err}" occurred while parsing the response body - ${response.bodyAsText}.`; + const errCode = err.code ?? restError_js_1.RestError.PARSE_ERROR; + return new restError_js_1.RestError(msg, { + code: errCode, + statusCode: response.status, + request: response.request, + response + }); + } + __name(createParseError, "createParseError"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js +var require_urlHelpers = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.buildRequestUrl = buildRequestUrl; + exports2.buildBaseUrl = buildBaseUrl; + exports2.replaceAll = replaceAll; + function isQueryParameterWithOptions(x) { + const value = x.value; + return value !== void 0 && value.toString !== void 0 && typeof value.toString === "function"; + } + __name(isQueryParameterWithOptions, "isQueryParameterWithOptions"); + function buildRequestUrl(endpoint, routePath, pathParameters, options = {}) { + if (routePath.startsWith("https://") || routePath.startsWith("http://")) { + return routePath; + } + endpoint = buildBaseUrl(endpoint, options); + routePath = buildRoutePath(routePath, pathParameters, options); + const requestUrl = appendQueryParams(`${endpoint}/${routePath}`, options); + const url = new URL(requestUrl); + return url.toString().replace(/([^:]\/)\/+/g, "$1"); + } + __name(buildRequestUrl, "buildRequestUrl"); + function getQueryParamValue(key, allowReserved, style, param) { + let separator; + if (style === "pipeDelimited") { + separator = "|"; + } else if (style === "spaceDelimited") { + separator = "%20"; + } else { + separator = ","; + } + let paramValues; + if (Array.isArray(param)) { + paramValues = param; + } else if (typeof param === "object" && param.toString === Object.prototype.toString) { + paramValues = Object.entries(param).flat(); + } else { + paramValues = [param]; + } + const value = paramValues.map((p) => { + if (p === null || p === void 0) { + return ""; + } + if (!p.toString || typeof p.toString !== "function") { + throw new Error(`Query parameters must be able to be represented as string, ${key} can't`); + } + const rawValue = p.toISOString !== void 0 ? p.toISOString() : p.toString(); + return allowReserved ? rawValue : encodeURIComponent(rawValue); + }).join(separator); + return `${allowReserved ? key : encodeURIComponent(key)}=${value}`; + } + __name(getQueryParamValue, "getQueryParamValue"); + function appendQueryParams(url, options = {}) { + if (!options.queryParameters) { + return url; + } + const parsedUrl = new URL(url); + const queryParams = options.queryParameters; + const paramStrings = []; + for (const key of Object.keys(queryParams)) { + const param = queryParams[key]; + if (param === void 0 || param === null) { + continue; + } + const hasMetadata = isQueryParameterWithOptions(param); + const rawValue = hasMetadata ? param.value : param; + const explode = hasMetadata ? param.explode ?? false : false; + const style = hasMetadata && param.style ? param.style : "form"; + if (explode) { + if (Array.isArray(rawValue)) { + for (const item of rawValue) { + paramStrings.push(getQueryParamValue(key, options.skipUrlEncoding ?? false, style, item)); + } + } else if (typeof rawValue === "object") { + for (const [actualKey, value] of Object.entries(rawValue)) { + paramStrings.push(getQueryParamValue(actualKey, options.skipUrlEncoding ?? false, style, value)); + } + } else { + throw new Error("explode can only be set to true for objects and arrays"); + } + } else { + paramStrings.push(getQueryParamValue(key, options.skipUrlEncoding ?? false, style, rawValue)); + } + } + if (parsedUrl.search !== "") { + parsedUrl.search += "&"; + } + parsedUrl.search += paramStrings.join("&"); + return parsedUrl.toString(); + } + __name(appendQueryParams, "appendQueryParams"); + function buildBaseUrl(endpoint, options) { + if (!options.pathParameters) { + return endpoint; + } + const pathParams = options.pathParameters; + for (const [key, param] of Object.entries(pathParams)) { + if (param === void 0 || param === null) { + throw new Error(`Path parameters ${key} must not be undefined or null`); + } + if (!param.toString || typeof param.toString !== "function") { + throw new Error(`Path parameters must be able to be represented as string, ${key} can't`); + } + let value = param.toISOString !== void 0 ? param.toISOString() : String(param); + if (!options.skipUrlEncoding) { + value = encodeURIComponent(param); + } + endpoint = replaceAll(endpoint, `{${key}}`, value) ?? ""; + } + return endpoint; + } + __name(buildBaseUrl, "buildBaseUrl"); + function buildRoutePath(routePath, pathParameters, options = {}) { + for (const pathParam of pathParameters) { + const allowReserved = typeof pathParam === "object" && (pathParam.allowReserved ?? false); + let value = typeof pathParam === "object" ? pathParam.value : pathParam; + if (!options.skipUrlEncoding && !allowReserved) { + value = encodeURIComponent(value); + } + routePath = routePath.replace(/\{[\w-]+\}/, String(value)); + } + return routePath; + } + __name(buildRoutePath, "buildRoutePath"); + function replaceAll(value, searchValue, replaceValue) { + return !value || !searchValue ? value : value.split(searchValue).join(replaceValue || ""); + } + __name(replaceAll, "replaceAll"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/getClient.js +var require_getClient = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/getClient.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getClient = getClient; + var clientHelpers_js_1 = require_clientHelpers(); + var sendRequest_js_1 = require_sendRequest(); + var urlHelpers_js_1 = require_urlHelpers(); + var checkEnvironment_js_1 = require_checkEnvironment(); + function getClient(endpoint, clientOptions = {}) { + const pipeline = clientOptions.pipeline ?? (0, clientHelpers_js_1.createDefaultPipeline)(clientOptions); + if (clientOptions.additionalPolicies?.length) { + for (const { policy, position } of clientOptions.additionalPolicies) { + const afterPhase = position === "perRetry" ? "Sign" : void 0; + pipeline.addPolicy(policy, { + afterPhase + }); + } + } + const { allowInsecureConnection, httpClient } = clientOptions; + const endpointUrl = clientOptions.endpoint ?? endpoint; + const client = /* @__PURE__ */ __name((path2, ...args) => { + const getUrl = /* @__PURE__ */ __name((requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path2, args, { allowInsecureConnection, ...requestOptions }), "getUrl"); + return { + get: (requestOptions = {}) => { + return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + post: (requestOptions = {}) => { + return buildOperation("POST", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + put: (requestOptions = {}) => { + return buildOperation("PUT", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + patch: (requestOptions = {}) => { + return buildOperation("PATCH", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + delete: (requestOptions = {}) => { + return buildOperation("DELETE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + head: (requestOptions = {}) => { + return buildOperation("HEAD", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + options: (requestOptions = {}) => { + return buildOperation("OPTIONS", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + trace: (requestOptions = {}) => { + return buildOperation("TRACE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + } + }; + }, "client"); + return { + path: client, + pathUnchecked: client, + pipeline + }; + } + __name(getClient, "getClient"); + function buildOperation(method, url, pipeline, options, allowInsecureConnection, httpClient) { + allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection; + return { + then: function(onFulfilled, onrejected) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...options, allowInsecureConnection }, httpClient).then(onFulfilled, onrejected); + }, + async asBrowserStream() { + if (checkEnvironment_js_1.isNodeLike) { + throw new Error("`asBrowserStream` is supported only in the browser environment. Use `asNodeStream` instead to obtain the response body stream. If you require a Web stream of the response in Node, consider using `Readable.toWeb` on the result of `asNodeStream`."); + } else { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...options, allowInsecureConnection, responseAsStream: true }, httpClient); + } + }, + async asNodeStream() { + if (checkEnvironment_js_1.isNodeLike) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...options, allowInsecureConnection, responseAsStream: true }, httpClient); + } else { + throw new Error("`isNodeStream` is not supported in the browser environment. Use `asBrowserStream` to obtain the response body stream."); + } + } + }; + } + __name(buildOperation, "buildOperation"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/operationOptionHelpers.js +var require_operationOptionHelpers = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/operationOptionHelpers.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.operationOptionsToRequestParameters = operationOptionsToRequestParameters; + function operationOptionsToRequestParameters(options) { + return { + allowInsecureConnection: options.requestOptions?.allowInsecureConnection, + timeout: options.requestOptions?.timeout, + skipUrlEncoding: options.requestOptions?.skipUrlEncoding, + abortSignal: options.abortSignal, + onUploadProgress: options.requestOptions?.onUploadProgress, + onDownloadProgress: options.requestOptions?.onDownloadProgress, + headers: { ...options.requestOptions?.headers }, + onResponse: options.onResponse + }; + } + __name(operationOptionsToRequestParameters, "operationOptionsToRequestParameters"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/restError.js +var require_restError2 = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/restError.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createRestError = createRestError; + var restError_js_1 = require_restError(); + var httpHeaders_js_1 = require_httpHeaders(); + function createRestError(messageOrResponse, response) { + const resp = typeof messageOrResponse === "string" ? response : messageOrResponse; + const internalError = resp.body?.error ?? resp.body; + const message = typeof messageOrResponse === "string" ? messageOrResponse : internalError?.message ?? `Unexpected status code: ${resp.status}`; + return new restError_js_1.RestError(message, { + statusCode: statusCodeToNumber(resp.status), + code: internalError?.code, + request: resp.request, + response: toPipelineResponse(resp) + }); + } + __name(createRestError, "createRestError"); + function toPipelineResponse(response) { + return { + headers: (0, httpHeaders_js_1.createHttpHeaders)(response.headers), + request: response.request, + status: statusCodeToNumber(response.status) ?? -1 + }; + } + __name(toPipelineResponse, "toPipelineResponse"); + function statusCodeToNumber(statusCode) { + const status = Number.parseInt(statusCode); + return Number.isNaN(status) ? void 0 : status; + } + __name(statusCodeToNumber, "statusCodeToNumber"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/index.js +var require_commonjs = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createRestError = exports2.operationOptionsToRequestParameters = exports2.getClient = exports2.createDefaultHttpClient = exports2.uint8ArrayToString = exports2.stringToUint8Array = exports2.isRestError = exports2.RestError = exports2.createEmptyPipeline = exports2.createPipelineRequest = exports2.createHttpHeaders = exports2.TypeSpecRuntimeLogger = exports2.setLogLevel = exports2.getLogLevel = exports2.createClientLogger = exports2.AbortError = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var AbortError_js_1 = require_AbortError(); + Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { + return AbortError_js_1.AbortError; + } }); + var logger_js_1 = require_logger(); + Object.defineProperty(exports2, "createClientLogger", { enumerable: true, get: function() { + return logger_js_1.createClientLogger; + } }); + Object.defineProperty(exports2, "getLogLevel", { enumerable: true, get: function() { + return logger_js_1.getLogLevel; + } }); + Object.defineProperty(exports2, "setLogLevel", { enumerable: true, get: function() { + return logger_js_1.setLogLevel; + } }); + Object.defineProperty(exports2, "TypeSpecRuntimeLogger", { enumerable: true, get: function() { + return logger_js_1.TypeSpecRuntimeLogger; + } }); + var httpHeaders_js_1 = require_httpHeaders(); + Object.defineProperty(exports2, "createHttpHeaders", { enumerable: true, get: function() { + return httpHeaders_js_1.createHttpHeaders; + } }); + tslib_1.__exportStar(require_schemes(), exports2); + tslib_1.__exportStar(require_oauth2Flows(), exports2); + var pipelineRequest_js_1 = require_pipelineRequest(); + Object.defineProperty(exports2, "createPipelineRequest", { enumerable: true, get: function() { + return pipelineRequest_js_1.createPipelineRequest; + } }); + var pipeline_js_1 = require_pipeline(); + Object.defineProperty(exports2, "createEmptyPipeline", { enumerable: true, get: function() { + return pipeline_js_1.createEmptyPipeline; + } }); + var restError_js_1 = require_restError(); + Object.defineProperty(exports2, "RestError", { enumerable: true, get: function() { + return restError_js_1.RestError; + } }); + Object.defineProperty(exports2, "isRestError", { enumerable: true, get: function() { + return restError_js_1.isRestError; + } }); + var bytesEncoding_js_1 = require_bytesEncoding(); + Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { + return bytesEncoding_js_1.stringToUint8Array; + } }); + Object.defineProperty(exports2, "uint8ArrayToString", { enumerable: true, get: function() { + return bytesEncoding_js_1.uint8ArrayToString; + } }); + var defaultHttpClient_js_1 = require_defaultHttpClient(); + Object.defineProperty(exports2, "createDefaultHttpClient", { enumerable: true, get: function() { + return defaultHttpClient_js_1.createDefaultHttpClient; + } }); + var getClient_js_1 = require_getClient(); + Object.defineProperty(exports2, "getClient", { enumerable: true, get: function() { + return getClient_js_1.getClient; + } }); + var operationOptionHelpers_js_1 = require_operationOptionHelpers(); + Object.defineProperty(exports2, "operationOptionsToRequestParameters", { enumerable: true, get: function() { + return operationOptionHelpers_js_1.operationOptionsToRequestParameters; + } }); + var restError_js_2 = require_restError2(); + Object.defineProperty(exports2, "createRestError", { enumerable: true, get: function() { + return restError_js_2.createRestError; + } }); + } +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js +var require_pipeline2 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createEmptyPipeline = createEmptyPipeline; + var ts_http_runtime_1 = require_commonjs(); + function createEmptyPipeline() { + return (0, ts_http_runtime_1.createEmptyPipeline)(); + } + __name(createEmptyPipeline, "createEmptyPipeline"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/internal.js +var require_internal = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/internal.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createLoggerContext = void 0; + var logger_js_1 = require_logger(); + Object.defineProperty(exports2, "createLoggerContext", { enumerable: true, get: function() { + return logger_js_1.createLoggerContext; + } }); + } +}); + +// node_modules/@azure/logger/dist/commonjs/index.js +var require_commonjs2 = __commonJS({ + "node_modules/@azure/logger/dist/commonjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AzureLogger = void 0; + exports2.setLogLevel = setLogLevel; + exports2.getLogLevel = getLogLevel; + exports2.createClientLogger = createClientLogger; + var logger_1 = require_internal(); + var context = (0, logger_1.createLoggerContext)({ + logLevelEnvVarName: "AZURE_LOG_LEVEL", + namespace: "azure" + }); + exports2.AzureLogger = context.logger; + function setLogLevel(level) { + context.setLogLevel(level); + } + __name(setLogLevel, "setLogLevel"); + function getLogLevel() { + return context.getLogLevel(); + } + __name(getLogLevel, "getLogLevel"); + function createClientLogger(namespace) { + return context.createClientLogger(namespace); + } + __name(createClientLogger, "createClientLogger"); + } +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js +var require_log3 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.logger = void 0; + var logger_1 = require_commonjs2(); + exports2.logger = (0, logger_1.createClientLogger)("core-rest-pipeline"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/exponentialRetryPolicy.js +var require_exponentialRetryPolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/exponentialRetryPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.exponentialRetryPolicyName = void 0; + exports2.exponentialRetryPolicy = exponentialRetryPolicy; + var exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); + var retryPolicy_js_1 = require_retryPolicy(); + var constants_js_1 = require_constants8(); + exports2.exponentialRetryPolicyName = "exponentialRetryPolicy"; + function exponentialRetryPolicy(options = {}) { + return (0, retryPolicy_js_1.retryPolicy)([ + (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)({ + ...options, + ignoreSystemErrors: true + }) + ], { + maxRetries: options.maxRetries ?? constants_js_1.DEFAULT_RETRY_POLICY_COUNT + }); + } + __name(exponentialRetryPolicy, "exponentialRetryPolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/systemErrorRetryPolicy.js +var require_systemErrorRetryPolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/systemErrorRetryPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.systemErrorRetryPolicyName = void 0; + exports2.systemErrorRetryPolicy = systemErrorRetryPolicy; + var exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); + var retryPolicy_js_1 = require_retryPolicy(); + var constants_js_1 = require_constants8(); + exports2.systemErrorRetryPolicyName = "systemErrorRetryPolicy"; + function systemErrorRetryPolicy(options = {}) { + return { + name: exports2.systemErrorRetryPolicyName, + sendRequest: (0, retryPolicy_js_1.retryPolicy)([ + (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)({ + ...options, + ignoreHttpStatusCodes: true + }) + ], { + maxRetries: options.maxRetries ?? constants_js_1.DEFAULT_RETRY_POLICY_COUNT + }).sendRequest + }; + } + __name(systemErrorRetryPolicy, "systemErrorRetryPolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/throttlingRetryPolicy.js +var require_throttlingRetryPolicy = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/throttlingRetryPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.throttlingRetryPolicyName = void 0; + exports2.throttlingRetryPolicy = throttlingRetryPolicy; + var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); + var retryPolicy_js_1 = require_retryPolicy(); + var constants_js_1 = require_constants8(); + exports2.throttlingRetryPolicyName = "throttlingRetryPolicy"; + function throttlingRetryPolicy(options = {}) { + return { + name: exports2.throttlingRetryPolicyName, + sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)()], { + maxRetries: options.maxRetries ?? constants_js_1.DEFAULT_RETRY_POLICY_COUNT + }).sendRequest + }; + } + __name(throttlingRetryPolicy, "throttlingRetryPolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/internal.js +var require_internal2 = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/internal.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.userAgentPolicyName = exports2.userAgentPolicy = exports2.tlsPolicyName = exports2.tlsPolicy = exports2.redirectPolicyName = exports2.redirectPolicy = exports2.getDefaultProxySettings = exports2.proxyPolicyName = exports2.proxyPolicy = exports2.multipartPolicyName = exports2.multipartPolicy = exports2.logPolicyName = exports2.logPolicy = exports2.formDataPolicyName = exports2.formDataPolicy = exports2.throttlingRetryPolicyName = exports2.throttlingRetryPolicy = exports2.systemErrorRetryPolicyName = exports2.systemErrorRetryPolicy = exports2.retryPolicy = exports2.exponentialRetryPolicyName = exports2.exponentialRetryPolicy = exports2.defaultRetryPolicyName = exports2.defaultRetryPolicy = exports2.decompressResponsePolicyName = exports2.decompressResponsePolicy = exports2.agentPolicyName = exports2.agentPolicy = void 0; + var agentPolicy_js_1 = require_agentPolicy(); + Object.defineProperty(exports2, "agentPolicy", { enumerable: true, get: function() { + return agentPolicy_js_1.agentPolicy; + } }); + Object.defineProperty(exports2, "agentPolicyName", { enumerable: true, get: function() { + return agentPolicy_js_1.agentPolicyName; + } }); + var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); + Object.defineProperty(exports2, "decompressResponsePolicy", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicy; + } }); + Object.defineProperty(exports2, "decompressResponsePolicyName", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicyName; + } }); + var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); + Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicy; + } }); + Object.defineProperty(exports2, "defaultRetryPolicyName", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicyName; + } }); + var exponentialRetryPolicy_js_1 = require_exponentialRetryPolicy(); + Object.defineProperty(exports2, "exponentialRetryPolicy", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicy; + } }); + Object.defineProperty(exports2, "exponentialRetryPolicyName", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicyName; + } }); + var retryPolicy_js_1 = require_retryPolicy(); + Object.defineProperty(exports2, "retryPolicy", { enumerable: true, get: function() { + return retryPolicy_js_1.retryPolicy; + } }); + var systemErrorRetryPolicy_js_1 = require_systemErrorRetryPolicy(); + Object.defineProperty(exports2, "systemErrorRetryPolicy", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicy; + } }); + Object.defineProperty(exports2, "systemErrorRetryPolicyName", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicyName; + } }); + var throttlingRetryPolicy_js_1 = require_throttlingRetryPolicy(); + Object.defineProperty(exports2, "throttlingRetryPolicy", { enumerable: true, get: function() { + return throttlingRetryPolicy_js_1.throttlingRetryPolicy; + } }); + Object.defineProperty(exports2, "throttlingRetryPolicyName", { enumerable: true, get: function() { + return throttlingRetryPolicy_js_1.throttlingRetryPolicyName; + } }); + var formDataPolicy_js_1 = require_formDataPolicy(); + Object.defineProperty(exports2, "formDataPolicy", { enumerable: true, get: function() { + return formDataPolicy_js_1.formDataPolicy; + } }); + Object.defineProperty(exports2, "formDataPolicyName", { enumerable: true, get: function() { + return formDataPolicy_js_1.formDataPolicyName; + } }); + var logPolicy_js_1 = require_logPolicy(); + Object.defineProperty(exports2, "logPolicy", { enumerable: true, get: function() { + return logPolicy_js_1.logPolicy; + } }); + Object.defineProperty(exports2, "logPolicyName", { enumerable: true, get: function() { + return logPolicy_js_1.logPolicyName; + } }); + var multipartPolicy_js_1 = require_multipartPolicy(); + Object.defineProperty(exports2, "multipartPolicy", { enumerable: true, get: function() { + return multipartPolicy_js_1.multipartPolicy; + } }); + Object.defineProperty(exports2, "multipartPolicyName", { enumerable: true, get: function() { + return multipartPolicy_js_1.multipartPolicyName; + } }); + var proxyPolicy_js_1 = require_proxyPolicy(); + Object.defineProperty(exports2, "proxyPolicy", { enumerable: true, get: function() { + return proxyPolicy_js_1.proxyPolicy; + } }); + Object.defineProperty(exports2, "proxyPolicyName", { enumerable: true, get: function() { + return proxyPolicy_js_1.proxyPolicyName; + } }); + Object.defineProperty(exports2, "getDefaultProxySettings", { enumerable: true, get: function() { + return proxyPolicy_js_1.getDefaultProxySettings; + } }); + var redirectPolicy_js_1 = require_redirectPolicy(); + Object.defineProperty(exports2, "redirectPolicy", { enumerable: true, get: function() { + return redirectPolicy_js_1.redirectPolicy; + } }); + Object.defineProperty(exports2, "redirectPolicyName", { enumerable: true, get: function() { + return redirectPolicy_js_1.redirectPolicyName; + } }); + var tlsPolicy_js_1 = require_tlsPolicy(); + Object.defineProperty(exports2, "tlsPolicy", { enumerable: true, get: function() { + return tlsPolicy_js_1.tlsPolicy; + } }); + Object.defineProperty(exports2, "tlsPolicyName", { enumerable: true, get: function() { + return tlsPolicy_js_1.tlsPolicyName; + } }); + var userAgentPolicy_js_1 = require_userAgentPolicy(); + Object.defineProperty(exports2, "userAgentPolicy", { enumerable: true, get: function() { + return userAgentPolicy_js_1.userAgentPolicy; + } }); + Object.defineProperty(exports2, "userAgentPolicyName", { enumerable: true, get: function() { + return userAgentPolicy_js_1.userAgentPolicyName; + } }); + } +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js +var require_logPolicy2 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.logPolicyName = void 0; + exports2.logPolicy = logPolicy; + var log_js_1 = require_log3(); + var policies_1 = require_internal2(); + exports2.logPolicyName = policies_1.logPolicyName; + function logPolicy(options = {}) { + return (0, policies_1.logPolicy)({ + logger: log_js_1.logger.info, + ...options + }); + } + __name(logPolicy, "logPolicy"); + } +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js +var require_redirectPolicy2 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.redirectPolicyName = void 0; + exports2.redirectPolicy = redirectPolicy; + var policies_1 = require_internal2(); + exports2.redirectPolicyName = policies_1.redirectPolicyName; + function redirectPolicy(options = {}) { + return (0, policies_1.redirectPolicy)(options); + } + __name(redirectPolicy, "redirectPolicy"); + } +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js +var require_userAgentPlatform2 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getHeaderName = getHeaderName; + exports2.setPlatformSpecificData = setPlatformSpecificData; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var node_os_1 = tslib_1.__importDefault(require("node:os")); + var node_process_1 = tslib_1.__importDefault(require("node:process")); + function getHeaderName() { + return "User-Agent"; + } + __name(getHeaderName, "getHeaderName"); + async function setPlatformSpecificData(map) { + if (node_process_1.default && node_process_1.default.versions) { + const osInfo = `${node_os_1.default.type()} ${node_os_1.default.release()}; ${node_os_1.default.arch()}`; + const versions = node_process_1.default.versions; + if (versions.bun) { + map.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map.set("Node", `${versions.node} (${osInfo})`); + } + } + } + __name(setPlatformSpecificData, "setPlatformSpecificData"); + } +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js +var require_constants9 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DEFAULT_RETRY_POLICY_COUNT = exports2.SDK_VERSION = void 0; + exports2.SDK_VERSION = "1.22.2"; + exports2.DEFAULT_RETRY_POLICY_COUNT = 3; + } +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js +var require_userAgent2 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getUserAgentHeaderName = getUserAgentHeaderName; + exports2.getUserAgentValue = getUserAgentValue; + var userAgentPlatform_js_1 = require_userAgentPlatform2(); + var constants_js_1 = require_constants9(); + function getUserAgentString(telemetryInfo) { + const parts = []; + for (const [key, value] of telemetryInfo) { + const token = value ? `${key}/${value}` : key; + parts.push(token); + } + return parts.join(" "); + } + __name(getUserAgentString, "getUserAgentString"); + function getUserAgentHeaderName() { + return (0, userAgentPlatform_js_1.getHeaderName)(); + } + __name(getUserAgentHeaderName, "getUserAgentHeaderName"); + async function getUserAgentValue(prefix) { + const runtimeInfo = /* @__PURE__ */ new Map(); + runtimeInfo.set("core-rest-pipeline", constants_js_1.SDK_VERSION); + await (0, userAgentPlatform_js_1.setPlatformSpecificData)(runtimeInfo); + const defaultAgent = getUserAgentString(runtimeInfo); + const userAgentValue = prefix ? `${prefix} ${defaultAgent}` : defaultAgent; + return userAgentValue; + } + __name(getUserAgentValue, "getUserAgentValue"); + } +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js +var require_userAgentPolicy2 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.userAgentPolicyName = void 0; + exports2.userAgentPolicy = userAgentPolicy; + var userAgent_js_1 = require_userAgent2(); + var UserAgentHeaderName = (0, userAgent_js_1.getUserAgentHeaderName)(); + exports2.userAgentPolicyName = "userAgentPolicy"; + function userAgentPolicy(options = {}) { + const userAgentValue = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); + return { + name: exports2.userAgentPolicyName, + async sendRequest(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); + } + return next(request); + } + }; + } + __name(userAgentPolicy, "userAgentPolicy"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/sha256.js +var require_sha256 = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/sha256.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.computeSha256Hmac = computeSha256Hmac; + exports2.computeSha256Hash = computeSha256Hash; + var node_crypto_1 = require("node:crypto"); + async function computeSha256Hmac(key, stringToSign, encoding) { + const decodedKey = Buffer.from(key, "base64"); + return (0, node_crypto_1.createHmac)("sha256", decodedKey).update(stringToSign).digest(encoding); + } + __name(computeSha256Hmac, "computeSha256Hmac"); + async function computeSha256Hash(content, encoding) { + return (0, node_crypto_1.createHash)("sha256").update(content).digest(encoding); + } + __name(computeSha256Hash, "computeSha256Hash"); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/internal.js +var require_internal3 = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/internal.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Sanitizer = exports2.uint8ArrayToString = exports2.stringToUint8Array = exports2.isWebWorker = exports2.isReactNative = exports2.isDeno = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isBun = exports2.isBrowser = exports2.randomUUID = exports2.computeSha256Hmac = exports2.computeSha256Hash = exports2.isError = exports2.isObject = exports2.getRandomIntegerInclusive = exports2.calculateRetryDelay = void 0; + var delay_js_1 = require_delay(); + Object.defineProperty(exports2, "calculateRetryDelay", { enumerable: true, get: function() { + return delay_js_1.calculateRetryDelay; + } }); + var random_js_1 = require_random(); + Object.defineProperty(exports2, "getRandomIntegerInclusive", { enumerable: true, get: function() { + return random_js_1.getRandomIntegerInclusive; + } }); + var object_js_1 = require_object(); + Object.defineProperty(exports2, "isObject", { enumerable: true, get: function() { + return object_js_1.isObject; + } }); + var error_js_1 = require_error(); + Object.defineProperty(exports2, "isError", { enumerable: true, get: function() { + return error_js_1.isError; + } }); + var sha256_js_1 = require_sha256(); + Object.defineProperty(exports2, "computeSha256Hash", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hash; + } }); + Object.defineProperty(exports2, "computeSha256Hmac", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hmac; + } }); + var uuidUtils_js_1 = require_uuidUtils(); + Object.defineProperty(exports2, "randomUUID", { enumerable: true, get: function() { + return uuidUtils_js_1.randomUUID; + } }); + var checkEnvironment_js_1 = require_checkEnvironment(); + Object.defineProperty(exports2, "isBrowser", { enumerable: true, get: function() { + return checkEnvironment_js_1.isBrowser; + } }); + Object.defineProperty(exports2, "isBun", { enumerable: true, get: function() { + return checkEnvironment_js_1.isBun; + } }); + Object.defineProperty(exports2, "isNodeLike", { enumerable: true, get: function() { + return checkEnvironment_js_1.isNodeLike; + } }); + Object.defineProperty(exports2, "isNodeRuntime", { enumerable: true, get: function() { + return checkEnvironment_js_1.isNodeRuntime; + } }); + Object.defineProperty(exports2, "isDeno", { enumerable: true, get: function() { + return checkEnvironment_js_1.isDeno; + } }); + Object.defineProperty(exports2, "isReactNative", { enumerable: true, get: function() { + return checkEnvironment_js_1.isReactNative; + } }); + Object.defineProperty(exports2, "isWebWorker", { enumerable: true, get: function() { + return checkEnvironment_js_1.isWebWorker; + } }); + var bytesEncoding_js_1 = require_bytesEncoding(); + Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { + return bytesEncoding_js_1.stringToUint8Array; + } }); + Object.defineProperty(exports2, "uint8ArrayToString", { enumerable: true, get: function() { + return bytesEncoding_js_1.uint8ArrayToString; + } }); + var sanitizer_js_1 = require_sanitizer(); + Object.defineProperty(exports2, "Sanitizer", { enumerable: true, get: function() { + return sanitizer_js_1.Sanitizer; + } }); + } +}); + +// node_modules/@azure/core-util/dist/commonjs/aborterUtils.js +var require_aborterUtils = __commonJS({ + "node_modules/@azure/core-util/dist/commonjs/aborterUtils.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.cancelablePromiseRace = cancelablePromiseRace; + async function cancelablePromiseRace(abortablePromiseBuilders, options) { + const aborter = new AbortController(); + function abortHandler() { + aborter.abort(); + } + __name(abortHandler, "abortHandler"); + options?.abortSignal?.addEventListener("abort", abortHandler); + try { + return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); + } finally { + aborter.abort(); + options?.abortSignal?.removeEventListener("abort", abortHandler); + } + } + __name(cancelablePromiseRace, "cancelablePromiseRace"); + } +}); + +// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js +var require_AbortError2 = __commonJS({ + "node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AbortError = void 0; + var AbortError = class extends Error { + static { + __name(this, "AbortError"); + } + constructor(message) { + super(message); + this.name = "AbortError"; + } + }; + exports2.AbortError = AbortError; + } +}); + +// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js +var require_commonjs3 = __commonJS({ + "node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AbortError = void 0; + var AbortError_js_1 = require_AbortError2(); + Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { + return AbortError_js_1.AbortError; + } }); + } +}); + +// node_modules/@azure/core-util/dist/commonjs/createAbortablePromise.js +var require_createAbortablePromise = __commonJS({ + "node_modules/@azure/core-util/dist/commonjs/createAbortablePromise.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createAbortablePromise = createAbortablePromise; + var abort_controller_1 = require_commonjs3(); + function createAbortablePromise(buildPromise, options) { + const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options ?? {}; + return new Promise((resolve, reject) => { + function rejectOnAbort() { + reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted.")); + } + __name(rejectOnAbort, "rejectOnAbort"); + function removeListeners() { + abortSignal?.removeEventListener("abort", onAbort); + } + __name(removeListeners, "removeListeners"); + function onAbort() { + cleanupBeforeAbort?.(); + removeListeners(); + rejectOnAbort(); + } + __name(onAbort, "onAbort"); + if (abortSignal?.aborted) { + return rejectOnAbort(); + } + try { + buildPromise((x) => { + removeListeners(); + resolve(x); + }, (x) => { + removeListeners(); + reject(x); + }); + } catch (err) { + reject(err); + } + abortSignal?.addEventListener("abort", onAbort); + }); + } + __name(createAbortablePromise, "createAbortablePromise"); + } +}); + +// node_modules/@azure/core-util/dist/commonjs/delay.js +var require_delay2 = __commonJS({ + "node_modules/@azure/core-util/dist/commonjs/delay.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.delay = delay; + exports2.calculateRetryDelay = calculateRetryDelay; + var createAbortablePromise_js_1 = require_createAbortablePromise(); + var util_1 = require_internal3(); + var StandardAbortMessage = "The delay was aborted."; + function delay(timeInMs, options) { + let token; + const { abortSignal, abortErrorMsg } = options ?? {}; + return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve) => { + token = setTimeout(resolve, timeInMs); + }, { + cleanupBeforeAbort: () => clearTimeout(token), + abortSignal, + abortErrorMsg: abortErrorMsg ?? StandardAbortMessage + }); + } + __name(delay, "delay"); + function calculateRetryDelay(retryAttempt, config) { + const exponentialDelay = config.retryDelayInMs * Math.pow(2, retryAttempt); + const clampedDelay = Math.min(config.maxRetryDelayInMs, exponentialDelay); + const retryAfterInMs = clampedDelay / 2 + (0, util_1.getRandomIntegerInclusive)(0, clampedDelay / 2); + return { retryAfterInMs }; + } + __name(calculateRetryDelay, "calculateRetryDelay"); + } +}); + +// node_modules/@azure/core-util/dist/commonjs/error.js +var require_error2 = __commonJS({ + "node_modules/@azure/core-util/dist/commonjs/error.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getErrorMessage = getErrorMessage; + var util_1 = require_internal3(); + function getErrorMessage(e) { + if ((0, util_1.isError)(e)) { + return e.message; + } else { + let stringified; + try { + if (typeof e === "object" && e) { + stringified = JSON.stringify(e); + } else { + stringified = String(e); + } + } catch (err) { + stringified = "[unable to stringify input]"; + } + return `Unknown error ${stringified}`; + } + } + __name(getErrorMessage, "getErrorMessage"); + } +}); + +// node_modules/@azure/core-util/dist/commonjs/typeGuards.js +var require_typeGuards2 = __commonJS({ + "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isDefined = isDefined; + exports2.isObjectWithProperties = isObjectWithProperties; + exports2.objectHasProperty = objectHasProperty; + function isDefined(thing) { + return typeof thing !== "undefined" && thing !== null; + } + __name(isDefined, "isDefined"); + function isObjectWithProperties(thing, properties) { + if (!isDefined(thing) || typeof thing !== "object") { + return false; + } + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; + } + } + return true; + } + __name(isObjectWithProperties, "isObjectWithProperties"); + function objectHasProperty(thing, property) { + return isDefined(thing) && typeof thing === "object" && property in thing; + } + __name(objectHasProperty, "objectHasProperty"); + } +}); + +// node_modules/@azure/core-util/dist/commonjs/index.js +var require_commonjs4 = __commonJS({ + "node_modules/@azure/core-util/dist/commonjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isWebWorker = exports2.isReactNative = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isNode = exports2.isDeno = exports2.isBun = exports2.isBrowser = exports2.objectHasProperty = exports2.isObjectWithProperties = exports2.isDefined = exports2.getErrorMessage = exports2.delay = exports2.createAbortablePromise = exports2.cancelablePromiseRace = void 0; + exports2.calculateRetryDelay = calculateRetryDelay; + exports2.computeSha256Hash = computeSha256Hash; + exports2.computeSha256Hmac = computeSha256Hmac; + exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; + exports2.isError = isError; + exports2.isObject = isObject; + exports2.randomUUID = randomUUID; + exports2.uint8ArrayToString = uint8ArrayToString; + exports2.stringToUint8Array = stringToUint8Array; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var tspRuntime = tslib_1.__importStar(require_internal3()); + var aborterUtils_js_1 = require_aborterUtils(); + Object.defineProperty(exports2, "cancelablePromiseRace", { enumerable: true, get: function() { + return aborterUtils_js_1.cancelablePromiseRace; + } }); + var createAbortablePromise_js_1 = require_createAbortablePromise(); + Object.defineProperty(exports2, "createAbortablePromise", { enumerable: true, get: function() { + return createAbortablePromise_js_1.createAbortablePromise; + } }); + var delay_js_1 = require_delay2(); + Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { + return delay_js_1.delay; + } }); + var error_js_1 = require_error2(); + Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { + return error_js_1.getErrorMessage; + } }); + var typeGuards_js_1 = require_typeGuards2(); + Object.defineProperty(exports2, "isDefined", { enumerable: true, get: function() { + return typeGuards_js_1.isDefined; + } }); + Object.defineProperty(exports2, "isObjectWithProperties", { enumerable: true, get: function() { + return typeGuards_js_1.isObjectWithProperties; + } }); + Object.defineProperty(exports2, "objectHasProperty", { enumerable: true, get: function() { + return typeGuards_js_1.objectHasProperty; + } }); + function calculateRetryDelay(retryAttempt, config) { + return tspRuntime.calculateRetryDelay(retryAttempt, config); + } + __name(calculateRetryDelay, "calculateRetryDelay"); + function computeSha256Hash(content, encoding) { + return tspRuntime.computeSha256Hash(content, encoding); + } + __name(computeSha256Hash, "computeSha256Hash"); + function computeSha256Hmac(key, stringToSign, encoding) { + return tspRuntime.computeSha256Hmac(key, stringToSign, encoding); + } + __name(computeSha256Hmac, "computeSha256Hmac"); + function getRandomIntegerInclusive(min, max) { + return tspRuntime.getRandomIntegerInclusive(min, max); + } + __name(getRandomIntegerInclusive, "getRandomIntegerInclusive"); + function isError(e) { + return tspRuntime.isError(e); + } + __name(isError, "isError"); + function isObject(input) { + return tspRuntime.isObject(input); + } + __name(isObject, "isObject"); + function randomUUID() { + return tspRuntime.randomUUID(); + } + __name(randomUUID, "randomUUID"); + exports2.isBrowser = tspRuntime.isBrowser; + exports2.isBun = tspRuntime.isBun; + exports2.isDeno = tspRuntime.isDeno; + exports2.isNode = tspRuntime.isNodeLike; + exports2.isNodeLike = tspRuntime.isNodeLike; + exports2.isNodeRuntime = tspRuntime.isNodeRuntime; + exports2.isReactNative = tspRuntime.isReactNative; + exports2.isWebWorker = tspRuntime.isWebWorker; + function uint8ArrayToString(bytes, format) { + return tspRuntime.uint8ArrayToString(bytes, format); + } + __name(uint8ArrayToString, "uint8ArrayToString"); + function stringToUint8Array(value, format) { + return tspRuntime.stringToUint8Array(value, format); + } + __name(stringToUint8Array, "stringToUint8Array"); + } +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/file.js +var require_file2 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/file.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hasRawContent = hasRawContent; + exports2.getRawContent = getRawContent; + exports2.createFileFromStream = createFileFromStream; + exports2.createFile = createFile; + var core_util_1 = require_commonjs4(); + function isNodeReadableStream(x) { + return Boolean(x && typeof x["pipe"] === "function"); + } + __name(isNodeReadableStream, "isNodeReadableStream"); + var unimplementedMethods = { + arrayBuffer: () => { + throw new Error("Not implemented"); + }, + bytes: () => { + throw new Error("Not implemented"); + }, + slice: () => { + throw new Error("Not implemented"); + }, + text: () => { + throw new Error("Not implemented"); + } + }; + var rawContent = Symbol("rawContent"); + function hasRawContent(x) { + return typeof x[rawContent] === "function"; + } + __name(hasRawContent, "hasRawContent"); + function getRawContent(blob) { + if (hasRawContent(blob)) { + return blob[rawContent](); + } else { + return blob; + } + } + __name(getRawContent, "getRawContent"); + function createFileFromStream(stream, name, options = {}) { + return { + ...unimplementedMethods, + type: options.type ?? "", + lastModified: options.lastModified ?? (/* @__PURE__ */ new Date()).getTime(), + webkitRelativePath: options.webkitRelativePath ?? "", + size: options.size ?? -1, + name, + stream: () => { + const s = stream(); + if (isNodeReadableStream(s)) { + throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); + } + return s; + }, + [rawContent]: stream + }; + } + __name(createFileFromStream, "createFileFromStream"); + function createFile(content, name, options = {}) { + if (core_util_1.isNodeLike) { + return { + ...unimplementedMethods, + type: options.type ?? "", + lastModified: options.lastModified ?? (/* @__PURE__ */ new Date()).getTime(), + webkitRelativePath: options.webkitRelativePath ?? "", + size: content.byteLength, + name, + arrayBuffer: async () => content.buffer, + stream: () => new Blob([toArrayBuffer(content)]).stream(), + [rawContent]: () => content + }; + } else { + return new File([toArrayBuffer(content)], name, options); + } + } + __name(createFile, "createFile"); + function toArrayBuffer(source) { + if ("resize" in source.buffer) { + return source; + } + return source.map((x) => x); + } + __name(toArrayBuffer, "toArrayBuffer"); + } +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js +var require_multipartPolicy2 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.multipartPolicyName = void 0; + exports2.multipartPolicy = multipartPolicy; + var policies_1 = require_internal2(); + var file_js_1 = require_file2(); + exports2.multipartPolicyName = policies_1.multipartPolicyName; + function multipartPolicy() { + const tspPolicy = (0, policies_1.multipartPolicy)(); + return { + name: exports2.multipartPolicyName, + sendRequest: async (request, next) => { + if (request.multipartBody) { + for (const part of request.multipartBody.parts) { + if ((0, file_js_1.hasRawContent)(part.body)) { + part.body = (0, file_js_1.getRawContent)(part.body); + } + } + } + return tspPolicy.sendRequest(request, next); + } + }; + } + __name(multipartPolicy, "multipartPolicy"); + } +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js +var require_decompressResponsePolicy2 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.decompressResponsePolicyName = void 0; + exports2.decompressResponsePolicy = decompressResponsePolicy; + var policies_1 = require_internal2(); + exports2.decompressResponsePolicyName = policies_1.decompressResponsePolicyName; + function decompressResponsePolicy() { + return (0, policies_1.decompressResponsePolicy)(); + } + __name(decompressResponsePolicy, "decompressResponsePolicy"); + } +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js +var require_defaultRetryPolicy2 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.defaultRetryPolicyName = void 0; + exports2.defaultRetryPolicy = defaultRetryPolicy; + var policies_1 = require_internal2(); + exports2.defaultRetryPolicyName = policies_1.defaultRetryPolicyName; + function defaultRetryPolicy(options = {}) { + return (0, policies_1.defaultRetryPolicy)(options); + } + __name(defaultRetryPolicy, "defaultRetryPolicy"); + } +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js +var require_formDataPolicy2 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.formDataPolicyName = void 0; + exports2.formDataPolicy = formDataPolicy; + var policies_1 = require_internal2(); + exports2.formDataPolicyName = policies_1.formDataPolicyName; + function formDataPolicy() { + return (0, policies_1.formDataPolicy)(); + } + __name(formDataPolicy, "formDataPolicy"); + } +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js +var require_proxyPolicy2 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.proxyPolicyName = void 0; + exports2.getDefaultProxySettings = getDefaultProxySettings; + exports2.proxyPolicy = proxyPolicy; + var policies_1 = require_internal2(); + exports2.proxyPolicyName = policies_1.proxyPolicyName; + function getDefaultProxySettings(proxyUrl) { + return (0, policies_1.getDefaultProxySettings)(proxyUrl); + } + __name(getDefaultProxySettings, "getDefaultProxySettings"); + function proxyPolicy(proxySettings, options) { + return (0, policies_1.proxyPolicy)(proxySettings, options); + } + __name(proxyPolicy, "proxyPolicy"); + } +}); + // node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/setClientRequestIdPolicy.js var require_setClientRequestIdPolicy = __commonJS({ "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/setClientRequestIdPolicy.js"(exports2) { @@ -30222,24 +32138,33 @@ var require_setClientRequestIdPolicy = __commonJS({ } }); +// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/agentPolicy.js +var require_agentPolicy2 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/agentPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.agentPolicyName = void 0; + exports2.agentPolicy = agentPolicy; + var policies_1 = require_internal2(); + exports2.agentPolicyName = policies_1.agentPolicyName; + function agentPolicy(agent) { + return (0, policies_1.agentPolicy)(agent); + } + __name(agentPolicy, "agentPolicy"); + } +}); + // node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js -var require_tlsPolicy = __commonJS({ +var require_tlsPolicy2 = __commonJS({ "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.tlsPolicyName = void 0; exports2.tlsPolicy = tlsPolicy; - exports2.tlsPolicyName = "tlsPolicy"; + var policies_1 = require_internal2(); + exports2.tlsPolicyName = policies_1.tlsPolicyName; function tlsPolicy(tlsSettings) { - return { - name: exports2.tlsPolicyName, - sendRequest: async (req, next) => { - if (!req.tlsSettings) { - req.tlsSettings = tlsSettings; - } - return next(req); - } - }; + return (0, policies_1.tlsPolicy)(tlsSettings); } __name(tlsPolicy, "tlsPolicy"); } @@ -30250,7 +32175,8 @@ var require_tracingContext = __commonJS({ "node_modules/@azure/core-tracing/dist/commonjs/tracingContext.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.TracingContextImpl = exports2.createTracingContext = exports2.knownContextKeys = void 0; + exports2.TracingContextImpl = exports2.knownContextKeys = void 0; + exports2.createTracingContext = createTracingContext; exports2.knownContextKeys = { span: Symbol.for("@azure/core-tracing span"), namespace: Symbol.for("@azure/core-tracing namespace") @@ -30266,11 +32192,11 @@ var require_tracingContext = __commonJS({ return context; } __name(createTracingContext, "createTracingContext"); - exports2.createTracingContext = createTracingContext; var TracingContextImpl = class _TracingContextImpl { static { __name(this, "TracingContextImpl"); } + _contextMap; constructor(initialContext) { this._contextMap = initialContext instanceof _TracingContextImpl ? new Map(initialContext._contextMap) : /* @__PURE__ */ new Map(); } @@ -30309,7 +32235,10 @@ var require_instrumenter = __commonJS({ "node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getInstrumenter = exports2.useInstrumenter = exports2.createDefaultInstrumenter = exports2.createDefaultTracingSpan = void 0; + exports2.createDefaultTracingSpan = createDefaultTracingSpan; + exports2.createDefaultInstrumenter = createDefaultInstrumenter; + exports2.useInstrumenter = useInstrumenter; + exports2.getInstrumenter = getInstrumenter; var tracingContext_js_1 = require_tracingContext(); var state_js_1 = require_state(); function createDefaultTracingSpan() { @@ -30322,11 +32251,12 @@ var require_instrumenter = __commonJS({ setAttribute: () => { }, setStatus: () => { + }, + addEvent: () => { } }; } __name(createDefaultTracingSpan, "createDefaultTracingSpan"); - exports2.createDefaultTracingSpan = createDefaultTracingSpan; function createDefaultInstrumenter() { return { createRequestHeaders: () => { @@ -30347,12 +32277,10 @@ var require_instrumenter = __commonJS({ }; } __name(createDefaultInstrumenter, "createDefaultInstrumenter"); - exports2.createDefaultInstrumenter = createDefaultInstrumenter; function useInstrumenter(instrumenter) { state_js_1.state.instrumenterImplementation = instrumenter; } __name(useInstrumenter, "useInstrumenter"); - exports2.useInstrumenter = useInstrumenter; function getInstrumenter() { if (!state_js_1.state.instrumenterImplementation) { state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); @@ -30360,7 +32288,6 @@ var require_instrumenter = __commonJS({ return state_js_1.state.instrumenterImplementation; } __name(getInstrumenter, "getInstrumenter"); - exports2.getInstrumenter = getInstrumenter; } }); @@ -30369,14 +32296,18 @@ var require_tracingClient = __commonJS({ "node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createTracingClient = void 0; + exports2.createTracingClient = createTracingClient; var instrumenter_js_1 = require_instrumenter(); var tracingContext_js_1 = require_tracingContext(); function createTracingClient(options) { const { namespace, packageName, packageVersion } = options; function startSpan(name, operationOptions, spanOptions) { - var _a; - const startSpanResult = (0, instrumenter_js_1.getInstrumenter)().startSpan(name, Object.assign(Object.assign({}, spanOptions), { packageName, packageVersion, tracingContext: (_a = operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) === null || _a === void 0 ? void 0 : _a.tracingContext })); + const startSpanResult = (0, instrumenter_js_1.getInstrumenter)().startSpan(name, { + ...spanOptions, + packageName, + packageVersion, + tracingContext: operationOptions?.tracingOptions?.tracingContext + }); let tracingContext = startSpanResult.tracingContext; const span = startSpanResult.span; if (!tracingContext.getValue(tracingContext_js_1.knownContextKeys.namespace)) { @@ -30384,7 +32315,7 @@ var require_tracingClient = __commonJS({ } span.setAttribute("az.namespace", tracingContext.getValue(tracingContext_js_1.knownContextKeys.namespace)); const updatedOptions = Object.assign({}, operationOptions, { - tracingOptions: Object.assign(Object.assign({}, operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions), { tracingContext }) + tracingOptions: { ...operationOptions?.tracingOptions, tracingContext } }); return { span, @@ -30427,7 +32358,6 @@ var require_tracingClient = __commonJS({ }; } __name(createTracingClient, "createTracingClient"); - exports2.createTracingClient = createTracingClient; } }); @@ -30448,57 +32378,17 @@ var require_commonjs5 = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/inspect.js -var require_inspect = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/inspect.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.custom = void 0; - var node_util_1 = require("node:util"); - exports2.custom = node_util_1.inspect.custom; - } -}); - // node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js -var require_restError = __commonJS({ +var require_restError3 = __commonJS({ "node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.RestError = void 0; exports2.isRestError = isRestError; - var core_util_1 = require_commonjs3(); - var inspect_js_1 = require_inspect(); - var sanitizer_js_1 = require_sanitizer(); - var errorSanitizer = new sanitizer_js_1.Sanitizer(); - var RestError = class _RestError extends Error { - static { - __name(this, "RestError"); - } - constructor(message, options = {}) { - super(message); - this.name = "RestError"; - this.code = options.code; - this.statusCode = options.statusCode; - Object.defineProperty(this, "request", { value: options.request, enumerable: false }); - Object.defineProperty(this, "response", { value: options.response, enumerable: false }); - Object.setPrototypeOf(this, _RestError.prototype); - } - /** - * Logging method for util.inspect in Node - */ - [inspect_js_1.custom]() { - return `RestError: ${this.message} - ${errorSanitizer.sanitize(Object.assign(Object.assign({}, this), { request: this.request, response: this.response }))}`; - } - }; - exports2.RestError = RestError; - RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - RestError.PARSE_ERROR = "PARSE_ERROR"; + var ts_http_runtime_1 = require_commonjs(); + exports2.RestError = ts_http_runtime_1.RestError; function isRestError(e) { - if (e instanceof RestError) { - return true; - } - return (0, core_util_1.isError)(e) && e.name === "RestError"; + return (0, ts_http_runtime_1.isRestError)(e); } __name(isRestError, "isRestError"); } @@ -30512,23 +32402,22 @@ var require_tracingPolicy = __commonJS({ exports2.tracingPolicyName = void 0; exports2.tracingPolicy = tracingPolicy; var core_tracing_1 = require_commonjs5(); - var constants_js_1 = require_constants8(); - var userAgent_js_1 = require_userAgent(); - var log_js_1 = require_log2(); - var core_util_1 = require_commonjs3(); - var restError_js_1 = require_restError(); - var sanitizer_js_1 = require_sanitizer(); + var constants_js_1 = require_constants9(); + var userAgent_js_1 = require_userAgent2(); + var log_js_1 = require_log3(); + var core_util_1 = require_commonjs4(); + var restError_js_1 = require_restError3(); + var util_1 = require_internal3(); exports2.tracingPolicyName = "tracingPolicy"; function tracingPolicy(options = {}) { const userAgentPromise = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - const sanitizer = new sanitizer_js_1.Sanitizer({ + const sanitizer = new util_1.Sanitizer({ additionalAllowedQueryParameters: options.additionalAllowedQueryParameters }); const tracingClient = tryCreateTracingClient(); return { name: exports2.tracingPolicyName, async sendRequest(request, next) { - var _a; if (!tracingClient) { return next(request); } @@ -30542,7 +32431,7 @@ var require_tracingPolicy = __commonJS({ if (userAgent) { spanAttributes["http.user_agent"] = userAgent; } - const { span, tracingContext } = (_a = tryCreateSpan(tracingClient, request, spanAttributes)) !== null && _a !== void 0 ? _a : {}; + const { span, tracingContext } = tryCreateSpan(tracingClient, request, spanAttributes) ?? {}; if (!span || !tracingContext) { return next(request); } @@ -30614,9 +32503,11 @@ var require_tracingPolicy = __commonJS({ if (serviceRequestId) { span.setAttribute("serviceRequestId", serviceRequestId); } - span.setStatus({ - status: "success" - }); + if (response.status >= 400) { + span.setStatus({ + status: "error" + }); + } span.end(); } catch (e) { log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); @@ -30626,41 +32517,110 @@ var require_tracingPolicy = __commonJS({ } }); +// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/wrapAbortSignal.js +var require_wrapAbortSignal = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/wrapAbortSignal.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.wrapAbortSignalLike = wrapAbortSignalLike; + function wrapAbortSignalLike(abortSignalLike) { + if (abortSignalLike instanceof AbortSignal) { + return { abortSignal: abortSignalLike }; + } + if (abortSignalLike.aborted) { + return { abortSignal: AbortSignal.abort(abortSignalLike.reason) }; + } + const controller = new AbortController(); + let needsCleanup = true; + function cleanup() { + if (needsCleanup) { + abortSignalLike.removeEventListener("abort", listener); + needsCleanup = false; + } + } + __name(cleanup, "cleanup"); + function listener() { + controller.abort(abortSignalLike.reason); + cleanup(); + } + __name(listener, "listener"); + abortSignalLike.addEventListener("abort", listener); + return { abortSignal: controller.signal, cleanup }; + } + __name(wrapAbortSignalLike, "wrapAbortSignalLike"); + } +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/wrapAbortSignalLikePolicy.js +var require_wrapAbortSignalLikePolicy = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/wrapAbortSignalLikePolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.wrapAbortSignalLikePolicyName = void 0; + exports2.wrapAbortSignalLikePolicy = wrapAbortSignalLikePolicy; + var wrapAbortSignal_js_1 = require_wrapAbortSignal(); + exports2.wrapAbortSignalLikePolicyName = "wrapAbortSignalLikePolicy"; + function wrapAbortSignalLikePolicy() { + return { + name: exports2.wrapAbortSignalLikePolicyName, + sendRequest: async (request, next) => { + if (!request.abortSignal) { + return next(request); + } + const { abortSignal, cleanup } = (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal); + request.abortSignal = abortSignal; + try { + return await next(request); + } finally { + cleanup?.(); + } + } + }; + } + __name(wrapAbortSignalLikePolicy, "wrapAbortSignalLikePolicy"); + } +}); + // node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js -var require_createPipelineFromOptions = __commonJS({ +var require_createPipelineFromOptions2 = __commonJS({ "node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createPipelineFromOptions = createPipelineFromOptions; - var logPolicy_js_1 = require_logPolicy(); - var pipeline_js_1 = require_pipeline(); - var redirectPolicy_js_1 = require_redirectPolicy(); - var userAgentPolicy_js_1 = require_userAgentPolicy(); - var multipartPolicy_js_1 = require_multipartPolicy(); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); - var formDataPolicy_js_1 = require_formDataPolicy(); - var core_util_1 = require_commonjs3(); - var proxyPolicy_js_1 = require_proxyPolicy(); + var logPolicy_js_1 = require_logPolicy2(); + var pipeline_js_1 = require_pipeline2(); + var redirectPolicy_js_1 = require_redirectPolicy2(); + var userAgentPolicy_js_1 = require_userAgentPolicy2(); + var multipartPolicy_js_1 = require_multipartPolicy2(); + var decompressResponsePolicy_js_1 = require_decompressResponsePolicy2(); + var defaultRetryPolicy_js_1 = require_defaultRetryPolicy2(); + var formDataPolicy_js_1 = require_formDataPolicy2(); + var core_util_1 = require_commonjs4(); + var proxyPolicy_js_1 = require_proxyPolicy2(); var setClientRequestIdPolicy_js_1 = require_setClientRequestIdPolicy(); - var tlsPolicy_js_1 = require_tlsPolicy(); + var agentPolicy_js_1 = require_agentPolicy2(); + var tlsPolicy_js_1 = require_tlsPolicy2(); var tracingPolicy_js_1 = require_tracingPolicy(); + var wrapAbortSignalLikePolicy_js_1 = require_wrapAbortSignalLikePolicy(); function createPipelineFromOptions(options) { - var _a; const pipeline = (0, pipeline_js_1.createEmptyPipeline)(); if (core_util_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); + } if (options.tlsOptions) { pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); } pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } + pipeline.addPolicy((0, wrapAbortSignalLikePolicy_js_1.wrapAbortSignalLikePolicy)()); pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); - pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)((_a = options.telemetryOptions) === null || _a === void 0 ? void 0 : _a.clientRequestIdHeaderName)); + pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)(options.telemetryOptions?.clientRequestIdHeaderName)); pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); - pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)(Object.assign(Object.assign({}, options.userAgentOptions), options.loggingOptions)), { + pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)({ ...options.userAgentOptions, ...options.loggingOptions }), { afterPhase: "Retry" }); if (core_util_1.isNodeLike) { @@ -30673,451 +32633,128 @@ var require_createPipelineFromOptions = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js -var require_nodeHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getBodyLength = getBodyLength; - exports2.createNodeHttpClient = createNodeHttpClient; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var http = tslib_1.__importStar(require("node:http")); - var https = tslib_1.__importStar(require("node:https")); - var zlib = tslib_1.__importStar(require("node:zlib")); - var node_stream_1 = require("node:stream"); - var abort_controller_1 = require_commonjs4(); - var httpHeaders_js_1 = require_httpHeaders(); - var restError_js_1 = require_restError(); - var log_js_1 = require_log2(); - var DEFAULT_TLS_SETTINGS = {}; - function isReadableStream(body) { - return body && typeof body.pipe === "function"; - } - __name(isReadableStream, "isReadableStream"); - function isStreamComplete(stream) { - return new Promise((resolve) => { - const handler = /* @__PURE__ */ __name(() => { - resolve(); - stream.removeListener("close", handler); - stream.removeListener("end", handler); - stream.removeListener("error", handler); - }, "handler"); - stream.on("close", handler); - stream.on("end", handler); - stream.on("error", handler); - }); - } - __name(isStreamComplete, "isStreamComplete"); - function isArrayBuffer(body) { - return body && typeof body.byteLength === "number"; - } - __name(isArrayBuffer, "isArrayBuffer"); - var ReportTransform = class extends node_stream_1.Transform { - static { - __name(this, "ReportTransform"); - } - // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type - _transform(chunk, _encoding, callback) { - this.push(chunk); - this.loadedBytes += chunk.length; - try { - this.progressCallback({ loadedBytes: this.loadedBytes }); - callback(); - } catch (e) { - callback(e); - } - } - constructor(progressCallback) { - super(); - this.loadedBytes = 0; - this.progressCallback = progressCallback; - } - }; - var NodeHttpClient = class { - static { - __name(this, "NodeHttpClient"); - } - constructor() { - this.cachedHttpsAgents = /* @__PURE__ */ new WeakMap(); - } - /** - * Makes a request over an underlying transport layer and returns the response. - * @param request - The request to be made. - */ - async sendRequest(request) { - var _a, _b, _c; - const abortController = new AbortController(); - let abortListener; - if (request.abortSignal) { - if (request.abortSignal.aborted) { - throw new abort_controller_1.AbortError("The operation was aborted."); - } - abortListener = /* @__PURE__ */ __name((event) => { - if (event.type === "abort") { - abortController.abort(); - } - }, "abortListener"); - request.abortSignal.addEventListener("abort", abortListener); - } - if (request.timeout > 0) { - setTimeout(() => { - abortController.abort(); - }, request.timeout); - } - const acceptEncoding = request.headers.get("Accept-Encoding"); - const shouldDecompress = (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("gzip")) || (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("deflate")); - let body = typeof request.body === "function" ? request.body() : request.body; - if (body && !request.headers.has("Content-Length")) { - const bodyLength = getBodyLength(body); - if (bodyLength !== null) { - request.headers.set("Content-Length", bodyLength); - } - } - let responseStream; - try { - if (body && request.onUploadProgress) { - const onUploadProgress = request.onUploadProgress; - const uploadReportStream = new ReportTransform(onUploadProgress); - uploadReportStream.on("error", (e) => { - log_js_1.logger.error("Error in upload progress", e); - }); - if (isReadableStream(body)) { - body.pipe(uploadReportStream); - } else { - uploadReportStream.end(body); - } - body = uploadReportStream; - } - const res = await this.makeRequest(request, abortController, body); - const headers = getResponseHeaders(res); - const status = (_a = res.statusCode) !== null && _a !== void 0 ? _a : 0; - const response = { - status, - headers, - request - }; - if (request.method === "HEAD") { - res.resume(); - return response; - } - responseStream = shouldDecompress ? getDecodedResponseStream(res, headers) : res; - const onDownloadProgress = request.onDownloadProgress; - if (onDownloadProgress) { - const downloadReportStream = new ReportTransform(onDownloadProgress); - downloadReportStream.on("error", (e) => { - log_js_1.logger.error("Error in download progress", e); - }); - responseStream.pipe(downloadReportStream); - responseStream = downloadReportStream; - } - if ( - // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code - ((_b = request.streamResponseStatusCodes) === null || _b === void 0 ? void 0 : _b.has(Number.POSITIVE_INFINITY)) || ((_c = request.streamResponseStatusCodes) === null || _c === void 0 ? void 0 : _c.has(response.status)) - ) { - response.readableStreamBody = responseStream; - } else { - response.bodyAsText = await streamToText(responseStream); - } - return response; - } finally { - if (request.abortSignal && abortListener) { - let uploadStreamDone = Promise.resolve(); - if (isReadableStream(body)) { - uploadStreamDone = isStreamComplete(body); - } - let downloadStreamDone = Promise.resolve(); - if (isReadableStream(responseStream)) { - downloadStreamDone = isStreamComplete(responseStream); - } - Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { - var _a2; - if (abortListener) { - (_a2 = request.abortSignal) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener("abort", abortListener); - } - }).catch((e) => { - log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); - }); - } - } - } - makeRequest(request, abortController, body) { - var _a; - const url = new URL(request.url); - const isInsecure = url.protocol !== "https:"; - if (isInsecure && !request.allowInsecureConnection) { - throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); - } - const agent = (_a = request.agent) !== null && _a !== void 0 ? _a : this.getOrCreateAgent(request, isInsecure); - const options = { - agent, - hostname: url.hostname, - path: `${url.pathname}${url.search}`, - port: url.port, - method: request.method, - headers: request.headers.toJSON({ preserveCase: true }) - }; - return new Promise((resolve, reject) => { - const req = isInsecure ? http.request(options, resolve) : https.request(options, resolve); - req.once("error", (err) => { - var _a2; - reject(new restError_js_1.RestError(err.message, { code: (_a2 = err.code) !== null && _a2 !== void 0 ? _a2 : restError_js_1.RestError.REQUEST_SEND_ERROR, request })); - }); - abortController.signal.addEventListener("abort", () => { - const abortError = new abort_controller_1.AbortError("The operation was aborted."); - req.destroy(abortError); - reject(abortError); - }); - if (body && isReadableStream(body)) { - body.pipe(req); - } else if (body) { - if (typeof body === "string" || Buffer.isBuffer(body)) { - req.end(body); - } else if (isArrayBuffer(body)) { - req.end(ArrayBuffer.isView(body) ? Buffer.from(body.buffer) : Buffer.from(body)); - } else { - log_js_1.logger.error("Unrecognized body type", body); - reject(new restError_js_1.RestError("Unrecognized body type")); - } - } else { - req.end(); - } - }); - } - getOrCreateAgent(request, isInsecure) { - var _a; - const disableKeepAlive = request.disableKeepAlive; - if (isInsecure) { - if (disableKeepAlive) { - return http.globalAgent; - } - if (!this.cachedHttpAgent) { - this.cachedHttpAgent = new http.Agent({ keepAlive: true }); - } - return this.cachedHttpAgent; - } else { - if (disableKeepAlive && !request.tlsSettings) { - return https.globalAgent; - } - const tlsSettings = (_a = request.tlsSettings) !== null && _a !== void 0 ? _a : DEFAULT_TLS_SETTINGS; - let agent = this.cachedHttpsAgents.get(tlsSettings); - if (agent && agent.options.keepAlive === !disableKeepAlive) { - return agent; - } - log_js_1.logger.info("No cached TLS Agent exist, creating a new Agent"); - agent = new https.Agent(Object.assign({ - // keepAlive is true if disableKeepAlive is false. - keepAlive: !disableKeepAlive - }, tlsSettings)); - this.cachedHttpsAgents.set(tlsSettings, agent); - return agent; - } - } - }; - function getResponseHeaders(res) { - const headers = (0, httpHeaders_js_1.createHttpHeaders)(); - for (const header of Object.keys(res.headers)) { - const value = res.headers[header]; - if (Array.isArray(value)) { - if (value.length > 0) { - headers.set(header, value[0]); - } - } else if (value) { - headers.set(header, value); - } - } - return headers; - } - __name(getResponseHeaders, "getResponseHeaders"); - function getDecodedResponseStream(stream, headers) { - const contentEncoding = headers.get("Content-Encoding"); - if (contentEncoding === "gzip") { - const unzip = zlib.createGunzip(); - stream.pipe(unzip); - return unzip; - } else if (contentEncoding === "deflate") { - const inflate = zlib.createInflate(); - stream.pipe(inflate); - return inflate; - } - return stream; - } - __name(getDecodedResponseStream, "getDecodedResponseStream"); - function streamToText(stream) { - return new Promise((resolve, reject) => { - const buffer = []; - stream.on("data", (chunk) => { - if (Buffer.isBuffer(chunk)) { - buffer.push(chunk); - } else { - buffer.push(Buffer.from(chunk)); - } - }); - stream.on("end", () => { - resolve(Buffer.concat(buffer).toString("utf8")); - }); - stream.on("error", (e) => { - if (e && (e === null || e === void 0 ? void 0 : e.name) === "AbortError") { - reject(e); - } else { - reject(new restError_js_1.RestError(`Error reading response as text: ${e.message}`, { - code: restError_js_1.RestError.PARSE_ERROR - })); - } - }); - }); - } - __name(streamToText, "streamToText"); - function getBodyLength(body) { - if (!body) { - return 0; - } else if (Buffer.isBuffer(body)) { - return body.length; - } else if (isReadableStream(body)) { - return null; - } else if (isArrayBuffer(body)) { - return body.byteLength; - } else if (typeof body === "string") { - return Buffer.from(body).length; - } else { - return null; - } - } - __name(getBodyLength, "getBodyLength"); - function createNodeHttpClient() { - return new NodeHttpClient(); - } - __name(createNodeHttpClient, "createNodeHttpClient"); - } -}); - // node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js -var require_defaultHttpClient = __commonJS({ +var require_defaultHttpClient2 = __commonJS({ "node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createDefaultHttpClient = createDefaultHttpClient; - var nodeHttpClient_js_1 = require_nodeHttpClient(); + var ts_http_runtime_1 = require_commonjs(); + var wrapAbortSignal_js_1 = require_wrapAbortSignal(); function createDefaultHttpClient() { - return (0, nodeHttpClient_js_1.createNodeHttpClient)(); + const client = (0, ts_http_runtime_1.createDefaultHttpClient)(); + return { + async sendRequest(request) { + const { abortSignal, cleanup } = request.abortSignal ? (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal) : {}; + try { + request.abortSignal = abortSignal; + return await client.sendRequest(request); + } finally { + cleanup?.(); + } + } + }; } __name(createDefaultHttpClient, "createDefaultHttpClient"); } }); +// node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js +var require_httpHeaders2 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createHttpHeaders = createHttpHeaders; + var ts_http_runtime_1 = require_commonjs(); + function createHttpHeaders(rawHeaders) { + return (0, ts_http_runtime_1.createHttpHeaders)(rawHeaders); + } + __name(createHttpHeaders, "createHttpHeaders"); + } +}); + // node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js -var require_pipelineRequest = __commonJS({ +var require_pipelineRequest2 = __commonJS({ "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createPipelineRequest = createPipelineRequest; - var httpHeaders_js_1 = require_httpHeaders(); - var core_util_1 = require_commonjs3(); - var PipelineRequestImpl = class { - static { - __name(this, "PipelineRequestImpl"); - } - constructor(options) { - var _a, _b, _c, _d, _e, _f, _g; - this.url = options.url; - this.body = options.body; - this.headers = (_a = options.headers) !== null && _a !== void 0 ? _a : (0, httpHeaders_js_1.createHttpHeaders)(); - this.method = (_b = options.method) !== null && _b !== void 0 ? _b : "GET"; - this.timeout = (_c = options.timeout) !== null && _c !== void 0 ? _c : 0; - this.multipartBody = options.multipartBody; - this.formData = options.formData; - this.disableKeepAlive = (_d = options.disableKeepAlive) !== null && _d !== void 0 ? _d : false; - this.proxySettings = options.proxySettings; - this.streamResponseStatusCodes = options.streamResponseStatusCodes; - this.withCredentials = (_e = options.withCredentials) !== null && _e !== void 0 ? _e : false; - this.abortSignal = options.abortSignal; - this.tracingOptions = options.tracingOptions; - this.onUploadProgress = options.onUploadProgress; - this.onDownloadProgress = options.onDownloadProgress; - this.requestId = options.requestId || (0, core_util_1.randomUUID)(); - this.allowInsecureConnection = (_f = options.allowInsecureConnection) !== null && _f !== void 0 ? _f : false; - this.enableBrowserStreams = (_g = options.enableBrowserStreams) !== null && _g !== void 0 ? _g : false; - } - }; + var ts_http_runtime_1 = require_commonjs(); function createPipelineRequest(options) { - return new PipelineRequestImpl(options); + return (0, ts_http_runtime_1.createPipelineRequest)(options); } __name(createPipelineRequest, "createPipelineRequest"); } }); // node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js -var require_exponentialRetryPolicy = __commonJS({ +var require_exponentialRetryPolicy2 = __commonJS({ "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.exponentialRetryPolicyName = void 0; exports2.exponentialRetryPolicy = exponentialRetryPolicy; - var exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); - var constants_js_1 = require_constants8(); - exports2.exponentialRetryPolicyName = "exponentialRetryPolicy"; + var policies_1 = require_internal2(); + exports2.exponentialRetryPolicyName = policies_1.exponentialRetryPolicyName; function exponentialRetryPolicy(options = {}) { - var _a; - return (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreSystemErrors: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }); + return (0, policies_1.exponentialRetryPolicy)(options); } __name(exponentialRetryPolicy, "exponentialRetryPolicy"); } }); // node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js -var require_systemErrorRetryPolicy = __commonJS({ +var require_systemErrorRetryPolicy2 = __commonJS({ "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.systemErrorRetryPolicyName = void 0; exports2.systemErrorRetryPolicy = systemErrorRetryPolicy; - var exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); - var constants_js_1 = require_constants8(); - exports2.systemErrorRetryPolicyName = "systemErrorRetryPolicy"; + var policies_1 = require_internal2(); + exports2.systemErrorRetryPolicyName = policies_1.systemErrorRetryPolicyName; function systemErrorRetryPolicy(options = {}) { - var _a; - return { - name: exports2.systemErrorRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreHttpStatusCodes: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + return (0, policies_1.systemErrorRetryPolicy)(options); } __name(systemErrorRetryPolicy, "systemErrorRetryPolicy"); } }); // node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js -var require_throttlingRetryPolicy = __commonJS({ +var require_throttlingRetryPolicy2 = __commonJS({ "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.throttlingRetryPolicyName = void 0; exports2.throttlingRetryPolicy = throttlingRetryPolicy; - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); - var constants_js_1 = require_constants8(); - exports2.throttlingRetryPolicyName = "throttlingRetryPolicy"; + var policies_1 = require_internal2(); + exports2.throttlingRetryPolicyName = policies_1.throttlingRetryPolicyName; function throttlingRetryPolicy(options = {}) { - var _a; - return { - name: exports2.throttlingRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)()], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + return (0, policies_1.throttlingRetryPolicy)(options); } __name(throttlingRetryPolicy, "throttlingRetryPolicy"); } }); +// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js +var require_retryPolicy2 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.retryPolicy = retryPolicy; + var logger_1 = require_commonjs2(); + var constants_js_1 = require_constants9(); + var policies_1 = require_internal2(); + var retryPolicyLogger = (0, logger_1.createClientLogger)("core-rest-pipeline retryPolicy"); + function retryPolicy(strategies, options = { maxRetries: constants_js_1.DEFAULT_RETRY_POLICY_COUNT }) { + return (0, policies_1.retryPolicy)(strategies, { + logger: retryPolicyLogger, + ...options + }); + } + __name(retryPolicy, "retryPolicy"); + } +}); + // node_modules/@azure/core-rest-pipeline/dist/commonjs/util/tokenCycler.js var require_tokenCycler = __commonJS({ "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/tokenCycler.js"(exports2) { @@ -31125,7 +32762,7 @@ var require_tokenCycler = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DEFAULT_CYCLER_OPTIONS = void 0; exports2.createTokenCycler = createTokenCycler; - var helpers_js_1 = require_helpers(); + var core_util_1 = require_commonjs4(); exports2.DEFAULT_CYCLER_OPTIONS = { forcedRefreshWindowInMs: 1e3, // Force waiting for a refresh 1s before the token expires @@ -31139,7 +32776,7 @@ var require_tokenCycler = __commonJS({ if (Date.now() < refreshTimeout) { try { return await getAccessToken(); - } catch (_a) { + } catch { return null; } } else { @@ -31153,7 +32790,7 @@ var require_tokenCycler = __commonJS({ __name(tryGetAccessToken, "tryGetAccessToken"); let token = await tryGetAccessToken(); while (token === null) { - await (0, helpers_js_1.delay)(retryIntervalInMs); + await (0, core_util_1.delay)(retryIntervalInMs); token = await tryGetAccessToken(); } return token; @@ -31163,7 +32800,10 @@ var require_tokenCycler = __commonJS({ let refreshWorker = null; let token = null; let tenantId; - const options = Object.assign(Object.assign({}, exports2.DEFAULT_CYCLER_OPTIONS), tokenCyclerOptions); + const options = { + ...exports2.DEFAULT_CYCLER_OPTIONS, + ...tokenCyclerOptions + }; const cycler = { /** * Produces true if a refresh job is currently in progress. @@ -31176,14 +32816,13 @@ var require_tokenCycler = __commonJS({ * window and not already refreshing) */ get shouldRefresh() { - var _a; if (cycler.isRefreshing) { return false; } - if ((token === null || token === void 0 ? void 0 : token.refreshAfterTimestamp) && token.refreshAfterTimestamp < Date.now()) { + if (token?.refreshAfterTimestamp && token.refreshAfterTimestamp < Date.now()) { return true; } - return ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 0) - options.refreshWindowInMs < Date.now(); + return (token?.expiresOnTimestamp ?? 0) - options.refreshWindowInMs < Date.now(); }, /** * Produces true if the cycler MUST refresh (null or nearly-expired @@ -31194,14 +32833,13 @@ var require_tokenCycler = __commonJS({ } }; function refresh(scopes, getTokenOptions) { - var _a; if (!cycler.isRefreshing) { const tryGetAccessToken = /* @__PURE__ */ __name(() => credential.getToken(scopes, getTokenOptions), "tryGetAccessToken"); refreshWorker = beginRefresh( tryGetAccessToken, options.retryIntervalInMs, // If we don't have a token, then we should timeout immediately - (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : Date.now() + token?.expiresOnTimestamp ?? Date.now() ).then((_token) => { refreshWorker = null; token = _token; @@ -31244,14 +32882,29 @@ var require_bearerTokenAuthenticationPolicy = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.bearerTokenAuthenticationPolicyName = void 0; exports2.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; + exports2.parseChallenges = parseChallenges; var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log2(); + var log_js_1 = require_log3(); + var restError_js_1 = require_restError3(); exports2.bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy"; + async function trySendRequest(request, next) { + try { + return [await next(request), void 0]; + } catch (e) { + if ((0, restError_js_1.isRestError)(e) && e.response) { + return [e.response, e]; + } else { + throw e; + } + } + } + __name(trySendRequest, "trySendRequest"); async function defaultAuthorizeRequest(options) { const { scopes, getAccessToken, request } = options; const getTokenOptions = { abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions + tracingOptions: request.tracingOptions, + enableCae: true }; const accessToken = await getAccessToken(scopes, getTokenOptions); if (accessToken) { @@ -31259,19 +32912,30 @@ var require_bearerTokenAuthenticationPolicy = __commonJS({ } } __name(defaultAuthorizeRequest, "defaultAuthorizeRequest"); - function getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + function isChallengeResponse(response) { + return response.status === 401 && response.headers.has("WWW-Authenticate"); } - __name(getChallenge, "getChallenge"); + __name(isChallengeResponse, "isChallengeResponse"); + async function authorizeRequestOnCaeChallenge(onChallengeOptions, caeClaims) { + const { scopes } = onChallengeOptions; + const accessToken = await onChallengeOptions.getAccessToken(scopes, { + enableCae: true, + claims: caeClaims + }); + if (!accessToken) { + return false; + } + onChallengeOptions.request.headers.set("Authorization", `${accessToken.tokenType ?? "Bearer"} ${accessToken.token}`); + return true; + } + __name(authorizeRequestOnCaeChallenge, "authorizeRequestOnCaeChallenge"); function bearerTokenAuthenticationPolicy(options) { - var _a; const { credential, scopes, challengeCallbacks } = options; const logger = options.logger || log_js_1.logger; - const callbacks = Object.assign({ authorizeRequest: (_a = challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequest) !== null && _a !== void 0 ? _a : defaultAuthorizeRequest, authorizeRequestOnChallenge: challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequestOnChallenge }, challengeCallbacks); + const callbacks = { + authorizeRequest: challengeCallbacks?.authorizeRequest?.bind(challengeCallbacks) ?? defaultAuthorizeRequest, + authorizeRequestOnChallenge: challengeCallbacks?.authorizeRequestOnChallenge?.bind(challengeCallbacks) + }; const getAccessToken = credential ? (0, tokenCycler_js_1.createTokenCycler)( credential /* , options */ @@ -31303,22 +32967,61 @@ var require_bearerTokenAuthenticationPolicy = __commonJS({ }); let response; let error; - try { - response = await next(request); - } catch (err) { - error = err; - response = err.response; - } - if (callbacks.authorizeRequestOnChallenge && (response === null || response === void 0 ? void 0 : response.status) === 401 && getChallenge(response)) { - const shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - response, - getAccessToken, - logger - }); - if (shouldSendRequest) { - return next(request); + let shouldSendRequest; + [response, error] = await trySendRequest(request, next); + if (isChallengeResponse(response)) { + let claims = getCaeChallengeClaims(response.headers.get("WWW-Authenticate")); + if (claims) { + let parsedClaim; + try { + parsedClaim = atob(claims); + } catch (e) { + logger.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${claims}`); + return response; + } + shouldSendRequest = await authorizeRequestOnCaeChallenge({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + response, + request, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error] = await trySendRequest(request, next); + } + } else if (callbacks.authorizeRequestOnChallenge) { + shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + request, + response, + getAccessToken, + logger + }); + if (shouldSendRequest) { + [response, error] = await trySendRequest(request, next); + } + if (isChallengeResponse(response)) { + claims = getCaeChallengeClaims(response.headers.get("WWW-Authenticate")); + if (claims) { + let parsedClaim; + try { + parsedClaim = atob(claims); + } catch (e) { + logger.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${claims}`); + return response; + } + shouldSendRequest = await authorizeRequestOnCaeChallenge({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + response, + request, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error] = await trySendRequest(request, next); + } + } + } } } if (error) { @@ -31330,6 +33033,32 @@ var require_bearerTokenAuthenticationPolicy = __commonJS({ }; } __name(bearerTokenAuthenticationPolicy, "bearerTokenAuthenticationPolicy"); + function parseChallenges(challenges) { + const challengeRegex = /(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g; + const paramRegex = /(\w+)="([^"]*)"/g; + const parsedChallenges = []; + let match; + while ((match = challengeRegex.exec(challenges)) !== null) { + const scheme = match[1]; + const paramsString = match[2]; + const params = {}; + let paramMatch; + while ((paramMatch = paramRegex.exec(paramsString)) !== null) { + params[paramMatch[1]] = paramMatch[2]; + } + parsedChallenges.push({ scheme, params }); + } + return parsedChallenges; + } + __name(parseChallenges, "parseChallenges"); + function getCaeChallengeClaims(challenges) { + if (!challenges) { + return; + } + const parsedChallenges = parseChallenges(challenges); + return parsedChallenges.find((x) => x.scheme === "Bearer" && x.params.claims && x.params.error === "insufficient_claims")?.params.claims; + } + __name(getCaeChallengeClaims, "getCaeChallengeClaims"); } }); @@ -31367,17 +33096,16 @@ var require_auxiliaryAuthenticationHeaderPolicy = __commonJS({ exports2.auxiliaryAuthenticationHeaderPolicyName = void 0; exports2.auxiliaryAuthenticationHeaderPolicy = auxiliaryAuthenticationHeaderPolicy; var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log2(); + var log_js_1 = require_log3(); exports2.auxiliaryAuthenticationHeaderPolicyName = "auxiliaryAuthenticationHeaderPolicy"; var AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; async function sendAuthorizeRequest(options) { - var _a, _b; const { scopes, getAccessToken, request } = options; const getTokenOptions = { abortSignal: request.abortSignal, tracingOptions: request.tracingOptions }; - return (_b = (_a = await getAccessToken(scopes, getTokenOptions)) === null || _a === void 0 ? void 0 : _a.token) !== null && _b !== void 0 ? _b : ""; + return (await getAccessToken(scopes, getTokenOptions))?.token ?? ""; } __name(sendAuthorizeRequest, "sendAuthorizeRequest"); function auxiliaryAuthenticationHeaderPolicy(options) { @@ -31427,42 +33155,42 @@ var require_commonjs6 = __commonJS({ "node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createFileFromStream = exports2.createFile = exports2.auxiliaryAuthenticationHeaderPolicyName = exports2.auxiliaryAuthenticationHeaderPolicy = exports2.ndJsonPolicyName = exports2.ndJsonPolicy = exports2.bearerTokenAuthenticationPolicyName = exports2.bearerTokenAuthenticationPolicy = exports2.formDataPolicyName = exports2.formDataPolicy = exports2.tlsPolicyName = exports2.tlsPolicy = exports2.userAgentPolicyName = exports2.userAgentPolicy = exports2.defaultRetryPolicy = exports2.tracingPolicyName = exports2.tracingPolicy = exports2.retryPolicy = exports2.throttlingRetryPolicyName = exports2.throttlingRetryPolicy = exports2.systemErrorRetryPolicyName = exports2.systemErrorRetryPolicy = exports2.redirectPolicyName = exports2.redirectPolicy = exports2.getDefaultProxySettings = exports2.proxyPolicyName = exports2.proxyPolicy = exports2.multipartPolicyName = exports2.multipartPolicy = exports2.logPolicyName = exports2.logPolicy = exports2.setClientRequestIdPolicyName = exports2.setClientRequestIdPolicy = exports2.exponentialRetryPolicyName = exports2.exponentialRetryPolicy = exports2.decompressResponsePolicyName = exports2.decompressResponsePolicy = exports2.isRestError = exports2.RestError = exports2.createPipelineRequest = exports2.createHttpHeaders = exports2.createDefaultHttpClient = exports2.createPipelineFromOptions = exports2.createEmptyPipeline = void 0; - var pipeline_js_1 = require_pipeline(); + exports2.createFileFromStream = exports2.createFile = exports2.agentPolicyName = exports2.agentPolicy = exports2.auxiliaryAuthenticationHeaderPolicyName = exports2.auxiliaryAuthenticationHeaderPolicy = exports2.ndJsonPolicyName = exports2.ndJsonPolicy = exports2.bearerTokenAuthenticationPolicyName = exports2.bearerTokenAuthenticationPolicy = exports2.formDataPolicyName = exports2.formDataPolicy = exports2.tlsPolicyName = exports2.tlsPolicy = exports2.userAgentPolicyName = exports2.userAgentPolicy = exports2.defaultRetryPolicy = exports2.tracingPolicyName = exports2.tracingPolicy = exports2.retryPolicy = exports2.throttlingRetryPolicyName = exports2.throttlingRetryPolicy = exports2.systemErrorRetryPolicyName = exports2.systemErrorRetryPolicy = exports2.redirectPolicyName = exports2.redirectPolicy = exports2.getDefaultProxySettings = exports2.proxyPolicyName = exports2.proxyPolicy = exports2.multipartPolicyName = exports2.multipartPolicy = exports2.logPolicyName = exports2.logPolicy = exports2.setClientRequestIdPolicyName = exports2.setClientRequestIdPolicy = exports2.exponentialRetryPolicyName = exports2.exponentialRetryPolicy = exports2.decompressResponsePolicyName = exports2.decompressResponsePolicy = exports2.isRestError = exports2.RestError = exports2.createPipelineRequest = exports2.createHttpHeaders = exports2.createDefaultHttpClient = exports2.createPipelineFromOptions = exports2.createEmptyPipeline = void 0; + var pipeline_js_1 = require_pipeline2(); Object.defineProperty(exports2, "createEmptyPipeline", { enumerable: true, get: function() { return pipeline_js_1.createEmptyPipeline; } }); - var createPipelineFromOptions_js_1 = require_createPipelineFromOptions(); + var createPipelineFromOptions_js_1 = require_createPipelineFromOptions2(); Object.defineProperty(exports2, "createPipelineFromOptions", { enumerable: true, get: function() { return createPipelineFromOptions_js_1.createPipelineFromOptions; } }); - var defaultHttpClient_js_1 = require_defaultHttpClient(); + var defaultHttpClient_js_1 = require_defaultHttpClient2(); Object.defineProperty(exports2, "createDefaultHttpClient", { enumerable: true, get: function() { return defaultHttpClient_js_1.createDefaultHttpClient; } }); - var httpHeaders_js_1 = require_httpHeaders(); + var httpHeaders_js_1 = require_httpHeaders2(); Object.defineProperty(exports2, "createHttpHeaders", { enumerable: true, get: function() { return httpHeaders_js_1.createHttpHeaders; } }); - var pipelineRequest_js_1 = require_pipelineRequest(); + var pipelineRequest_js_1 = require_pipelineRequest2(); Object.defineProperty(exports2, "createPipelineRequest", { enumerable: true, get: function() { return pipelineRequest_js_1.createPipelineRequest; } }); - var restError_js_1 = require_restError(); + var restError_js_1 = require_restError3(); Object.defineProperty(exports2, "RestError", { enumerable: true, get: function() { return restError_js_1.RestError; } }); Object.defineProperty(exports2, "isRestError", { enumerable: true, get: function() { return restError_js_1.isRestError; } }); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); + var decompressResponsePolicy_js_1 = require_decompressResponsePolicy2(); Object.defineProperty(exports2, "decompressResponsePolicy", { enumerable: true, get: function() { return decompressResponsePolicy_js_1.decompressResponsePolicy; } }); Object.defineProperty(exports2, "decompressResponsePolicyName", { enumerable: true, get: function() { return decompressResponsePolicy_js_1.decompressResponsePolicyName; } }); - var exponentialRetryPolicy_js_1 = require_exponentialRetryPolicy(); + var exponentialRetryPolicy_js_1 = require_exponentialRetryPolicy2(); Object.defineProperty(exports2, "exponentialRetryPolicy", { enumerable: true, get: function() { return exponentialRetryPolicy_js_1.exponentialRetryPolicy; } }); @@ -31476,21 +33204,21 @@ var require_commonjs6 = __commonJS({ Object.defineProperty(exports2, "setClientRequestIdPolicyName", { enumerable: true, get: function() { return setClientRequestIdPolicy_js_1.setClientRequestIdPolicyName; } }); - var logPolicy_js_1 = require_logPolicy(); + var logPolicy_js_1 = require_logPolicy2(); Object.defineProperty(exports2, "logPolicy", { enumerable: true, get: function() { return logPolicy_js_1.logPolicy; } }); Object.defineProperty(exports2, "logPolicyName", { enumerable: true, get: function() { return logPolicy_js_1.logPolicyName; } }); - var multipartPolicy_js_1 = require_multipartPolicy(); + var multipartPolicy_js_1 = require_multipartPolicy2(); Object.defineProperty(exports2, "multipartPolicy", { enumerable: true, get: function() { return multipartPolicy_js_1.multipartPolicy; } }); Object.defineProperty(exports2, "multipartPolicyName", { enumerable: true, get: function() { return multipartPolicy_js_1.multipartPolicyName; } }); - var proxyPolicy_js_1 = require_proxyPolicy(); + var proxyPolicy_js_1 = require_proxyPolicy2(); Object.defineProperty(exports2, "proxyPolicy", { enumerable: true, get: function() { return proxyPolicy_js_1.proxyPolicy; } }); @@ -31500,28 +33228,28 @@ var require_commonjs6 = __commonJS({ Object.defineProperty(exports2, "getDefaultProxySettings", { enumerable: true, get: function() { return proxyPolicy_js_1.getDefaultProxySettings; } }); - var redirectPolicy_js_1 = require_redirectPolicy(); + var redirectPolicy_js_1 = require_redirectPolicy2(); Object.defineProperty(exports2, "redirectPolicy", { enumerable: true, get: function() { return redirectPolicy_js_1.redirectPolicy; } }); Object.defineProperty(exports2, "redirectPolicyName", { enumerable: true, get: function() { return redirectPolicy_js_1.redirectPolicyName; } }); - var systemErrorRetryPolicy_js_1 = require_systemErrorRetryPolicy(); + var systemErrorRetryPolicy_js_1 = require_systemErrorRetryPolicy2(); Object.defineProperty(exports2, "systemErrorRetryPolicy", { enumerable: true, get: function() { return systemErrorRetryPolicy_js_1.systemErrorRetryPolicy; } }); Object.defineProperty(exports2, "systemErrorRetryPolicyName", { enumerable: true, get: function() { return systemErrorRetryPolicy_js_1.systemErrorRetryPolicyName; } }); - var throttlingRetryPolicy_js_1 = require_throttlingRetryPolicy(); + var throttlingRetryPolicy_js_1 = require_throttlingRetryPolicy2(); Object.defineProperty(exports2, "throttlingRetryPolicy", { enumerable: true, get: function() { return throttlingRetryPolicy_js_1.throttlingRetryPolicy; } }); Object.defineProperty(exports2, "throttlingRetryPolicyName", { enumerable: true, get: function() { return throttlingRetryPolicy_js_1.throttlingRetryPolicyName; } }); - var retryPolicy_js_1 = require_retryPolicy(); + var retryPolicy_js_1 = require_retryPolicy2(); Object.defineProperty(exports2, "retryPolicy", { enumerable: true, get: function() { return retryPolicy_js_1.retryPolicy; } }); @@ -31532,25 +33260,25 @@ var require_commonjs6 = __commonJS({ Object.defineProperty(exports2, "tracingPolicyName", { enumerable: true, get: function() { return tracingPolicy_js_1.tracingPolicyName; } }); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); + var defaultRetryPolicy_js_1 = require_defaultRetryPolicy2(); Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { return defaultRetryPolicy_js_1.defaultRetryPolicy; } }); - var userAgentPolicy_js_1 = require_userAgentPolicy(); + var userAgentPolicy_js_1 = require_userAgentPolicy2(); Object.defineProperty(exports2, "userAgentPolicy", { enumerable: true, get: function() { return userAgentPolicy_js_1.userAgentPolicy; } }); Object.defineProperty(exports2, "userAgentPolicyName", { enumerable: true, get: function() { return userAgentPolicy_js_1.userAgentPolicyName; } }); - var tlsPolicy_js_1 = require_tlsPolicy(); + var tlsPolicy_js_1 = require_tlsPolicy2(); Object.defineProperty(exports2, "tlsPolicy", { enumerable: true, get: function() { return tlsPolicy_js_1.tlsPolicy; } }); Object.defineProperty(exports2, "tlsPolicyName", { enumerable: true, get: function() { return tlsPolicy_js_1.tlsPolicyName; } }); - var formDataPolicy_js_1 = require_formDataPolicy(); + var formDataPolicy_js_1 = require_formDataPolicy2(); Object.defineProperty(exports2, "formDataPolicy", { enumerable: true, get: function() { return formDataPolicy_js_1.formDataPolicy; } }); @@ -31578,6 +33306,13 @@ var require_commonjs6 = __commonJS({ Object.defineProperty(exports2, "auxiliaryAuthenticationHeaderPolicyName", { enumerable: true, get: function() { return auxiliaryAuthenticationHeaderPolicy_js_1.auxiliaryAuthenticationHeaderPolicyName; } }); + var agentPolicy_js_1 = require_agentPolicy2(); + Object.defineProperty(exports2, "agentPolicy", { enumerable: true, get: function() { + return agentPolicy_js_1.agentPolicy; + } }); + Object.defineProperty(exports2, "agentPolicyName", { enumerable: true, get: function() { + return agentPolicy_js_1.agentPolicyName; + } }); var file_js_1 = require_file2(); Object.defineProperty(exports2, "createFile", { enumerable: true, get: function() { return file_js_1.createFile; @@ -31598,6 +33333,7 @@ var require_azureKeyCredential = __commonJS({ static { __name(this, "AzureKeyCredential"); } + _key; /** * The value of the key to be used in authentication */ @@ -31638,7 +33374,7 @@ var require_keyCredential = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.isKeyCredential = isKeyCredential; - var core_util_1 = require_commonjs3(); + var core_util_1 = require_commonjs4(); function isKeyCredential(credential) { return (0, core_util_1.isObjectWithProperties)(credential, ["key"]) && typeof credential.key === "string"; } @@ -31653,11 +33389,13 @@ var require_azureNamedKeyCredential = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.AzureNamedKeyCredential = void 0; exports2.isNamedKeyCredential = isNamedKeyCredential; - var core_util_1 = require_commonjs3(); + var core_util_1 = require_commonjs4(); var AzureNamedKeyCredential = class { static { __name(this, "AzureNamedKeyCredential"); } + _key; + _name; /** * The value of the key to be used in authentication. */ @@ -31716,11 +33454,12 @@ var require_azureSASCredential = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.AzureSASCredential = void 0; exports2.isSASCredential = isSASCredential; - var core_util_1 = require_commonjs3(); + var core_util_1 = require_commonjs4(); var AzureSASCredential = class { static { __name(this, "AzureSASCredential"); } + _signature; /** * The value of the shared access signature to be used in authentication */ @@ -31767,7 +33506,17 @@ var require_tokenCredential = __commonJS({ "node_modules/@azure/core-auth/dist/commonjs/tokenCredential.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isBearerToken = isBearerToken; + exports2.isPopToken = isPopToken; exports2.isTokenCredential = isTokenCredential; + function isBearerToken(accessToken) { + return !accessToken.tokenType || accessToken.tokenType === "Bearer"; + } + __name(isBearerToken, "isBearerToken"); + function isPopToken(accessToken) { + return accessToken.tokenType === "pop"; + } + __name(isPopToken, "isPopToken"); function isTokenCredential(credential) { const castCredential = credential; return castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === void 0 || castCredential.getToken.length > 0); @@ -31816,7 +33565,9 @@ var require_disableKeepAlivePolicy = __commonJS({ "node_modules/@azure/core-http-compat/dist/commonjs/policies/disableKeepAlivePolicy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.pipelineContainsDisableKeepAlivePolicy = exports2.createDisableKeepAlivePolicy = exports2.disableKeepAlivePolicyName = void 0; + exports2.disableKeepAlivePolicyName = void 0; + exports2.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy; + exports2.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy; exports2.disableKeepAlivePolicyName = "DisableKeepAlivePolicy"; function createDisableKeepAlivePolicy() { return { @@ -31828,12 +33579,10 @@ var require_disableKeepAlivePolicy = __commonJS({ }; } __name(createDisableKeepAlivePolicy, "createDisableKeepAlivePolicy"); - exports2.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy; function pipelineContainsDisableKeepAlivePolicy(pipeline) { return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); } __name(pipelineContainsDisableKeepAlivePolicy, "pipelineContainsDisableKeepAlivePolicy"); - exports2.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy; } }); @@ -31842,28 +33591,27 @@ var require_base64 = __commonJS({ "node_modules/@azure/core-client/dist/commonjs/base64.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.decodeStringToString = exports2.decodeString = exports2.encodeByteArray = exports2.encodeString = void 0; + exports2.encodeString = encodeString; + exports2.encodeByteArray = encodeByteArray; + exports2.decodeString = decodeString; + exports2.decodeStringToString = decodeStringToString; function encodeString(value) { return Buffer.from(value).toString("base64"); } __name(encodeString, "encodeString"); - exports2.encodeString = encodeString; function encodeByteArray(value) { const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); return bufferValue.toString("base64"); } __name(encodeByteArray, "encodeByteArray"); - exports2.encodeByteArray = encodeByteArray; function decodeString(value) { return Buffer.from(value, "base64"); } __name(decodeString, "decodeString"); - exports2.decodeString = decodeString; function decodeStringToString(value) { return Buffer.from(value, "base64").toString(); } __name(decodeStringToString, "decodeStringToString"); - exports2.decodeStringToString = decodeStringToString; } }); @@ -31883,52 +33631,64 @@ var require_utils3 = __commonJS({ "node_modules/@azure/core-client/dist/commonjs/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.flattenResponse = exports2.isValidUuid = exports2.isDuration = exports2.isPrimitiveBody = void 0; + exports2.isPrimitiveBody = isPrimitiveBody; + exports2.isDuration = isDuration; + exports2.isValidUuid = isValidUuid; + exports2.flattenResponse = flattenResponse; function isPrimitiveBody(value, mapperTypeName) { - return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || (mapperTypeName === null || mapperTypeName === void 0 ? void 0 : mapperTypeName.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)) !== null || value === void 0 || value === null); + return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || mapperTypeName?.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i) !== null || value === void 0 || value === null); } __name(isPrimitiveBody, "isPrimitiveBody"); - exports2.isPrimitiveBody = isPrimitiveBody; var validateISODuration = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; function isDuration(value) { return validateISODuration.test(value); } __name(isDuration, "isDuration"); - exports2.isDuration = isDuration; var 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; function isValidUuid(uuid) { return validUuidRegex.test(uuid); } __name(isValidUuid, "isValidUuid"); - exports2.isValidUuid = isValidUuid; function handleNullableResponseAndWrappableBody(responseObject) { - const combinedHeadersAndBody = Object.assign(Object.assign({}, responseObject.headers), responseObject.body); + const combinedHeadersAndBody = { + ...responseObject.headers, + ...responseObject.body + }; if (responseObject.hasNullableType && Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) { return responseObject.shouldWrapBody ? { body: null } : null; } else { - return responseObject.shouldWrapBody ? Object.assign(Object.assign({}, responseObject.headers), { body: responseObject.body }) : combinedHeadersAndBody; + return responseObject.shouldWrapBody ? { + ...responseObject.headers, + body: responseObject.body + } : combinedHeadersAndBody; } } __name(handleNullableResponseAndWrappableBody, "handleNullableResponseAndWrappableBody"); function flattenResponse(fullResponse, responseSpec) { - var _a, _b; const parsedHeaders = fullResponse.parsedHeaders; if (fullResponse.request.method === "HEAD") { - return Object.assign(Object.assign({}, parsedHeaders), { body: fullResponse.parsedBody }); + return { + ...parsedHeaders, + body: fullResponse.parsedBody + }; } const bodyMapper = responseSpec && responseSpec.bodyMapper; - const isNullable = Boolean(bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.nullable); - const expectedBodyTypeName = bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.type.name; + const isNullable = Boolean(bodyMapper?.nullable); + const expectedBodyTypeName = bodyMapper?.type.name; if (expectedBodyTypeName === "Stream") { - return Object.assign(Object.assign({}, parsedHeaders), { blobBody: fullResponse.blobBody, readableStreamBody: fullResponse.readableStreamBody }); + return { + ...parsedHeaders, + blobBody: fullResponse.blobBody, + readableStreamBody: fullResponse.readableStreamBody + }; } const modelProperties = expectedBodyTypeName === "Composite" && bodyMapper.type.modelProperties || {}; const isPageableResponse = Object.keys(modelProperties).some((k) => modelProperties[k].serializedName === ""); if (expectedBodyTypeName === "Sequence" || isPageableResponse) { - const arrayResponse = (_a = fullResponse.parsedBody) !== null && _a !== void 0 ? _a : []; + const arrayResponse = fullResponse.parsedBody ?? []; for (const key of Object.keys(modelProperties)) { if (modelProperties[key].serializedName) { - arrayResponse[key] = (_b = fullResponse.parsedBody) === null || _b === void 0 ? void 0 : _b[key]; + arrayResponse[key] = fullResponse.parsedBody?.[key]; } } if (parsedHeaders) { @@ -31946,7 +33706,6 @@ var require_utils3 = __commonJS({ }); } __name(flattenResponse, "flattenResponse"); - exports2.flattenResponse = flattenResponse; } }); @@ -31955,7 +33714,8 @@ var require_serializer = __commonJS({ "node_modules/@azure/core-client/dist/commonjs/serializer.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MapperTypeNames = exports2.createSerializer = void 0; + exports2.MapperTypeNames = void 0; + exports2.createSerializer = createSerializer; var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var base64 = tslib_1.__importStar(require_base64()); var interfaces_js_1 = require_interfaces(); @@ -31964,6 +33724,8 @@ var require_serializer = __commonJS({ static { __name(this, "SerializerImpl"); } + modelMappers; + isXML; constructor(modelMappers = {}, isXML = false) { this.modelMappers = modelMappers; this.isXML = isXML; @@ -32029,12 +33791,11 @@ var require_serializer = __commonJS({ * @returns A valid serialized Javascript object */ serialize(mapper, object, objectName, options = { xml: {} }) { - var _a, _b, _c; const updatedOptions = { xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY + rootName: options.xml.rootName ?? "", + includeRoot: options.xml.includeRoot ?? false, + xmlCharKey: options.xml.xmlCharKey ?? interfaces_js_1.XML_CHARKEY } }; let payload = {}; @@ -32098,14 +33859,13 @@ var require_serializer = __commonJS({ * @returns A valid deserialized Javascript object */ deserialize(mapper, responseBody, objectName, options = { xml: {} }) { - var _a, _b, _c, _d; const updatedOptions = { xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY + rootName: options.xml.rootName ?? "", + includeRoot: options.xml.includeRoot ?? false, + xmlCharKey: options.xml.xmlCharKey ?? interfaces_js_1.XML_CHARKEY }, - ignoreUnknownProperties: (_d = options.ignoreUnknownProperties) !== null && _d !== void 0 ? _d : false + ignoreUnknownProperties: options.ignoreUnknownProperties ?? false }; if (responseBody === void 0 || responseBody === null) { if (this.isXML && mapper.type.name === "Sequence" && !mapper.xmlIsWrapped) { @@ -32169,7 +33929,6 @@ var require_serializer = __commonJS({ return new SerializerImpl(modelMappers, isXML); } __name(createSerializer, "createSerializer"); - exports2.createSerializer = createSerializer; function trimEnd(str, ch) { let len = str.length; while (len - 1 >= 0 && str[len - 1] === ch) { @@ -32334,7 +34093,6 @@ var require_serializer = __commonJS({ } __name(serializeDateTypes, "serializeDateTypes"); function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { - var _a; if (!Array.isArray(object)) { throw new Error(`${objectName} must be of type Array.`); } @@ -32343,7 +34101,7 @@ var require_serializer = __commonJS({ throw new Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${objectName}.`); } if (elementType.type.name === "Composite" && elementType.type.className) { - elementType = (_a = serializer.modelMappers[elementType.type.className]) !== null && _a !== void 0 ? _a : elementType; + elementType = serializer.modelMappers[elementType.type.className] ?? elementType; } const tempArray = []; for (let i = 0; i < object.length; i++) { @@ -32351,7 +34109,7 @@ var require_serializer = __commonJS({ if (isXml && elementType.xmlNamespace) { const xmlnsKey = elementType.xmlNamespacePrefix ? `xmlns:${elementType.xmlNamespacePrefix}` : "xmlns"; if (elementType.type.name === "Composite") { - tempArray[i] = Object.assign({}, serializedValue); + tempArray[i] = { ...serializedValue }; tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; } else { tempArray[i] = {}; @@ -32391,7 +34149,7 @@ var require_serializer = __commonJS({ const additionalProperties = mapper.type.additionalProperties; if (!additionalProperties && mapper.type.className) { const modelMapper = resolveReferencedMapper(serializer, mapper, objectName); - return modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; + return modelMapper?.type.additionalProperties; } return additionalProperties; } @@ -32411,7 +34169,7 @@ var require_serializer = __commonJS({ 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; + modelProps = 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}".`); } @@ -32453,7 +34211,10 @@ var require_serializer = __commonJS({ if (parentObject !== void 0 && parentObject !== null) { if (isXml && mapper.xmlNamespace) { const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; - parentObject[interfaces_js_1.XML_ATTRKEY] = Object.assign(Object.assign({}, parentObject[interfaces_js_1.XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace }); + parentObject[interfaces_js_1.XML_ATTRKEY] = { + ...parentObject[interfaces_js_1.XML_ATTRKEY], + [xmlnsKey]: mapper.xmlNamespace + }; } const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; let toSerialize = object[key]; @@ -32500,7 +34261,7 @@ var require_serializer = __commonJS({ if (serializedValue[interfaces_js_1.XML_ATTRKEY]) { return serializedValue; } else { - const result2 = Object.assign({}, serializedValue); + const result2 = { ...serializedValue }; result2[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; return result2; } @@ -32516,8 +34277,7 @@ var require_serializer = __commonJS({ } __name(isSpecialXmlProperty, "isSpecialXmlProperty"); function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { - var _a, _b; - const xmlCharKey = (_a = options.xml.xmlCharKey) !== null && _a !== void 0 ? _a : interfaces_js_1.XML_CHARKEY; + const xmlCharKey = options.xml.xmlCharKey ?? interfaces_js_1.XML_CHARKEY; if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); } @@ -32556,7 +34316,7 @@ var require_serializer = __commonJS({ 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 : []; + const elementList = wrapped?.[xmlElementName] ?? []; instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options); handledPropertyNames.push(xmlName); } else { @@ -32641,7 +34401,6 @@ var require_serializer = __commonJS({ } __name(deserializeDictionaryType, "deserializeDictionaryType"); function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - var _a; let 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}`); @@ -32651,7 +34410,7 @@ var require_serializer = __commonJS({ responseBody = [responseBody]; } if (element.type.name === "Composite" && element.type.className) { - element = (_a = serializer.modelMappers[element.type.className]) !== null && _a !== void 0 ? _a : element; + element = serializer.modelMappers[element.type.className] ?? element; } const tempArray = []; for (let i = 0; i < responseBody.length; i++) { @@ -32681,7 +34440,6 @@ var require_serializer = __commonJS({ } __name(getIndexDiscriminator, "getIndexDiscriminator"); function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { - var _a; const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); if (polymorphicDiscriminator) { let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; @@ -32690,7 +34448,7 @@ var require_serializer = __commonJS({ discriminatorName = discriminatorName.replace(/\\/gi, ""); } const discriminatorValue = object[discriminatorName]; - const typeName = (_a = mapper.type.uberParent) !== null && _a !== void 0 ? _a : mapper.type.className; + const typeName = mapper.type.uberParent ?? mapper.type.className; if (typeof discriminatorValue === "string" && typeName) { const polymorphicMapper = getIndexDiscriminator(serializer.modelMappers.discriminators, discriminatorValue, typeName); if (polymorphicMapper) { @@ -32748,7 +34506,8 @@ var require_operationHelpers = __commonJS({ "node_modules/@azure/core-client/dist/commonjs/operationHelpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOperationRequestInfo = exports2.getOperationArgumentValueFromParameter = void 0; + exports2.getOperationArgumentValueFromParameter = getOperationArgumentValueFromParameter; + exports2.getOperationRequestInfo = getOperationRequestInfo; var state_js_1 = require_state2(); function getOperationArgumentValueFromParameter(operationArguments, parameter, fallbackObject) { let parameterPath = parameter.parameterPath; @@ -32795,7 +34554,6 @@ var require_operationHelpers = __commonJS({ return value; } __name(getOperationArgumentValueFromParameter, "getOperationArgumentValueFromParameter"); - exports2.getOperationArgumentValueFromParameter = getOperationArgumentValueFromParameter; function getPropertyFromParameterPath(parent, parameterPath) { const result = { propertyFound: false }; let i = 0; @@ -32831,7 +34589,6 @@ var require_operationHelpers = __commonJS({ return info; } __name(getOperationRequestInfo, "getOperationRequestInfo"); - exports2.getOperationRequestInfo = getOperationRequestInfo; } }); @@ -32840,7 +34597,8 @@ var require_deserializationPolicy = __commonJS({ "node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.deserializationPolicy = exports2.deserializationPolicyName = void 0; + exports2.deserializationPolicyName = void 0; + exports2.deserializationPolicy = deserializationPolicy; var interfaces_js_1 = require_interfaces(); var core_rest_pipeline_1 = require_commonjs6(); var serializer_js_1 = require_serializer(); @@ -32849,16 +34607,15 @@ var require_deserializationPolicy = __commonJS({ var defaultXmlContentTypes = ["application/xml", "application/atom+xml"]; exports2.deserializationPolicyName = "deserializationPolicy"; function deserializationPolicy(options = {}) { - var _a, _b, _c, _d, _e, _f, _g; - const jsonContentTypes = (_b = (_a = options.expectedContentTypes) === null || _a === void 0 ? void 0 : _a.json) !== null && _b !== void 0 ? _b : defaultJsonContentTypes; - const xmlContentTypes = (_d = (_c = options.expectedContentTypes) === null || _c === void 0 ? void 0 : _c.xml) !== null && _d !== void 0 ? _d : defaultXmlContentTypes; + const jsonContentTypes = options.expectedContentTypes?.json ?? defaultJsonContentTypes; + const xmlContentTypes = options.expectedContentTypes?.xml ?? defaultXmlContentTypes; const parseXML = options.parseXML; const serializerOptions = options.serializerOptions; const updatedOptions = { xml: { - rootName: (_e = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _e !== void 0 ? _e : "", - includeRoot: (_f = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _f !== void 0 ? _f : false, - xmlCharKey: (_g = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _g !== void 0 ? _g : interfaces_js_1.XML_CHARKEY + rootName: serializerOptions?.xml.rootName ?? "", + includeRoot: serializerOptions?.xml.includeRoot ?? false, + xmlCharKey: serializerOptions?.xml.xmlCharKey ?? interfaces_js_1.XML_CHARKEY } }; return { @@ -32870,17 +34627,16 @@ var require_deserializationPolicy = __commonJS({ }; } __name(deserializationPolicy, "deserializationPolicy"); - exports2.deserializationPolicy = deserializationPolicy; function getOperationResponseMap(parsedResponse) { let result; const request = parsedResponse.request; const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; + const operationSpec = operationInfo?.operationSpec; if (operationSpec) { - if (!(operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter)) { + if (!operationInfo?.operationResponseGetter) { result = operationSpec.responses[parsedResponse.status]; } else { - result = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter(operationSpec, parsedResponse); + result = operationInfo?.operationResponseGetter(operationSpec, parsedResponse); } } return result; @@ -32889,7 +34645,7 @@ var require_deserializationPolicy = __commonJS({ function shouldDeserializeResponse(parsedResponse) { const request = parsedResponse.request; const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const shouldDeserialize = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.shouldDeserialize; + const shouldDeserialize = operationInfo?.shouldDeserialize; let result; if (shouldDeserialize === void 0) { result = true; @@ -32902,12 +34658,12 @@ var require_deserializationPolicy = __commonJS({ } __name(shouldDeserializeResponse, "shouldDeserializeResponse"); async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { - const parsedResponse = await parse2(jsonContentTypes, xmlContentTypes, response, options, parseXML); + const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); if (!shouldDeserializeResponse(parsedResponse)) { return parsedResponse; } const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; + const operationSpec = operationInfo?.operationSpec; if (!operationSpec || !operationSpec.responses) { return parsedResponse; } @@ -32950,7 +34706,6 @@ var require_deserializationPolicy = __commonJS({ } __name(isOperationSpecEmpty, "isOperationSpecEmpty"); function handleErrorResponse(parsedResponse, operationSpec, responseSpec, options) { - var _a; const isSuccessByStatus = 200 <= parsedResponse.status && parsedResponse.status < 300; const isExpectedStatusCode = isOperationSpecEmpty(operationSpec) ? isSuccessByStatus : !!responseSpec; if (isExpectedStatusCode) { @@ -32962,18 +34717,18 @@ var require_deserializationPolicy = __commonJS({ return { error: null, shouldReturnResponse: false }; } } - const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; - const initialErrorMessage = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) ? `Unexpected status code: ${parsedResponse.status}` : parsedResponse.bodyAsText; + const errorResponseSpec = responseSpec ?? operationSpec.responses.default; + const initialErrorMessage = parsedResponse.request.streamResponseStatusCodes?.has(parsedResponse.status) ? `Unexpected status code: ${parsedResponse.status}` : parsedResponse.bodyAsText; const error = new core_rest_pipeline_1.RestError(initialErrorMessage, { statusCode: parsedResponse.status, request: parsedResponse.request, response: parsedResponse }); - if (!errorResponseSpec) { + if (!errorResponseSpec && !(parsedResponse.parsedBody?.error?.code && parsedResponse.parsedBody?.error?.message)) { throw error; } - const defaultBodyMapper = errorResponseSpec.bodyMapper; - const defaultHeadersMapper = errorResponseSpec.headersMapper; + const defaultBodyMapper = errorResponseSpec?.bodyMapper; + const defaultHeadersMapper = errorResponseSpec?.headersMapper; try { if (parsedResponse.parsedBody) { const parsedBody = parsedResponse.parsedBody; @@ -33007,9 +34762,8 @@ var require_deserializationPolicy = __commonJS({ return { error, shouldReturnResponse: false }; } __name(handleErrorResponse, "handleErrorResponse"); - async function parse2(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML) { - var _a; - if (!((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(operationResponse.status)) && operationResponse.bodyAsText) { + async function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML) { + if (!operationResponse.request.streamResponseStatusCodes?.has(operationResponse.status) && operationResponse.bodyAsText) { const text = operationResponse.bodyAsText; const contentType = operationResponse.headers.get("Content-Type") || ""; const contentComponents = !contentType ? [] : contentType.split(";").map((component) => component.toLowerCase()); @@ -33039,7 +34793,7 @@ var require_deserializationPolicy = __commonJS({ } return operationResponse; } - __name(parse2, "parse"); + __name(parse, "parse"); } }); @@ -33048,7 +34802,8 @@ var require_interfaceHelpers = __commonJS({ "node_modules/@azure/core-client/dist/commonjs/interfaceHelpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getPathStringFromParameter = exports2.getStreamingResponseStatusCodes = void 0; + exports2.getStreamingResponseStatusCodes = getStreamingResponseStatusCodes; + exports2.getPathStringFromParameter = getPathStringFromParameter; var serializer_js_1 = require_serializer(); function getStreamingResponseStatusCodes(operationSpec) { const result = /* @__PURE__ */ new Set(); @@ -33061,7 +34816,6 @@ var require_interfaceHelpers = __commonJS({ return result; } __name(getStreamingResponseStatusCodes, "getStreamingResponseStatusCodes"); - exports2.getStreamingResponseStatusCodes = getStreamingResponseStatusCodes; function getPathStringFromParameter(parameter) { const { parameterPath, mapper } = parameter; let result; @@ -33075,7 +34829,6 @@ var require_interfaceHelpers = __commonJS({ return result; } __name(getPathStringFromParameter, "getPathStringFromParameter"); - exports2.getPathStringFromParameter = getPathStringFromParameter; } }); @@ -33084,7 +34837,10 @@ var require_serializationPolicy = __commonJS({ "node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.serializeRequestBody = exports2.serializeHeaders = exports2.serializationPolicy = exports2.serializationPolicyName = void 0; + exports2.serializationPolicyName = void 0; + exports2.serializationPolicy = serializationPolicy; + exports2.serializeHeaders = serializeHeaders; + exports2.serializeRequestBody = serializeRequestBody; var interfaces_js_1 = require_interfaces(); var operationHelpers_js_1 = require_operationHelpers(); var serializer_js_1 = require_serializer(); @@ -33096,8 +34852,8 @@ var require_serializationPolicy = __commonJS({ name: exports2.serializationPolicyName, async sendRequest(request, next) { const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - const operationArguments = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationArguments; + const operationSpec = operationInfo?.operationSpec; + const operationArguments = operationInfo?.operationArguments; if (operationSpec && operationArguments) { serializeHeaders(request, operationArguments, operationSpec); serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); @@ -33107,9 +34863,7 @@ var require_serializationPolicy = __commonJS({ }; } __name(serializationPolicy, "serializationPolicy"); - exports2.serializationPolicy = serializationPolicy; function serializeHeaders(request, operationArguments, operationSpec) { - var _a, _b; if (operationSpec.headerParameters) { for (const headerParameter of operationSpec.headerParameters) { let headerValue = (0, operationHelpers_js_1.getOperationArgumentValueFromParameter)(operationArguments, headerParameter); @@ -33126,7 +34880,7 @@ var require_serializationPolicy = __commonJS({ } } } - const customHeaders = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.requestOptions) === null || _b === void 0 ? void 0 : _b.customHeaders; + const customHeaders = operationArguments.options?.requestOptions?.customHeaders; if (customHeaders) { for (const customHeaderName of Object.keys(customHeaders)) { request.headers.set(customHeaderName, customHeaders[customHeaderName]); @@ -33134,17 +34888,15 @@ var require_serializationPolicy = __commonJS({ } } __name(serializeHeaders, "serializeHeaders"); - exports2.serializeHeaders = serializeHeaders; function serializeRequestBody(request, operationArguments, operationSpec, stringifyXML = function() { throw new Error("XML serialization unsupported!"); }) { - var _a, _b, _c, _d, _e; - const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; + const serializerOptions = operationArguments.options?.serializerOptions; const updatedOptions = { xml: { - rootName: (_b = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _b !== void 0 ? _b : "", - includeRoot: (_c = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _c !== void 0 ? _c : false, - xmlCharKey: (_d = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _d !== void 0 ? _d : interfaces_js_1.XML_CHARKEY + rootName: serializerOptions?.xml.rootName ?? "", + includeRoot: serializerOptions?.xml.includeRoot ?? false, + xmlCharKey: serializerOptions?.xml.xmlCharKey ?? interfaces_js_1.XML_CHARKEY } }; const xmlCharKey = updatedOptions.xml.xmlCharKey; @@ -33169,7 +34921,7 @@ var require_serializationPolicy = __commonJS({ xmlCharKey }); } - } else if (typeName === serializer_js_1.MapperTypeNames.String && (((_e = operationSpec.contentType) === null || _e === void 0 ? void 0 : _e.match("text/plain")) || operationSpec.mediaType === "text")) { + } else if (typeName === serializer_js_1.MapperTypeNames.String && (operationSpec.contentType?.match("text/plain") || operationSpec.mediaType === "text")) { return; } else if (!isStream) { request.body = JSON.stringify(request.body); @@ -33190,7 +34942,6 @@ var require_serializationPolicy = __commonJS({ } } __name(serializeRequestBody, "serializeRequestBody"); - exports2.serializeRequestBody = serializeRequestBody; function getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue, options) { if (xmlNamespace && !["Composite", "Sequence", "Dictionary"].includes(typeName)) { const result = {}; @@ -33217,16 +34968,16 @@ var require_serializationPolicy = __commonJS({ }); // node_modules/@azure/core-client/dist/commonjs/pipeline.js -var require_pipeline2 = __commonJS({ +var require_pipeline3 = __commonJS({ "node_modules/@azure/core-client/dist/commonjs/pipeline.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createClientPipeline = void 0; + exports2.createClientPipeline = createClientPipeline; var deserializationPolicy_js_1 = require_deserializationPolicy(); var core_rest_pipeline_1 = require_commonjs6(); var serializationPolicy_js_1 = require_serializationPolicy(); function createClientPipeline(options = {}) { - const pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options !== null && options !== void 0 ? options : {}); + const pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options ?? {}); if (options.credentialOptions) { pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ credential: options.credentialOptions.credential, @@ -33240,7 +34991,6 @@ var require_pipeline2 = __commonJS({ return pipeline; } __name(createClientPipeline, "createClientPipeline"); - exports2.createClientPipeline = createClientPipeline; } }); @@ -33249,7 +34999,7 @@ var require_httpClientCache = __commonJS({ "node_modules/@azure/core-client/dist/commonjs/httpClientCache.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getCachedDefaultHttpClient = void 0; + exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; var core_rest_pipeline_1 = require_commonjs6(); var cachedHttpClient; function getCachedDefaultHttpClient() { @@ -33259,16 +35009,16 @@ var require_httpClientCache = __commonJS({ return cachedHttpClient; } __name(getCachedDefaultHttpClient, "getCachedDefaultHttpClient"); - exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; } }); // node_modules/@azure/core-client/dist/commonjs/urlHelpers.js -var require_urlHelpers = __commonJS({ +var require_urlHelpers2 = __commonJS({ "node_modules/@azure/core-client/dist/commonjs/urlHelpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.appendQueryParams = exports2.getRequestUrl = void 0; + exports2.getRequestUrl = getRequestUrl; + exports2.appendQueryParams = appendQueryParams; var operationHelpers_js_1 = require_operationHelpers(); var interfaceHelpers_js_1 = require_interfaceHelpers(); var CollectionFormatToDelimiterMap = { @@ -33299,7 +35049,6 @@ var require_urlHelpers = __commonJS({ return requestUrl; } __name(getRequestUrl, "getRequestUrl"); - exports2.getRequestUrl = getRequestUrl; function replaceAll(input, replacements) { let result = input; for (const [searchValue, replaceValue] of replacements) { @@ -33309,9 +35058,8 @@ var require_urlHelpers = __commonJS({ } __name(replaceAll, "replaceAll"); function calculateUrlReplacements(operationSpec, operationArguments, fallbackObject) { - var _a; const result = /* @__PURE__ */ new Map(); - if ((_a = operationSpec.urlParameters) === null || _a === void 0 ? void 0 : _a.length) { + if (operationSpec.urlParameters?.length) { for (const urlParameter of operationSpec.urlParameters) { let urlParameterValue = (0, operationHelpers_js_1.getOperationArgumentValueFromParameter)(operationArguments, urlParameter, fallbackObject); const parameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(urlParameter); @@ -33357,10 +35105,9 @@ var require_urlHelpers = __commonJS({ } __name(appendPath, "appendPath"); function calculateQueryParameters(operationSpec, operationArguments, fallbackObject) { - var _a; const result = /* @__PURE__ */ new Map(); const sequenceParams = /* @__PURE__ */ new Set(); - if ((_a = operationSpec.queryParameters) === null || _a === void 0 ? void 0 : _a.length) { + if (operationSpec.queryParameters?.length) { for (const queryParameter of operationSpec.queryParameters) { if (queryParameter.mapper.type.name === "Sequence" && queryParameter.mapper.serializedName) { sequenceParams.add(queryParameter.mapper.serializedName); @@ -33472,17 +35219,16 @@ var require_urlHelpers = __commonJS({ return parsedUrl.toString(); } __name(appendQueryParams, "appendQueryParams"); - exports2.appendQueryParams = appendQueryParams; } }); // node_modules/@azure/core-client/dist/commonjs/log.js -var require_log3 = __commonJS({ +var require_log4 = __commonJS({ "node_modules/@azure/core-client/dist/commonjs/log.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.logger = void 0; - var logger_1 = require_commonjs(); + var logger_1 = require_commonjs2(); exports2.logger = (0, logger_1.createClientLogger)("core-client"); } }); @@ -33494,33 +35240,53 @@ var require_serviceClient = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ServiceClient = void 0; var core_rest_pipeline_1 = require_commonjs6(); - var pipeline_js_1 = require_pipeline2(); + var pipeline_js_1 = require_pipeline3(); var utils_js_1 = require_utils3(); var httpClientCache_js_1 = require_httpClientCache(); var operationHelpers_js_1 = require_operationHelpers(); - var urlHelpers_js_1 = require_urlHelpers(); + var urlHelpers_js_1 = require_urlHelpers2(); var interfaceHelpers_js_1 = require_interfaceHelpers(); - var log_js_1 = require_log3(); + var log_js_1 = require_log4(); var ServiceClient = class { static { __name(this, "ServiceClient"); } + /** + * If specified, this is the base URI that requests will be made against for this ServiceClient. + * If it is not specified, then all OperationSpecs must contain a baseUrl property. + */ + _endpoint; + /** + * The default request content type for the service. + * Used if no requestContentType is present on an OperationSpec. + */ + _requestContentType; + /** + * Set to true if the request is sent over HTTP instead of HTTPS + */ + _allowInsecureConnection; + /** + * The HTTP client that will be used to send requests. + */ + _httpClient; + /** + * The pipeline used by this client to make requests + */ + pipeline; /** * The ServiceClient constructor - * @param credential - The credentials used for authentication with the service. * @param options - The service client options that govern the behavior of the client. */ constructor(options = {}) { - var _a, _b; this._requestContentType = options.requestContentType; - this._endpoint = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri; + this._endpoint = options.endpoint ?? options.baseUri; if (options.baseUri) { log_js_1.logger.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."); } this._allowInsecureConnection = options.allowInsecureConnection; this._httpClient = options.httpClient || (0, httpClientCache_js_1.getCachedDefaultHttpClient)(); this.pipeline = options.pipeline || createDefaultPipeline(options); - if ((_b = options.additionalPolicies) === null || _b === void 0 ? void 0 : _b.length) { + if (options.additionalPolicies?.length) { for (const { policy, position } of options.additionalPolicies) { const afterPhase = position === "perRetry" ? "Sign" : void 0; this.pipeline.addPolicy(policy, { @@ -33594,16 +35360,16 @@ var require_serviceClient = __commonJS({ try { const rawResponse = await this.sendRequest(request); const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); - if (options === null || options === void 0 ? void 0 : options.onResponse) { + if (options?.onResponse) { options.onResponse(rawResponse, flatResponse); } return flatResponse; } catch (error) { - if (typeof error === "object" && (error === null || error === void 0 ? void 0 : error.response)) { + if (typeof error === "object" && error?.response) { const rawResponse = error.response; const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[error.statusCode] || operationSpec.responses["default"]); error.details = flatResponse; - if (options === null || options === void 0 ? void 0 : options.onResponse) { + if (options?.onResponse) { options.onResponse(rawResponse, flatResponse, error); } } @@ -33615,7 +35381,10 @@ var require_serviceClient = __commonJS({ function createDefaultPipeline(options) { const credentialScopes = getCredentialScopes(options); const credentialOptions = options.credential && credentialScopes ? { credentialScopes, credential: options.credential } : void 0; - return (0, pipeline_js_1.createClientPipeline)(Object.assign(Object.assign({}, options), { credentialOptions })); + return (0, pipeline_js_1.createClientPipeline)({ + ...options, + credentialOptions + }); } __name(createDefaultPipeline, "createDefaultPipeline"); function getCredentialScopes(options) { @@ -33642,19 +35411,19 @@ var require_authorizeRequestOnClaimChallenge = __commonJS({ "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.authorizeRequestOnClaimChallenge = exports2.parseCAEChallenge = void 0; - var log_js_1 = require_log3(); + exports2.parseCAEChallenge = parseCAEChallenge; + exports2.authorizeRequestOnClaimChallenge = authorizeRequestOnClaimChallenge; + var log_js_1 = require_log4(); var base64_js_1 = require_base64(); function parseCAEChallenge(challenges) { const bearerChallenges = `, ${challenges.trim()}`.split(", Bearer ").filter((x) => x); return bearerChallenges.map((challenge) => { const challengeParts = `${challenge.trim()}, `.split('", ').filter((x) => x); const keyValuePairs = challengeParts.map((keyValue) => (([key, value]) => ({ [key]: value }))(keyValue.trim().split('="'))); - return keyValuePairs.reduce((a, b) => Object.assign(Object.assign({}, a), b), {}); + return keyValuePairs.reduce((a, b) => ({ ...a, ...b }), {}); }); } __name(parseCAEChallenge, "parseCAEChallenge"); - exports2.parseCAEChallenge = parseCAEChallenge; async function authorizeRequestOnClaimChallenge(onChallengeOptions) { const { scopes, response } = onChallengeOptions; const logger = onChallengeOptions.logger || log_js_1.logger; @@ -33675,11 +35444,10 @@ var require_authorizeRequestOnClaimChallenge = __commonJS({ if (!accessToken) { return false; } - onChallengeOptions.request.headers.set("Authorization", `Bearer ${accessToken.token}`); + onChallengeOptions.request.headers.set("Authorization", `${accessToken.tokenType ?? "Bearer"} ${accessToken.token}`); return true; } __name(authorizeRequestOnClaimChallenge, "authorizeRequestOnClaimChallenge"); - exports2.authorizeRequestOnClaimChallenge = authorizeRequestOnClaimChallenge; } }); @@ -33715,11 +35483,14 @@ var require_authorizeRequestOnTenantChallenge = __commonJS({ if (!tenantId) { return false; } - const accessToken = await challengeOptions.getAccessToken(challengeScopes, Object.assign(Object.assign({}, requestOptions), { tenantId })); + const accessToken = await challengeOptions.getAccessToken(challengeScopes, { + ...requestOptions, + tenantId + }); if (!accessToken) { return false; } - challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${accessToken.token}`); + challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `${accessToken.tokenType ?? "Bearer"} ${accessToken.token}`); return true; } return false; @@ -33760,7 +35531,7 @@ var require_authorizeRequestOnTenantChallenge = __commonJS({ const bearerChallenge = challenge.slice("Bearer ".length); const challengeParts = `${bearerChallenge.trim()} `.split(" ").filter((x) => x); const keyValuePairs = challengeParts.map((keyValue) => (([key, value]) => ({ [key]: value }))(keyValue.trim().split("="))); - return keyValuePairs.reduce((a, b) => Object.assign(Object.assign({}, a), b), {}); + return keyValuePairs.reduce((a, b) => ({ ...a, ...b }), {}); } __name(parseChallenge, "parseChallenge"); function requestToOptions(request) { @@ -33793,7 +35564,7 @@ var require_commonjs8 = __commonJS({ Object.defineProperty(exports2, "ServiceClient", { enumerable: true, get: function() { return serviceClient_js_1.ServiceClient; } }); - var pipeline_js_1 = require_pipeline2(); + var pipeline_js_1 = require_pipeline3(); Object.defineProperty(exports2, "createClientPipeline", { enumerable: true, get: function() { return pipeline_js_1.createClientPipeline; } }); @@ -33834,7 +35605,10 @@ var require_util8 = __commonJS({ "node_modules/@azure/core-http-compat/dist/commonjs/util.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpHeaders = exports2.toHttpHeadersLike = exports2.toWebResourceLike = exports2.toPipelineRequest = void 0; + exports2.HttpHeaders = void 0; + exports2.toPipelineRequest = toPipelineRequest; + exports2.toWebResourceLike = toWebResourceLike; + exports2.toHttpHeadersLike = toHttpHeadersLike; var core_rest_pipeline_1 = require_commonjs6(); var originalRequestSymbol = Symbol("Original PipelineRequest"); var originalClientRequestSymbol = Symbol.for("@azure/core-client original request"); @@ -33860,7 +35634,9 @@ var require_util8 = __commonJS({ onDownloadProgress: webResource.onDownloadProgress, onUploadProgress: webResource.onUploadProgress, proxySettings: webResource.proxySettings, - streamResponseStatusCodes: webResource.streamResponseStatusCodes + streamResponseStatusCodes: webResource.streamResponseStatusCodes, + agent: webResource.agent, + requestOverrides: webResource.requestOverrides }); if (options.originalRequest) { newRequest[originalClientRequestSymbol] = options.originalRequest; @@ -33869,10 +35645,8 @@ var require_util8 = __commonJS({ } } __name(toPipelineRequest, "toPipelineRequest"); - exports2.toPipelineRequest = toPipelineRequest; function toWebResourceLike(request, options) { - var _a; - const originalRequest = (_a = options === null || options === void 0 ? void 0 : options.originalRequest) !== null && _a !== void 0 ? _a : request; + const originalRequest = options?.originalRequest ?? request; const webResource = { url: request.url, method: request.method, @@ -33888,6 +35662,8 @@ var require_util8 = __commonJS({ onUploadProgress: request.onUploadProgress, proxySettings: request.proxySettings, streamResponseStatusCodes: request.streamResponseStatusCodes, + agent: request.agent, + requestOverrides: request.requestOverrides, clone() { throw new Error("Cannot clone a non-proxied WebResourceLike"); }, @@ -33897,7 +35673,7 @@ var require_util8 = __commonJS({ validateRequestProperties() { } }; - if (options === null || options === void 0 ? void 0 : options.createProxy) { + if (options?.createProxy) { return new Proxy(webResource, { get(target, prop, receiver) { if (prop === originalRequestSymbol) { @@ -33928,7 +35704,9 @@ var require_util8 = __commonJS({ "onDownloadProgress", "onUploadProgress", "proxySettings", - "streamResponseStatusCodes" + "streamResponseStatusCodes", + "agent", + "requestOverrides" ]; if (typeof prop === "string" && passThroughProps.includes(prop)) { request[prop] = value; @@ -33941,12 +35719,10 @@ var require_util8 = __commonJS({ } } __name(toWebResourceLike, "toWebResourceLike"); - exports2.toWebResourceLike = toWebResourceLike; function toHttpHeadersLike(headers) { return new HttpHeaders(headers.toJSON({ preserveCase: true })); } __name(toHttpHeadersLike, "toHttpHeadersLike"); - exports2.toHttpHeadersLike = toHttpHeadersLike; function getHeaderKey(headerName) { return headerName.toLowerCase(); } @@ -33955,6 +35731,7 @@ var require_util8 = __commonJS({ static { __name(this, "HttpHeaders"); } + _headersMap; constructor(rawHeaders) { this._headersMap = {}; if (rawHeaders) { @@ -34083,14 +35860,15 @@ var require_response2 = __commonJS({ "node_modules/@azure/core-http-compat/dist/commonjs/response.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toPipelineResponse = exports2.toCompatResponse = void 0; + exports2.toCompatResponse = toCompatResponse; + exports2.toPipelineResponse = toPipelineResponse; var core_rest_pipeline_1 = require_commonjs6(); var util_js_1 = require_util8(); var originalResponse = Symbol("Original FullOperationResponse"); function toCompatResponse(response, options) { let request = (0, util_js_1.toWebResourceLike)(response.request); let headers = (0, util_js_1.toHttpHeadersLike)(response.headers); - if (options === null || options === void 0 ? void 0 : options.createProxy) { + if (options?.createProxy) { return new Proxy(response, { get(target, prop, receiver) { if (prop === "headers") { @@ -34112,14 +35890,14 @@ var require_response2 = __commonJS({ } }); } else { - return Object.assign(Object.assign({}, response), { + return { + ...response, request, headers - }); + }; } } __name(toCompatResponse, "toCompatResponse"); - exports2.toCompatResponse = toCompatResponse; function toPipelineResponse(compatResponse) { const extendedCompatResponse = compatResponse; const response = extendedCompatResponse[originalResponse]; @@ -34128,11 +35906,14 @@ var require_response2 = __commonJS({ response.headers = headers; return response; } else { - return Object.assign(Object.assign({}, compatResponse), { headers, request: (0, util_js_1.toPipelineRequest)(compatResponse.request) }); + return { + ...compatResponse, + headers, + request: (0, util_js_1.toPipelineRequest)(compatResponse.request) + }; } } __name(toPipelineResponse, "toPipelineResponse"); - exports2.toPipelineResponse = toPipelineResponse; } }); @@ -34151,12 +35932,11 @@ var require_extendedClient = __commonJS({ __name(this, "ExtendedServiceClient"); } constructor(options) { - var _a, _b; super(options); - if (((_a = options.keepAliveOptions) === null || _a === void 0 ? void 0 : _a.enable) === false && !(0, disableKeepAlivePolicy_js_1.pipelineContainsDisableKeepAlivePolicy)(this.pipeline)) { + if (options.keepAliveOptions?.enable === false && !(0, disableKeepAlivePolicy_js_1.pipelineContainsDisableKeepAlivePolicy)(this.pipeline)) { this.pipeline.addPolicy((0, disableKeepAlivePolicy_js_1.createDisableKeepAlivePolicy)()); } - if (((_b = options.redirectOptions) === null || _b === void 0 ? void 0 : _b.handleRedirects) === false) { + if (options.redirectOptions?.handleRedirects === false) { this.pipeline.removePolicy({ name: core_rest_pipeline_1.redirectPolicyName }); @@ -34170,8 +35950,7 @@ var require_extendedClient = __commonJS({ * @returns */ async sendOperationRequest(operationArguments, operationSpec) { - var _a; - const userProvidedCallBack = (_a = operationArguments === null || operationArguments === void 0 ? void 0 : operationArguments.options) === null || _a === void 0 ? void 0 : _a.onResponse; + const userProvidedCallBack = operationArguments?.options?.onResponse; let lastResponse; function onResponse(rawResponse, flatResponse, error) { lastResponse = rawResponse; @@ -34180,7 +35959,10 @@ var require_extendedClient = __commonJS({ } } __name(onResponse, "onResponse"); - operationArguments.options = Object.assign(Object.assign({}, operationArguments.options), { onResponse }); + operationArguments.options = { + ...operationArguments.options, + onResponse + }; const result = await super.sendOperationRequest(operationArguments, operationSpec); if (lastResponse) { Object.defineProperty(result, "_response", { @@ -34199,7 +35981,8 @@ var require_requestPolicyFactoryPolicy = __commonJS({ "node_modules/@azure/core-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createRequestPolicyFactoryPolicy = exports2.requestPolicyFactoryPolicyName = exports2.HttpPipelineLogLevel = void 0; + exports2.requestPolicyFactoryPolicyName = exports2.HttpPipelineLogLevel = void 0; + exports2.createRequestPolicyFactoryPolicy = createRequestPolicyFactoryPolicy; var util_js_1 = require_util8(); var response_js_1 = require_response2(); var HttpPipelineLogLevel; @@ -34238,7 +36021,6 @@ var require_requestPolicyFactoryPolicy = __commonJS({ }; } __name(createRequestPolicyFactoryPolicy, "createRequestPolicyFactoryPolicy"); - exports2.createRequestPolicyFactoryPolicy = createRequestPolicyFactoryPolicy; } }); @@ -34247,7 +36029,7 @@ var require_httpClientAdapter = __commonJS({ "node_modules/@azure/core-http-compat/dist/commonjs/httpClientAdapter.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.convertHttpClient = void 0; + exports2.convertHttpClient = convertHttpClient; var response_js_1 = require_response2(); var util_js_1 = require_util8(); function convertHttpClient(requestPolicyClient) { @@ -34259,7 +36041,6 @@ var require_httpClientAdapter = __commonJS({ }; } __name(convertHttpClient, "convertHttpClient"); - exports2.convertHttpClient = convertHttpClient; } }); @@ -34298,1813 +36079,1045 @@ var require_commonjs9 = __commonJS({ } }); -// node_modules/fast-xml-parser/src/util.js -var require_util9 = __commonJS({ - "node_modules/fast-xml-parser/src/util.js"(exports2) { - "use strict"; - var nameStartChar = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; - var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; - var regexName = new RegExp("^" + nameRegexp + "$"); - var getAllMatches = /* @__PURE__ */ __name(function(string, regex) { - const matches = []; - let match = regex.exec(string); - while (match) { - const allmatches = []; - allmatches.startIndex = regex.lastIndex - match[0].length; - const len = match.length; - for (let index = 0; index < len; index++) { - allmatches.push(match[index]); - } - matches.push(allmatches); - match = regex.exec(string); - } - return matches; - }, "getAllMatches"); - var isName = /* @__PURE__ */ __name(function(string) { - const match = regexName.exec(string); - return !(match === null || typeof match === "undefined"); - }, "isName"); - exports2.isExist = function(v) { - return typeof v !== "undefined"; - }; - exports2.isEmptyObject = function(obj) { - return Object.keys(obj).length === 0; - }; - exports2.merge = function(target, a, arrayMode) { - if (a) { - const keys = Object.keys(a); - const len = keys.length; - for (let i = 0; i < len; i++) { - if (arrayMode === "strict") { - target[keys[i]] = [a[keys[i]]]; - } else { - target[keys[i]] = a[keys[i]]; - } - } - } - }; - exports2.getValue = function(v) { - if (exports2.isExist(v)) { - return v; - } else { - return ""; - } - }; - exports2.isName = isName; - exports2.getAllMatches = getAllMatches; - exports2.nameRegexp = nameRegexp; - } -}); - -// node_modules/fast-xml-parser/src/validator.js -var require_validator = __commonJS({ - "node_modules/fast-xml-parser/src/validator.js"(exports2) { - "use strict"; - var util = require_util9(); - var defaultOptions = { - allowBooleanAttributes: false, - //A tag can have attributes without any value - unpairedTags: [] - }; - exports2.validate = function(xmlData, options) { - options = Object.assign({}, defaultOptions, options); - const tags = []; - let tagFound = false; - let reachedRoot = false; - if (xmlData[0] === "\uFEFF") { - xmlData = xmlData.substr(1); - } - for (let i = 0; i < xmlData.length; i++) { - if (xmlData[i] === "<" && xmlData[i + 1] === "?") { - i += 2; - i = readPI(xmlData, i); - if (i.err) - return i; - } else if (xmlData[i] === "<") { - let tagStartPos = i; - i++; - if (xmlData[i] === "!") { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - let closingTag = false; - if (xmlData[i] === "/") { - closingTag = true; - i++; - } - let tagName = ""; - for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) { - tagName += xmlData[i]; - } - tagName = tagName.trim(); - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substring(0, tagName.length - 1); - i--; - } - if (!validateTagName(tagName)) { - let msg; - if (tagName.trim().length === 0) { - msg = "Invalid space after '<'."; - } else { - msg = "Tag '" + tagName + "' is an invalid name."; - } - return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i)); - } - const result = readAttributeStr(xmlData, i); - if (result === false) { - return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i)); - } - let attrStr = result.value; - i = result.index; - if (attrStr[attrStr.length - 1] === "/") { - const attrStrStart = i - attrStr.length; - attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid = validateAttributeString(attrStr, options); - if (isValid === true) { - tagFound = true; - } else { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); - } - } else if (closingTag) { - if (!result.tagClosed) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); - } else if (attrStr.trim().length > 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); - } else if (tags.length === 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); - } else { - const otg = tags.pop(); - if (tagName !== otg.tagName) { - let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); - return getErrorObject( - "InvalidTag", - "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", - getLineNumberForPosition(xmlData, tagStartPos) - ); - } - if (tags.length == 0) { - reachedRoot = true; - } - } - } else { - const isValid = validateAttributeString(attrStr, options); - if (isValid !== true) { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); - } - if (reachedRoot === true) { - return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i)); - } else if (options.unpairedTags.indexOf(tagName) !== -1) { - } else { - tags.push({ tagName, tagStartPos }); - } - tagFound = true; - } - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "!") { - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else if (xmlData[i + 1] === "?") { - i = readPI(xmlData, ++i); - if (i.err) - return i; - } else { - break; - } - } else if (xmlData[i] === "&") { - const afterAmp = validateAmpersand(xmlData, i); - if (afterAmp == -1) - return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); - i = afterAmp; - } else { - if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { - return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i)); - } - } - } - if (xmlData[i] === "<") { - i--; - } - } - } else { - if (isWhiteSpace(xmlData[i])) { - continue; - } - return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i)); - } - } - if (!tagFound) { - return getErrorObject("InvalidXml", "Start tag expected.", 1); - } else if (tags.length == 1) { - return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); - } else if (tags.length > 0) { - return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); - } - return true; - }; - function isWhiteSpace(char) { - return char === " " || char === " " || char === "\n" || char === "\r"; - } - __name(isWhiteSpace, "isWhiteSpace"); - function readPI(xmlData, i) { - const start = i; - for (; i < xmlData.length; i++) { - if (xmlData[i] == "?" || xmlData[i] == " ") { - const tagname = xmlData.substr(start, i - start); - if (i > 5 && tagname === "xml") { - return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i)); - } else if (xmlData[i] == "?" && xmlData[i + 1] == ">") { - i++; - break; - } else { - continue; - } - } - } - return i; - } - __name(readPI, "readPI"); - function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") { - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") { - let angleBracketsCount = 1; - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - angleBracketsCount++; - } else if (xmlData[i] === ">") { - angleBracketsCount--; - if (angleBracketsCount === 0) { - break; - } - } - } - } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } - return i; - } - __name(readCommentAndCDATA, "readCommentAndCDATA"); - var doubleQuote = '"'; - var singleQuote = "'"; - function readAttributeStr(xmlData, i) { - let attrStr = ""; - let startChar = ""; - let tagClosed = false; - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === "") { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) { - } else { - startChar = ""; - } - } else if (xmlData[i] === ">") { - if (startChar === "") { - tagClosed = true; - break; - } - } - attrStr += xmlData[i]; - } - if (startChar !== "") { - return false; - } - return { - value: attrStr, - index: i, - tagClosed - }; - } - __name(readAttributeStr, "readAttributeStr"); - var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); - function validateAttributeString(attrStr, options) { - const matches = util.getAllMatches(attrStr, validAttrStrRegxp); - const attrNames = {}; - for (let i = 0; i < matches.length; i++) { - if (matches[i][1].length === 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) { - return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i])); - } - const attrName = matches[i][2]; - if (!validateAttrName(attrName)) { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i])); - } - if (!attrNames.hasOwnProperty(attrName)) { - attrNames[attrName] = 1; - } else { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i])); - } - } - return true; - } - __name(validateAttributeString, "validateAttributeString"); - function validateNumberAmpersand(xmlData, i) { - let re = /\d/; - if (xmlData[i] === "x") { - i++; - re = /[\da-fA-F]/; - } - for (; i < xmlData.length; i++) { - if (xmlData[i] === ";") - return i; - if (!xmlData[i].match(re)) - break; - } - return -1; - } - __name(validateNumberAmpersand, "validateNumberAmpersand"); - function validateAmpersand(xmlData, i) { - i++; - if (xmlData[i] === ";") - return -1; - if (xmlData[i] === "#") { - i++; - return validateNumberAmpersand(xmlData, i); - } - let count = 0; - for (; i < xmlData.length; i++, count++) { - if (xmlData[i].match(/\w/) && count < 20) - continue; - if (xmlData[i] === ";") - break; - return -1; - } - return i; - } - __name(validateAmpersand, "validateAmpersand"); - function getErrorObject(code, message, lineNumber) { - return { - err: { - code, - msg: message, - line: lineNumber.line || lineNumber, - col: lineNumber.col - } - }; - } - __name(getErrorObject, "getErrorObject"); - function validateAttrName(attrName) { - return util.isName(attrName); - } - __name(validateAttrName, "validateAttrName"); - function validateTagName(tagname) { - return util.isName(tagname); - } - __name(validateTagName, "validateTagName"); - function getLineNumberForPosition(xmlData, index) { - const lines = xmlData.substring(0, index).split(/\r?\n/); - return { - line: lines.length, - // column number is last line's length + 1, because column numbering starts at 1: - col: lines[lines.length - 1].length + 1 - }; - } - __name(getLineNumberForPosition, "getLineNumberForPosition"); - function getPositionFromMatch(match) { - return match.startIndex + match[1].length; - } - __name(getPositionFromMatch, "getPositionFromMatch"); - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js -var require_OptionsBuilder = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports2) { - var defaultOptions = { - preserveOrder: false, - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - removeNSPrefix: false, - // remove NS from tag name or attribute name if true - allowBooleanAttributes: false, - //a tag can have attributes without any value - //ignoreRootElement : false, - parseTagValue: true, - parseAttributeValue: false, - trimValues: true, - //Trim string values of tag and attributes - cdataPropName: false, - numberParseOptions: { - hex: true, - leadingZeros: true, - eNotation: true - }, - tagValueProcessor: function(tagName, val2) { - return val2; - }, - attributeValueProcessor: function(attrName, val2) { - return val2; - }, - stopNodes: [], - //nested tags will not be parsed even for errors - alwaysCreateTextNode: false, - isArray: () => false, - commentPropName: false, - unpairedTags: [], - processEntities: true, - htmlEntities: false, - ignoreDeclaration: false, - ignorePiTags: false, - transformTagName: false, - transformAttributeName: false, - updateTag: function(tagName, jPath, attrs) { - return tagName; - } - // skipEmptyListItem: false - }; - var buildOptions = /* @__PURE__ */ __name(function(options) { - return Object.assign({}, defaultOptions, options); - }, "buildOptions"); - exports2.buildOptions = buildOptions; - exports2.defaultOptions = defaultOptions; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/xmlNode.js -var require_xmlNode = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports2, module2) { - "use strict"; - var XmlNode = class { - static { - __name(this, "XmlNode"); - } - constructor(tagname) { - this.tagname = tagname; - this.child = []; - this[":@"] = {}; - } - add(key, val2) { - if (key === "__proto__") - key = "#__proto__"; - this.child.push({ [key]: val2 }); - } - addChild(node) { - if (node.tagname === "__proto__") - node.tagname = "#__proto__"; - if (node[":@"] && Object.keys(node[":@"]).length > 0) { - this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); - } else { - this.child.push({ [node.tagname]: node.child }); - } - } - }; - module2.exports = XmlNode; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js -var require_DocTypeReader = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports2, module2) { - var util = require_util9(); - function readDocType(xmlData, i) { - const entities = {}; - if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") { - i = i + 9; - let angleBracketsCount = 1; - let hasBody = false, comment = false; - let exp = ""; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<" && !comment) { - if (hasBody && isEntity(xmlData, i)) { - i += 7; - [entityName, val, i] = readEntityExp(xmlData, i + 1); - if (val.indexOf("&") === -1) - entities[validateEntityName(entityName)] = { - regx: RegExp(`&${entityName};`, "g"), - val - }; - } else if (hasBody && isElement(xmlData, i)) - i += 8; - else if (hasBody && isAttlist(xmlData, i)) - i += 8; - else if (hasBody && isNotation(xmlData, i)) - i += 9; - else if (isComment) - comment = true; - else - throw new Error("Invalid DOCTYPE"); - angleBracketsCount++; - exp = ""; - } else if (xmlData[i] === ">") { - if (comment) { - if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") { - comment = false; - angleBracketsCount--; - } - } else { - angleBracketsCount--; - } - if (angleBracketsCount === 0) { - break; - } - } else if (xmlData[i] === "[") { - hasBody = true; - } else { - exp += xmlData[i]; - } - } - if (angleBracketsCount !== 0) { - throw new Error(`Unclosed DOCTYPE`); - } - } else { - throw new Error(`Invalid Tag instead of DOCTYPE`); - } - return { entities, i }; - } - __name(readDocType, "readDocType"); - function readEntityExp(xmlData, i) { - let entityName2 = ""; - for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) { - entityName2 += xmlData[i]; - } - entityName2 = entityName2.trim(); - if (entityName2.indexOf(" ") !== -1) - throw new Error("External entites are not supported"); - const startChar = xmlData[i++]; - let val2 = ""; - for (; i < xmlData.length && xmlData[i] !== startChar; i++) { - val2 += xmlData[i]; - } - return [entityName2, val2, i]; - } - __name(readEntityExp, "readEntityExp"); - function isComment(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") - return true; - return false; - } - __name(isComment, "isComment"); - function isEntity(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "N" && xmlData[i + 4] === "T" && xmlData[i + 5] === "I" && xmlData[i + 6] === "T" && xmlData[i + 7] === "Y") - return true; - return false; - } - __name(isEntity, "isEntity"); - function isElement(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "L" && xmlData[i + 4] === "E" && xmlData[i + 5] === "M" && xmlData[i + 6] === "E" && xmlData[i + 7] === "N" && xmlData[i + 8] === "T") - return true; - return false; - } - __name(isElement, "isElement"); - function isAttlist(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "A" && xmlData[i + 3] === "T" && xmlData[i + 4] === "T" && xmlData[i + 5] === "L" && xmlData[i + 6] === "I" && xmlData[i + 7] === "S" && xmlData[i + 8] === "T") - return true; - return false; - } - __name(isAttlist, "isAttlist"); - function isNotation(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "N" && xmlData[i + 3] === "O" && xmlData[i + 4] === "T" && xmlData[i + 5] === "A" && xmlData[i + 6] === "T" && xmlData[i + 7] === "I" && xmlData[i + 8] === "O" && xmlData[i + 9] === "N") - return true; - return false; - } - __name(isNotation, "isNotation"); - function validateEntityName(name) { - if (util.isName(name)) - return name; - else - throw new Error(`Invalid entity name ${name}`); - } - __name(validateEntityName, "validateEntityName"); - module2.exports = readDocType; - } -}); - -// node_modules/strnum/strnum.js -var require_strnum = __commonJS({ - "node_modules/strnum/strnum.js"(exports2, module2) { - var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; - var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; - if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; - } - if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; - } - var consider = { - hex: true, - leadingZeros: true, - decimalPoint: ".", - eNotation: true - //skipLike: /regex/ - }; - function toNumber(str, options = {}) { - options = Object.assign({}, consider, options); - if (!str || typeof str !== "string") - return str; - let trimmedStr = str.trim(); - if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) - return str; - else if (options.hex && hexRegex.test(trimmedStr)) { - return Number.parseInt(trimmedStr, 16); - } else { - const match = numRegex.exec(trimmedStr); - if (match) { - const sign = match[1]; - const leadingZeros = match[2]; - let numTrimmedByZeros = trimZeros(match[3]); - const eNotation = match[4] || match[6]; - if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") - return str; - else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") - return str; - else { - const num = Number(trimmedStr); - const numStr = "" + num; - if (numStr.search(/[eE]/) !== -1) { - if (options.eNotation) - return num; - else - return str; - } else if (eNotation) { - if (options.eNotation) - return num; - else - return str; - } else if (trimmedStr.indexOf(".") !== -1) { - if (numStr === "0" && numTrimmedByZeros === "") - return num; - else if (numStr === numTrimmedByZeros) - return num; - else if (sign && numStr === "-" + numTrimmedByZeros) - return num; - else - return str; - } - if (leadingZeros) { - if (numTrimmedByZeros === numStr) - return num; - else if (sign + numTrimmedByZeros === numStr) - return num; - else - return str; - } - if (trimmedStr === numStr) - return num; - else if (trimmedStr === sign + numStr) - return num; - return str; - } - } else { - return str; - } - } - } - __name(toNumber, "toNumber"); - function trimZeros(numStr) { - if (numStr && numStr.indexOf(".") !== -1) { - numStr = numStr.replace(/0+$/, ""); - if (numStr === ".") - numStr = "0"; - else if (numStr[0] === ".") - numStr = "0" + numStr; - else if (numStr[numStr.length - 1] === ".") - numStr = numStr.substr(0, numStr.length - 1); - return numStr; - } - return numStr; - } - __name(trimZeros, "trimZeros"); - module2.exports = toNumber; - } -}); - -// node_modules/fast-xml-parser/src/ignoreAttributes.js -var require_ignoreAttributes = __commonJS({ - "node_modules/fast-xml-parser/src/ignoreAttributes.js"(exports2, module2) { - function getIgnoreAttributesFn(ignoreAttributes) { - if (typeof ignoreAttributes === "function") { - return ignoreAttributes; - } - if (Array.isArray(ignoreAttributes)) { - return (attrName) => { - for (const pattern of ignoreAttributes) { - if (typeof pattern === "string" && attrName === pattern) { - return true; - } - if (pattern instanceof RegExp && pattern.test(attrName)) { - return true; - } - } - }; - } - return () => false; - } - __name(getIgnoreAttributesFn, "getIgnoreAttributesFn"); - module2.exports = getIgnoreAttributesFn; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js -var require_OrderedObjParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports2, module2) { - "use strict"; - var util = require_util9(); - var xmlNode = require_xmlNode(); - var readDocType = require_DocTypeReader(); - var toNumber = require_strnum(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var OrderedObjParser = class { - static { - __name(this, "OrderedObjParser"); - } - constructor(options) { - this.options = options; - this.currentNode = null; - this.tagsNodeStack = []; - this.docTypeEntities = {}; - this.lastEntities = { - "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, - "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, - "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, - "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } - }; - this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; - this.htmlEntities = { - "space": { regex: /&(nbsp|#160);/g, val: " " }, - // "lt" : { regex: /&(lt|#60);/g, val: "<" }, - // "gt" : { regex: /&(gt|#62);/g, val: ">" }, - // "amp" : { regex: /&(amp|#38);/g, val: "&" }, - // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, - // "apos" : { regex: /&(apos|#39);/g, val: "'" }, - "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, - "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, - "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, - "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, - "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, - "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, - "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, - "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_, str) => String.fromCharCode(Number.parseInt(str, 10)) }, - "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str) => String.fromCharCode(Number.parseInt(str, 16)) } - }; - this.addExternalEntities = addExternalEntities; - this.parseXml = parseXml; - this.parseTextData = parseTextData; - this.resolveNameSpace = resolveNameSpace; - this.buildAttributesMap = buildAttributesMap; - this.isItStopNode = isItStopNode; - this.replaceEntitiesValue = replaceEntitiesValue; - this.readStopNodeData = readStopNodeData; - this.saveTextToParentTag = saveTextToParentTag; - this.addChild = addChild; - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - } - }; - function addExternalEntities(externalEntities) { - const entKeys = Object.keys(externalEntities); - for (let i = 0; i < entKeys.length; i++) { - const ent = entKeys[i]; - this.lastEntities[ent] = { - regex: new RegExp("&" + ent + ";", "g"), - val: externalEntities[ent] - }; - } - } - __name(addExternalEntities, "addExternalEntities"); - function parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { - if (val2 !== void 0) { - if (this.options.trimValues && !dontTrim) { - val2 = val2.trim(); - } - if (val2.length > 0) { - if (!escapeEntities) - val2 = this.replaceEntitiesValue(val2); - const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode); - if (newval === null || newval === void 0) { - return val2; - } else if (typeof newval !== typeof val2 || newval !== val2) { - return newval; - } else if (this.options.trimValues) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - const trimmedVal = val2.trim(); - if (trimmedVal === val2) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - return val2; - } - } - } - } - } - __name(parseTextData, "parseTextData"); - function resolveNameSpace(tagname) { - if (this.options.removeNSPrefix) { - const tags = tagname.split(":"); - const prefix = tagname.charAt(0) === "/" ? "/" : ""; - if (tags[0] === "xmlns") { - return ""; - } - if (tags.length === 2) { - tagname = prefix + tags[1]; - } - } - return tagname; - } - __name(resolveNameSpace, "resolveNameSpace"); - var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); - function buildAttributesMap(attrStr, jPath, tagName) { - if (this.options.ignoreAttributes !== true && typeof attrStr === "string") { - const matches = util.getAllMatches(attrStr, attrsRegx); - const len = matches.length; - const attrs = {}; - for (let i = 0; i < len; i++) { - const attrName = this.resolveNameSpace(matches[i][1]); - if (this.ignoreAttributesFn(attrName, jPath)) { - continue; - } - let oldVal = matches[i][4]; - let aName = this.options.attributeNamePrefix + attrName; - if (attrName.length) { - if (this.options.transformAttributeName) { - aName = this.options.transformAttributeName(aName); - } - if (aName === "__proto__") - aName = "#__proto__"; - if (oldVal !== void 0) { - if (this.options.trimValues) { - oldVal = oldVal.trim(); - } - oldVal = this.replaceEntitiesValue(oldVal); - const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); - if (newVal === null || newVal === void 0) { - attrs[aName] = oldVal; - } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { - attrs[aName] = newVal; - } else { - attrs[aName] = parseValue( - oldVal, - this.options.parseAttributeValue, - this.options.numberParseOptions - ); - } - } else if (this.options.allowBooleanAttributes) { - attrs[aName] = true; - } - } - } - if (!Object.keys(attrs).length) { - return; - } - if (this.options.attributesGroupName) { - const attrCollection = {}; - attrCollection[this.options.attributesGroupName] = attrs; - return attrCollection; - } - return attrs; - } - } - __name(buildAttributesMap, "buildAttributesMap"); - var parseXml = /* @__PURE__ */ __name(function(xmlData) { - xmlData = xmlData.replace(/\r\n?/g, "\n"); - const xmlObj = new xmlNode("!xml"); - let currentNode = xmlObj; - let textData = ""; - let jPath = ""; - for (let i = 0; i < xmlData.length; i++) { - const ch = xmlData[i]; - if (ch === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."); - let tagName = xmlData.substring(i + 2, closeIndex).trim(); - if (this.options.removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - } - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode) { - textData = this.saveTextToParentTag(textData, currentNode, jPath); - } - const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); - if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { - throw new Error(`Unpaired tag can not be used as closing tag: `); - } - let propIndex = 0; - if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { - propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); - this.tagsNodeStack.pop(); - } else { - propIndex = jPath.lastIndexOf("."); - } - jPath = jPath.substring(0, propIndex); - currentNode = this.tagsNodeStack.pop(); - textData = ""; - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - let tagData = readTagExp(xmlData, i, false, "?>"); - if (!tagData) - throw new Error("Pi Tag is not closed."); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { - } else { - const childNode = new xmlNode(tagData.tagName); - childNode.add(this.options.textNodeName, ""); - if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); - } - this.addChild(currentNode, childNode, jPath); - } - i = tagData.closeIndex + 1; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed."); - if (this.options.commentPropName) { - const comment = xmlData.substring(i + 4, endIndex - 2); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); - } - i = endIndex; - } else if (xmlData.substr(i + 1, 2) === "!D") { - const result = readDocType(xmlData, i); - this.docTypeEntities = result.entities; - i = result.i; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; - const tagExp = xmlData.substring(i + 9, closeIndex); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); - if (val2 == void 0) - val2 = ""; - if (this.options.cdataPropName) { - currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); - } else { - currentNode.add(this.options.textNodeName, val2); - } - i = closeIndex + 2; - } else { - let result = readTagExp(xmlData, i, this.options.removeNSPrefix); - let tagName = result.tagName; - const rawTagName = result.rawTagName; - let tagExp = result.tagExp; - let attrExpPresent = result.attrExpPresent; - let closeIndex = result.closeIndex; - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode && textData) { - if (currentNode.tagname !== "!xml") { - textData = this.saveTextToParentTag(textData, currentNode, jPath, false); - } - } - const lastTag = currentNode; - if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { - currentNode = this.tagsNodeStack.pop(); - jPath = jPath.substring(0, jPath.lastIndexOf(".")); - } - if (tagName !== xmlObj.tagname) { - jPath += jPath ? "." + tagName : tagName; - } - if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { - let tagContent = ""; - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - i = result.closeIndex; - } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { - i = result.closeIndex; - } else { - const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); - if (!result2) - throw new Error(`Unexpected end of ${rawTagName}`); - i = result2.i; - tagContent = result2.tagContent; - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - if (tagContent) { - tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); - } - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - childNode.add(this.options.textNodeName, tagContent); - this.addChild(currentNode, childNode, jPath); - } else { - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - } else { - const childNode = new xmlNode(tagName); - this.tagsNodeStack.push(currentNode); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - currentNode = childNode; - } - textData = ""; - i = closeIndex; - } - } - } else { - textData += xmlData[i]; - } - } - return xmlObj.child; - }, "parseXml"); - function addChild(currentNode, childNode, jPath) { - const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); - if (result === false) { - } else if (typeof result === "string") { - childNode.tagname = result; - currentNode.addChild(childNode); - } else { - currentNode.addChild(childNode); - } - } - __name(addChild, "addChild"); - var replaceEntitiesValue = /* @__PURE__ */ __name(function(val2) { - if (this.options.processEntities) { - for (let entityName2 in this.docTypeEntities) { - const entity = this.docTypeEntities[entityName2]; - val2 = val2.replace(entity.regx, entity.val); - } - for (let entityName2 in this.lastEntities) { - const entity = this.lastEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - if (this.options.htmlEntities) { - for (let entityName2 in this.htmlEntities) { - const entity = this.htmlEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - } - val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val); - } - return val2; - }, "replaceEntitiesValue"); - function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { - if (textData) { - if (isLeafNode === void 0) - isLeafNode = Object.keys(currentNode.child).length === 0; - textData = this.parseTextData( - textData, - currentNode.tagname, - jPath, - false, - currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, - isLeafNode - ); - if (textData !== void 0 && textData !== "") - currentNode.add(this.options.textNodeName, textData); - textData = ""; - } - return textData; - } - __name(saveTextToParentTag, "saveTextToParentTag"); - function isItStopNode(stopNodes, jPath, currentTagName) { - const allNodesExp = "*." + currentTagName; - for (const stopNodePath in stopNodes) { - const stopNodeExp = stopNodes[stopNodePath]; - if (allNodesExp === stopNodeExp || jPath === stopNodeExp) - return true; - } - return false; - } - __name(isItStopNode, "isItStopNode"); - function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { - let attrBoundary; - let tagExp = ""; - for (let index = i; index < xmlData.length; index++) { - let ch = xmlData[index]; - if (attrBoundary) { - if (ch === attrBoundary) - attrBoundary = ""; - } else if (ch === '"' || ch === "'") { - attrBoundary = ch; - } else if (ch === closingChar[0]) { - if (closingChar[1]) { - if (xmlData[index + 1] === closingChar[1]) { - return { - data: tagExp, - index - }; - } - } else { - return { - data: tagExp, - index - }; - } - } else if (ch === " ") { - ch = " "; - } - tagExp += ch; - } - } - __name(tagExpWithClosingIndex, "tagExpWithClosingIndex"); - function findClosingIndex(xmlData, str, i, errMsg) { - const closingIndex = xmlData.indexOf(str, i); - if (closingIndex === -1) { - throw new Error(errMsg); - } else { - return closingIndex + str.length - 1; - } - } - __name(findClosingIndex, "findClosingIndex"); - function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") { - const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar); - if (!result) - return; - let tagExp = result.data; - const closeIndex = result.index; - const separatorIndex = tagExp.search(/\s/); - let tagName = tagExp; - let attrExpPresent = true; - if (separatorIndex !== -1) { - tagName = tagExp.substring(0, separatorIndex); - tagExp = tagExp.substring(separatorIndex + 1).trimStart(); - } - const rawTagName = tagName; - if (removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - attrExpPresent = tagName !== result.data.substr(colonIndex + 1); - } - } - return { - tagName, - tagExp, - closeIndex, - attrExpPresent, - rawTagName - }; - } - __name(readTagExp, "readTagExp"); - function readStopNodeData(xmlData, tagName, i) { - const startIndex = i; - let openTagCount = 1; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); - let closeTagName = xmlData.substring(i + 2, closeIndex).trim(); - if (closeTagName === tagName) { - openTagCount--; - if (openTagCount === 0) { - return { - tagContent: xmlData.substring(startIndex, i), - i: closeIndex - }; - } - } - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; - i = closeIndex; - } else { - const tagData = readTagExp(xmlData, i, ">"); - if (tagData) { - const openTagName = tagData && tagData.tagName; - if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { - openTagCount++; - } - i = tagData.closeIndex; - } - } - } - } - } - __name(readStopNodeData, "readStopNodeData"); - function parseValue(val2, shouldParse, options) { - if (shouldParse && typeof val2 === "string") { - const newval = val2.trim(); - if (newval === "true") - return true; - else if (newval === "false") - return false; - else - return toNumber(val2, options); - } else { - if (util.isExist(val2)) { - return val2; - } else { - return ""; - } - } - } - __name(parseValue, "parseValue"); - module2.exports = OrderedObjParser; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/node2json.js -var require_node2json = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports2) { - "use strict"; - function prettify(node, options) { - return compress(node, options); - } - __name(prettify, "prettify"); - function compress(arr, options, jPath) { - let text; - const compressedObj = {}; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const property = propName(tagObj); - let newJpath = ""; - if (jPath === void 0) - newJpath = property; - else - newJpath = jPath + "." + property; - if (property === options.textNodeName) { - if (text === void 0) - text = tagObj[property]; - else - text += "" + tagObj[property]; - } else if (property === void 0) { - continue; - } else if (tagObj[property]) { - let val2 = compress(tagObj[property], options, newJpath); - const isLeaf = isLeafTag(val2, options); - if (tagObj[":@"]) { - assignAttributes(val2, tagObj[":@"], newJpath, options); - } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { - val2 = val2[options.textNodeName]; - } else if (Object.keys(val2).length === 0) { - if (options.alwaysCreateTextNode) - val2[options.textNodeName] = ""; - else - val2 = ""; - } - if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) { - if (!Array.isArray(compressedObj[property])) { - compressedObj[property] = [compressedObj[property]]; - } - compressedObj[property].push(val2); - } else { - if (options.isArray(property, newJpath, isLeaf)) { - compressedObj[property] = [val2]; - } else { - compressedObj[property] = val2; - } - } - } - } - if (typeof text === "string") { - if (text.length > 0) - compressedObj[options.textNodeName] = text; - } else if (text !== void 0) - compressedObj[options.textNodeName] = text; - return compressedObj; - } - __name(compress, "compress"); - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key !== ":@") - return key; - } - } - __name(propName, "propName"); - function assignAttributes(obj, attrMap, jpath, options) { - if (attrMap) { - const keys = Object.keys(attrMap); - const len = keys.length; - for (let i = 0; i < len; i++) { - const atrrName = keys[i]; - if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { - obj[atrrName] = [attrMap[atrrName]]; - } else { - obj[atrrName] = attrMap[atrrName]; - } - } - } - } - __name(assignAttributes, "assignAttributes"); - function isLeafTag(obj, options) { - const { textNodeName } = options; - const propCount = Object.keys(obj).length; - if (propCount === 0) { - return true; - } - if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { - return true; - } - return false; - } - __name(isLeafTag, "isLeafTag"); - exports2.prettify = prettify; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/XMLParser.js -var require_XMLParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports2, module2) { - var { buildOptions } = require_OptionsBuilder(); - var OrderedObjParser = require_OrderedObjParser(); - var { prettify } = require_node2json(); - var validator = require_validator(); - var XMLParser = class { - static { - __name(this, "XMLParser"); - } - constructor(options) { - this.externalEntities = {}; - this.options = buildOptions(options); - } - /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption - */ - parse(xmlData, validationOption) { - if (typeof xmlData === "string") { - } else if (xmlData.toString) { - xmlData = xmlData.toString(); - } else { - throw new Error("XML data is accepted in String or Bytes[] form."); - } - if (validationOption) { - if (validationOption === true) - validationOption = {}; - const result = validator.validate(xmlData, validationOption); - if (result !== true) { - throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); - } - } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.addExternalEntities(this.externalEntities); - const orderedResult = orderedObjParser.parseXml(xmlData); - if (this.options.preserveOrder || orderedResult === void 0) - return orderedResult; - else - return prettify(orderedResult, this.options); - } - /** - * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value - */ - addEntity(key, value) { - if (value.indexOf("&") !== -1) { - throw new Error("Entity value can't have '&'"); - } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); - } else if (value === "&") { - throw new Error("An entity with value '&' is not permitted"); - } else { - this.externalEntities[key] = value; - } - } - }; - module2.exports = XMLParser; - } -}); - -// node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js -var require_orderedJs2Xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module2) { - var EOL = "\n"; - function toXml(jArray, options) { - let indentation = ""; - if (options.format && options.indentBy.length > 0) { - indentation = EOL; - } - return arrToStr(jArray, options, "", indentation); - } - __name(toXml, "toXml"); - function arrToStr(arr, options, jPath, indentation) { - let xmlStr = ""; - let isPreviousElementTag = false; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const tagName = propName(tagObj); - if (tagName === void 0) - continue; - let newJPath = ""; - if (jPath.length === 0) - newJPath = tagName; - else - newJPath = `${jPath}.${tagName}`; - if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; - if (!isStopNode(newJPath, options)) { - tagText = options.tagValueProcessor(tagName, tagText); - tagText = replaceEntitiesValue(tagText, options); - } - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += tagText; - isPreviousElementTag = false; - continue; - } else if (tagName === options.cdataPropName) { - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += ``; - isPreviousElementTag = false; - continue; - } else if (tagName === options.commentPropName) { - xmlStr += indentation + ``; - isPreviousElementTag = true; - continue; - } else if (tagName[0] === "?") { - const attStr2 = attr_to_str(tagObj[":@"], options); - const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; - isPreviousElementTag = true; - continue; - } - let newIdentation = indentation; - if (newIdentation !== "") { - newIdentation += options.indentBy; - } - const attStr = attr_to_str(tagObj[":@"], options); - const tagStart = indentation + `<${tagName}${attStr}`; - const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); - if (options.unpairedTags.indexOf(tagName) !== -1) { - if (options.suppressUnpairedNode) - xmlStr += tagStart + ">"; - else - xmlStr += tagStart + "/>"; - } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { - xmlStr += tagStart + "/>"; - } else if (tagValue && tagValue.endsWith(">")) { - xmlStr += tagStart + `>${tagValue}${indentation}`; - } else { - xmlStr += tagStart + ">"; - if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; - } - isPreviousElementTag = true; - } - return xmlStr; - } - __name(arrToStr, "arrToStr"); - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (!obj.hasOwnProperty(key)) - continue; - if (key !== ":@") - return key; - } - } - __name(propName, "propName"); - function attr_to_str(attrMap, options) { - let attrStr = ""; - if (attrMap && !options.ignoreAttributes) { - for (let attr in attrMap) { - if (!attrMap.hasOwnProperty(attr)) - continue; - let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); - attrVal = replaceEntitiesValue(attrVal, options); - if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; - } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; - } - } - } - return attrStr; - } - __name(attr_to_str, "attr_to_str"); - function isStopNode(jPath, options) { - jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); - let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); - for (let index in options.stopNodes) { - if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) - return true; - } - return false; - } - __name(isStopNode, "isStopNode"); - function replaceEntitiesValue(textValue, options) { - if (textValue && textValue.length > 0 && options.processEntities) { - for (let i = 0; i < options.entities.length; i++) { - const entity = options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; - } - __name(replaceEntitiesValue, "replaceEntitiesValue"); - module2.exports = toXml; - } -}); - -// node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js -var require_json2xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports2, module2) { - "use strict"; - var buildFromOrderedJs = require_orderedJs2Xml(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var defaultOptions = { - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - cdataPropName: false, - format: false, - indentBy: " ", - suppressEmptyNode: false, - suppressUnpairedNode: true, - suppressBooleanAttributes: true, - tagValueProcessor: function(key, a) { - return a; - }, - attributeValueProcessor: function(attrName, a) { - return a; - }, - preserveOrder: false, - commentPropName: false, - unpairedTags: [], - entities: [ - { regex: new RegExp("&", "g"), val: "&" }, - //it must be on top - { regex: new RegExp(">", "g"), val: ">" }, - { regex: new RegExp("<", "g"), val: "<" }, - { regex: new RegExp("'", "g"), val: "'" }, - { regex: new RegExp('"', "g"), val: """ } - ], - processEntities: true, - stopNodes: [], - // transformTagName: false, - // transformAttributeName: false, - oneListGroup: false - }; - function Builder(options) { - this.options = Object.assign({}, defaultOptions, options); - if (this.options.ignoreAttributes === true || this.options.attributesGroupName) { - this.isAttribute = function() { - return false; - }; - } else { - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - this.attrPrefixLen = this.options.attributeNamePrefix.length; - this.isAttribute = isAttribute; - } - this.processTextOrObjNode = processTextOrObjNode; - if (this.options.format) { - this.indentate = indentate; - this.tagEndChar = ">\n"; - this.newLine = "\n"; - } else { - this.indentate = function() { - return ""; - }; - this.tagEndChar = ">"; - this.newLine = ""; - } - } - __name(Builder, "Builder"); - Builder.prototype.build = function(jObj) { - if (this.options.preserveOrder) { - return buildFromOrderedJs(jObj, this.options); - } else { - if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) { - jObj = { - [this.options.arrayNodeName]: jObj - }; - } - return this.j2x(jObj, 0, []).val; - } - }; - Builder.prototype.j2x = function(jObj, level, ajPath) { - let attrStr = ""; - let val2 = ""; - const jPath = ajPath.join("."); - for (let key in jObj) { - if (!Object.prototype.hasOwnProperty.call(jObj, key)) - continue; - if (typeof jObj[key] === "undefined") { - if (this.isAttribute(key)) { - val2 += ""; - } - } else if (jObj[key] === null) { - if (this.isAttribute(key)) { - val2 += ""; - } else if (key[0] === "?") { - val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - } else { - val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } - } else if (jObj[key] instanceof Date) { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } else if (typeof jObj[key] !== "object") { - const attr = this.isAttribute(key); - if (attr && !this.ignoreAttributesFn(attr, jPath)) { - attrStr += this.buildAttrPairStr(attr, "" + jObj[key]); - } else if (!attr) { - if (key === this.options.textNodeName) { - let newval = this.options.tagValueProcessor(key, "" + jObj[key]); - val2 += this.replaceEntitiesValue(newval); - } else { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } - } - } else if (Array.isArray(jObj[key])) { - const arrLen = jObj[key].length; - let listTagVal = ""; - let listTagAttr = ""; - for (let j = 0; j < arrLen; j++) { - const item = jObj[key][j]; - if (typeof item === "undefined") { - } else if (item === null) { - if (key[0] === "?") - val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - else - val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } else if (typeof item === "object") { - if (this.options.oneListGroup) { - const result = this.j2x(item, level + 1, ajPath.concat(key)); - listTagVal += result.val; - if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { - listTagAttr += result.attrStr; - } - } else { - listTagVal += this.processTextOrObjNode(item, key, level, ajPath); - } - } else { - if (this.options.oneListGroup) { - let textValue = this.options.tagValueProcessor(key, item); - textValue = this.replaceEntitiesValue(textValue); - listTagVal += textValue; - } else { - listTagVal += this.buildTextValNode(item, key, "", level); - } - } - } - if (this.options.oneListGroup) { - listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); - } - val2 += listTagVal; - } else { - if (this.options.attributesGroupName && key === this.options.attributesGroupName) { - const Ks = Object.keys(jObj[key]); - const L = Ks.length; - for (let j = 0; j < L; j++) { - attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]); - } - } else { - val2 += this.processTextOrObjNode(jObj[key], key, level, ajPath); - } - } - } - return { attrStr, val: val2 }; - }; - Builder.prototype.buildAttrPairStr = function(attrName, val2) { - val2 = this.options.attributeValueProcessor(attrName, "" + val2); - val2 = this.replaceEntitiesValue(val2); - if (this.options.suppressBooleanAttributes && val2 === "true") { - return " " + attrName; - } else - return " " + attrName + '="' + val2 + '"'; - }; - function processTextOrObjNode(object, key, level, ajPath) { - const result = this.j2x(object, level + 1, ajPath.concat(key)); - if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { - return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); - } else { - return this.buildObjectNode(result.val, key, result.attrStr, level); - } - } - __name(processTextOrObjNode, "processTextOrObjNode"); - Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) { - if (val2 === "") { - if (key[0] === "?") - return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - else { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } - } else { - let tagEndExp = "" + val2 + tagEndExp; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { - return this.indentate(level) + `` + this.newLine; - } else { - return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp; - } - } - }; - Builder.prototype.closeTag = function(key) { - let closeTag = ""; - if (this.options.unpairedTags.indexOf(key) !== -1) { - if (!this.options.suppressUnpairedNode) - closeTag = "/"; - } else if (this.options.suppressEmptyNode) { - closeTag = "/"; - } else { - closeTag = `>` + this.newLine; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - return this.indentate(level) + `` + this.newLine; - } else if (key[0] === "?") { - return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - } else { - let textValue = this.options.tagValueProcessor(key, val2); - textValue = this.replaceEntitiesValue(textValue); - if (textValue === "") { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } else { - return this.indentate(level) + "<" + key + attrStr + ">" + textValue + " 0 && this.options.processEntities) { - for (let i = 0; i < this.options.entities.length; i++) { - const entity = this.options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; - }; - function indentate(level) { - return this.options.indentBy.repeat(level); - } - __name(indentate, "indentate"); - function isAttribute(name) { - if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) { - return name.substr(this.attrPrefixLen); - } else { - return false; - } - } - __name(isAttribute, "isAttribute"); - module2.exports = Builder; - } -}); - -// node_modules/fast-xml-parser/src/fxp.js +// node_modules/fast-xml-parser/lib/fxp.cjs var require_fxp = __commonJS({ - "node_modules/fast-xml-parser/src/fxp.js"(exports2, module2) { - "use strict"; - var validator = require_validator(); - var XMLParser = require_XMLParser(); - var XMLBuilder = require_json2xml(); - module2.exports = { - XMLParser, - XMLValidator: validator, - XMLBuilder - }; + "node_modules/fast-xml-parser/lib/fxp.cjs"(exports2, module2) { + (() => { + "use strict"; + var t = { d: (e2, i2) => { + for (var n2 in i2) + t.o(i2, n2) && !t.o(e2, n2) && Object.defineProperty(e2, n2, { enumerable: true, get: i2[n2] }); + }, o: (t2, e2) => Object.prototype.hasOwnProperty.call(t2, e2), r: (t2) => { + "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t2, "__esModule", { value: true }); + } }, e = {}; + t.r(e), t.d(e, { XMLBuilder: () => lt, XMLParser: () => tt, XMLValidator: () => pt }); + const i = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", n = new RegExp("^[" + i + "][" + i + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); + function s(t2, e2) { + const i2 = []; + let n2 = e2.exec(t2); + for (; n2; ) { + const s2 = []; + s2.startIndex = e2.lastIndex - n2[0].length; + const r2 = n2.length; + for (let t3 = 0; t3 < r2; t3++) + s2.push(n2[t3]); + i2.push(s2), n2 = e2.exec(t2); + } + return i2; + } + __name(s, "s"); + const r = /* @__PURE__ */ __name(function(t2) { + return !(null == n.exec(t2)); + }, "r"), o = { allowBooleanAttributes: false, unpairedTags: [] }; + function a(t2, e2) { + e2 = Object.assign({}, o, e2); + const i2 = []; + let n2 = false, s2 = false; + "\uFEFF" === t2[0] && (t2 = t2.substr(1)); + for (let o2 = 0; o2 < t2.length; o2++) + if ("<" === t2[o2] && "?" === t2[o2 + 1]) { + if (o2 += 2, o2 = u(t2, o2), o2.err) + return o2; + } else { + if ("<" !== t2[o2]) { + if (l(t2[o2])) + continue; + return x("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + } + { + let a2 = o2; + if (o2++, "!" === t2[o2]) { + o2 = h(t2, o2); + continue; + } + { + let d2 = false; + "/" === t2[o2] && (d2 = true, o2++); + let p2 = ""; + for (; o2 < t2.length && ">" !== t2[o2] && " " !== t2[o2] && " " !== t2[o2] && "\n" !== t2[o2] && "\r" !== t2[o2]; o2++) + p2 += t2[o2]; + if (p2 = p2.trim(), "/" === p2[p2.length - 1] && (p2 = p2.substring(0, p2.length - 1), o2--), !r(p2)) { + let e3; + return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", x("InvalidTag", e3, b(t2, o2)); + } + const c2 = f(t2, o2); + if (false === c2) + return x("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); + let N2 = c2.value; + if (o2 = c2.index, "/" === N2[N2.length - 1]) { + const i3 = o2 - N2.length; + N2 = N2.substring(0, N2.length - 1); + const s3 = g(N2, e2); + if (true !== s3) + return x(s3.err.code, s3.err.msg, b(t2, i3 + s3.err.line)); + n2 = true; + } else if (d2) { + if (!c2.tagClosed) + return x("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); + if (N2.trim().length > 0) + return x("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); + if (0 === i2.length) + return x("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + { + const e3 = i2.pop(); + if (p2 !== e3.tagName) { + let i3 = b(t2, e3.tagStartPos); + return x("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + i3.line + ", col " + i3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + } + 0 == i2.length && (s2 = true); + } + } else { + const r2 = g(N2, e2); + if (true !== r2) + return x(r2.err.code, r2.err.msg, b(t2, o2 - N2.length + r2.err.line)); + if (true === s2) + return x("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); + -1 !== e2.unpairedTags.indexOf(p2) || i2.push({ tagName: p2, tagStartPos: a2 }), n2 = true; + } + for (o2++; o2 < t2.length; o2++) + if ("<" === t2[o2]) { + if ("!" === t2[o2 + 1]) { + o2++, o2 = h(t2, o2); + continue; + } + if ("?" !== t2[o2 + 1]) + break; + if (o2 = u(t2, ++o2), o2.err) + return o2; + } else if ("&" === t2[o2]) { + const e3 = m(t2, o2); + if (-1 == e3) + return x("InvalidChar", "char '&' is not expected.", b(t2, o2)); + o2 = e3; + } else if (true === s2 && !l(t2[o2])) + return x("InvalidXml", "Extra text at the end", b(t2, o2)); + "<" === t2[o2] && o2--; + } + } + } + return n2 ? 1 == i2.length ? x("InvalidTag", "Unclosed tag '" + i2[0].tagName + "'.", b(t2, i2[0].tagStartPos)) : !(i2.length > 0) || x("InvalidXml", "Invalid '" + JSON.stringify(i2.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : x("InvalidXml", "Start tag expected.", 1); + } + __name(a, "a"); + function l(t2) { + return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; + } + __name(l, "l"); + function u(t2, e2) { + const i2 = e2; + for (; e2 < t2.length; e2++) + if ("?" != t2[e2] && " " != t2[e2]) + ; + else { + const n2 = t2.substr(i2, e2 - i2); + if (e2 > 5 && "xml" === n2) + return x("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if ("?" == t2[e2] && ">" == t2[e2 + 1]) { + e2++; + break; + } + } + return e2; + } + __name(u, "u"); + function h(t2, e2) { + if (t2.length > e2 + 5 && "-" === t2[e2 + 1] && "-" === t2[e2 + 2]) { + for (e2 += 3; e2 < t2.length; e2++) + if ("-" === t2[e2] && "-" === t2[e2 + 1] && ">" === t2[e2 + 2]) { + e2 += 2; + break; + } + } else if (t2.length > e2 + 8 && "D" === t2[e2 + 1] && "O" === t2[e2 + 2] && "C" === t2[e2 + 3] && "T" === t2[e2 + 4] && "Y" === t2[e2 + 5] && "P" === t2[e2 + 6] && "E" === t2[e2 + 7]) { + let i2 = 1; + for (e2 += 8; e2 < t2.length; e2++) + if ("<" === t2[e2]) + i2++; + else if (">" === t2[e2] && (i2--, 0 === i2)) + break; + } else if (t2.length > e2 + 9 && "[" === t2[e2 + 1] && "C" === t2[e2 + 2] && "D" === t2[e2 + 3] && "A" === t2[e2 + 4] && "T" === t2[e2 + 5] && "A" === t2[e2 + 6] && "[" === t2[e2 + 7]) { + for (e2 += 8; e2 < t2.length; e2++) + if ("]" === t2[e2] && "]" === t2[e2 + 1] && ">" === t2[e2 + 2]) { + e2 += 2; + break; + } + } + return e2; + } + __name(h, "h"); + const d = '"', p = "'"; + function f(t2, e2) { + let i2 = "", n2 = "", s2 = false; + for (; e2 < t2.length; e2++) { + if (t2[e2] === d || t2[e2] === p) + "" === n2 ? n2 = t2[e2] : n2 !== t2[e2] || (n2 = ""); + else if (">" === t2[e2] && "" === n2) { + s2 = true; + break; + } + i2 += t2[e2]; + } + return "" === n2 && { value: i2, index: e2, tagClosed: s2 }; + } + __name(f, "f"); + const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + function g(t2, e2) { + const i2 = s(t2, c), n2 = {}; + for (let t3 = 0; t3 < i2.length; t3++) { + if (0 === i2[t3][1].length) + return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' has no space in starting.", E(i2[t3])); + if (void 0 !== i2[t3][3] && void 0 === i2[t3][4]) + return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' is without value.", E(i2[t3])); + if (void 0 === i2[t3][3] && !e2.allowBooleanAttributes) + return x("InvalidAttr", "boolean attribute '" + i2[t3][2] + "' is not allowed.", E(i2[t3])); + const s2 = i2[t3][2]; + if (!N(s2)) + return x("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", E(i2[t3])); + if (n2.hasOwnProperty(s2)) + return x("InvalidAttr", "Attribute '" + s2 + "' is repeated.", E(i2[t3])); + n2[s2] = 1; + } + return true; + } + __name(g, "g"); + function m(t2, e2) { + if (";" === t2[++e2]) + return -1; + if ("#" === t2[e2]) + return function(t3, e3) { + let i3 = /\d/; + for ("x" === t3[e3] && (e3++, i3 = /[\da-fA-F]/); e3 < t3.length; e3++) { + if (";" === t3[e3]) + return e3; + if (!t3[e3].match(i3)) + break; + } + return -1; + }(t2, ++e2); + let i2 = 0; + for (; e2 < t2.length; e2++, i2++) + if (!(t2[e2].match(/\w/) && i2 < 20)) { + if (";" === t2[e2]) + break; + return -1; + } + return e2; + } + __name(m, "m"); + function x(t2, e2, i2) { + return { err: { code: t2, msg: e2, line: i2.line || i2, col: i2.col } }; + } + __name(x, "x"); + function N(t2) { + return r(t2); + } + __name(N, "N"); + function b(t2, e2) { + const i2 = t2.substring(0, e2).split(/\r?\n/); + return { line: i2.length, col: i2[i2.length - 1].length + 1 }; + } + __name(b, "b"); + function E(t2) { + return t2.startIndex + t2[1].length; + } + __name(E, "E"); + const v = { preserveOrder: false, attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, removeNSPrefix: false, allowBooleanAttributes: false, parseTagValue: true, parseAttributeValue: false, trimValues: true, cdataPropName: false, numberParseOptions: { hex: true, leadingZeros: true, eNotation: true }, tagValueProcessor: function(t2, e2) { + return e2; + }, attributeValueProcessor: function(t2, e2) { + return e2; + }, stopNodes: [], alwaysCreateTextNode: false, isArray: () => false, commentPropName: false, unpairedTags: [], processEntities: true, htmlEntities: false, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e2, i2) { + return t2; + }, captureMetaData: false }; + let T; + T = "function" != typeof Symbol ? "@@xmlMetadata" : Symbol("XML Node Metadata"); + class y { + static { + __name(this, "y"); + } + constructor(t2) { + this.tagname = t2, this.child = [], this[":@"] = {}; + } + add(t2, e2) { + "__proto__" === t2 && (t2 = "#__proto__"), this.child.push({ [t2]: e2 }); + } + addChild(t2, e2) { + "__proto__" === t2.tagname && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), void 0 !== e2 && (this.child[this.child.length - 1][T] = { startIndex: e2 }); + } + static getMetaDataSymbol() { + return T; + } + } + class w { + static { + __name(this, "w"); + } + constructor(t2) { + this.suppressValidationErr = !t2; + } + readDocType(t2, e2) { + const i2 = {}; + if ("O" !== t2[e2 + 3] || "C" !== t2[e2 + 4] || "T" !== t2[e2 + 5] || "Y" !== t2[e2 + 6] || "P" !== t2[e2 + 7] || "E" !== t2[e2 + 8]) + throw new Error("Invalid Tag instead of DOCTYPE"); + { + e2 += 9; + let n2 = 1, s2 = false, r2 = false, o2 = ""; + for (; e2 < t2.length; e2++) + if ("<" !== t2[e2] || r2) + if (">" === t2[e2]) { + if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, n2--) : n2--, 0 === n2) + break; + } else + "[" === t2[e2] ? s2 = true : o2 += t2[e2]; + else { + if (s2 && P(t2, "!ENTITY", e2)) { + let n3, s3; + e2 += 7, [n3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&") && (i2[n3] = { regx: RegExp(`&${n3};`, "g"), val: s3 }); + } else if (s2 && P(t2, "!ELEMENT", e2)) { + e2 += 8; + const { index: i3 } = this.readElementExp(t2, e2 + 1); + e2 = i3; + } else if (s2 && P(t2, "!ATTLIST", e2)) + e2 += 8; + else if (s2 && P(t2, "!NOTATION", e2)) { + e2 += 9; + const { index: i3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); + e2 = i3; + } else { + if (!P(t2, "!--", e2)) + throw new Error("Invalid DOCTYPE"); + r2 = true; + } + n2++, o2 = ""; + } + if (0 !== n2) + throw new Error("Unclosed DOCTYPE"); + } + return { entities: i2, i: e2 }; + } + readEntityExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) + i2 += t2[e2], e2++; + if (O(i2), e2 = I(t2, e2), !this.suppressValidationErr) { + if ("SYSTEM" === t2.substring(e2, e2 + 6).toUpperCase()) + throw new Error("External entities are not supported"); + if ("%" === t2[e2]) + throw new Error("Parameter entities are not supported"); + } + let n2 = ""; + return [e2, n2] = this.readIdentifierVal(t2, e2, "entity"), [i2, n2, --e2]; + } + readNotationExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) + i2 += t2[e2], e2++; + !this.suppressValidationErr && O(i2), e2 = I(t2, e2); + const n2 = t2.substring(e2, e2 + 6).toUpperCase(); + if (!this.suppressValidationErr && "SYSTEM" !== n2 && "PUBLIC" !== n2) + throw new Error(`Expected SYSTEM or PUBLIC, found "${n2}"`); + e2 += n2.length, e2 = I(t2, e2); + let s2 = null, r2 = null; + if ("PUBLIC" === n2) + [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = I(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + else if ("SYSTEM" === n2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) + throw new Error("Missing mandatory system identifier for SYSTEM notation"); + return { notationName: i2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; + } + readIdentifierVal(t2, e2, i2) { + let n2 = ""; + const s2 = t2[e2]; + if ('"' !== s2 && "'" !== s2) + throw new Error(`Expected quoted string, found "${s2}"`); + for (e2++; e2 < t2.length && t2[e2] !== s2; ) + n2 += t2[e2], e2++; + if (t2[e2] !== s2) + throw new Error(`Unterminated ${i2} value`); + return [++e2, n2]; + } + readElementExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) + i2 += t2[e2], e2++; + if (!this.suppressValidationErr && !r(i2)) + throw new Error(`Invalid element name: "${i2}"`); + let n2 = ""; + if ("E" === t2[e2 = I(t2, e2)] && P(t2, "MPTY", e2)) + e2 += 4; + else if ("A" === t2[e2] && P(t2, "NY", e2)) + e2 += 2; + else if ("(" === t2[e2]) { + for (e2++; e2 < t2.length && ")" !== t2[e2]; ) + n2 += t2[e2], e2++; + if (")" !== t2[e2]) + throw new Error("Unterminated content model"); + } else if (!this.suppressValidationErr) + throw new Error(`Invalid Element Expression, found "${t2[e2]}"`); + return { elementName: i2, contentModel: n2.trim(), index: e2 }; + } + readAttlistExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) + i2 += t2[e2], e2++; + O(i2), e2 = I(t2, e2); + let n2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) + n2 += t2[e2], e2++; + if (!O(n2)) + throw new Error(`Invalid attribute name: "${n2}"`); + e2 = I(t2, e2); + let s2 = ""; + if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { + if (s2 = "NOTATION", "(" !== t2[e2 = I(t2, e2 += 8)]) + throw new Error(`Expected '(', found "${t2[e2]}"`); + e2++; + let i3 = []; + for (; e2 < t2.length && ")" !== t2[e2]; ) { + let n3 = ""; + for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) + n3 += t2[e2], e2++; + if (n3 = n3.trim(), !O(n3)) + throw new Error(`Invalid notation name: "${n3}"`); + i3.push(n3), "|" === t2[e2] && (e2++, e2 = I(t2, e2)); + } + if (")" !== t2[e2]) + throw new Error("Unterminated list of notations"); + e2++, s2 += " (" + i3.join("|") + ")"; + } else { + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) + s2 += t2[e2], e2++; + const i3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; + if (!this.suppressValidationErr && !i3.includes(s2.toUpperCase())) + throw new Error(`Invalid attribute type: "${s2}"`); + } + e2 = I(t2, e2); + let r2 = ""; + return "#REQUIRED" === t2.substring(e2, e2 + 8).toUpperCase() ? (r2 = "#REQUIRED", e2 += 8) : "#IMPLIED" === t2.substring(e2, e2 + 7).toUpperCase() ? (r2 = "#IMPLIED", e2 += 7) : [e2, r2] = this.readIdentifierVal(t2, e2, "ATTLIST"), { elementName: i2, attributeName: n2, attributeType: s2, defaultValue: r2, index: e2 }; + } + } + const I = /* @__PURE__ */ __name((t2, e2) => { + for (; e2 < t2.length && /\s/.test(t2[e2]); ) + e2++; + return e2; + }, "I"); + function P(t2, e2, i2) { + for (let n2 = 0; n2 < e2.length; n2++) + if (e2[n2] !== t2[i2 + n2 + 1]) + return false; + return true; + } + __name(P, "P"); + function O(t2) { + if (r(t2)) + return t2; + throw new Error(`Invalid entity name ${t2}`); + } + __name(O, "O"); + const A = /^[-+]?0x[a-fA-F0-9]+$/, S = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, C = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const V = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + function $(t2) { + return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { + for (const i2 of t2) { + if ("string" == typeof i2 && e2 === i2) + return true; + if (i2 instanceof RegExp && i2.test(e2)) + return true; + } + } : () => false; + } + __name($, "$"); + class D { + static { + __name(this, "D"); + } + constructor(t2) { + if (this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 10)) }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 16)) } }, this.addExternalEntities = j, this.parseXml = L, this.parseTextData = M, this.resolveNameSpace = F, this.buildAttributesMap = k, this.isItStopNode = Y, this.replaceEntitiesValue = B, this.readStopNodeData = W, this.saveTextToParentTag = R, this.addChild = U, this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) { + this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set(); + for (let t3 = 0; t3 < this.options.stopNodes.length; t3++) { + const e2 = this.options.stopNodes[t3]; + "string" == typeof e2 && (e2.startsWith("*.") ? this.stopNodesWildcard.add(e2.substring(2)) : this.stopNodesExact.add(e2)); + } + } + } + } + function j(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + this.lastEntities[n2] = { regex: new RegExp("&" + n2 + ";", "g"), val: t2[n2] }; + } + } + __name(j, "j"); + function M(t2, e2, i2, n2, s2, r2, o2) { + if (void 0 !== t2 && (this.options.trimValues && !n2 && (t2 = t2.trim()), t2.length > 0)) { + o2 || (t2 = this.replaceEntitiesValue(t2)); + const n3 = this.options.tagValueProcessor(e2, t2, i2, s2, r2); + return null == n3 ? t2 : typeof n3 != typeof t2 || n3 !== t2 ? n3 : this.options.trimValues || t2.trim() === t2 ? q(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; + } + } + __name(M, "M"); + function F(t2) { + if (this.options.removeNSPrefix) { + const e2 = t2.split(":"), i2 = "/" === t2.charAt(0) ? "/" : ""; + if ("xmlns" === e2[0]) + return ""; + 2 === e2.length && (t2 = i2 + e2[1]); + } + return t2; + } + __name(F, "F"); + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + function k(t2, e2) { + if (true !== this.options.ignoreAttributes && "string" == typeof t2) { + const i2 = s(t2, _), n2 = i2.length, r2 = {}; + for (let t3 = 0; t3 < n2; t3++) { + const n3 = this.resolveNameSpace(i2[t3][1]); + if (this.ignoreAttributesFn(n3, e2)) + continue; + let s2 = i2[t3][4], o2 = this.options.attributeNamePrefix + n3; + if (n3.length) + if (this.options.transformAttributeName && (o2 = this.options.transformAttributeName(o2)), "__proto__" === o2 && (o2 = "#__proto__"), void 0 !== s2) { + this.options.trimValues && (s2 = s2.trim()), s2 = this.replaceEntitiesValue(s2); + const t4 = this.options.attributeValueProcessor(n3, s2, e2); + r2[o2] = null == t4 ? s2 : typeof t4 != typeof s2 || t4 !== s2 ? t4 : q(s2, this.options.parseAttributeValue, this.options.numberParseOptions); + } else + this.options.allowBooleanAttributes && (r2[o2] = true); + } + if (!Object.keys(r2).length) + return; + if (this.options.attributesGroupName) { + const t3 = {}; + return t3[this.options.attributesGroupName] = r2, t3; + } + return r2; + } + } + __name(k, "k"); + const L = /* @__PURE__ */ __name(function(t2) { + t2 = t2.replace(/\r\n?/g, "\n"); + const e2 = new y("!xml"); + let i2 = e2, n2 = "", s2 = ""; + const r2 = new w(this.options.processEntities); + for (let o2 = 0; o2 < t2.length; o2++) + if ("<" === t2[o2]) + if ("/" === t2[o2 + 1]) { + const e3 = G(t2, ">", o2, "Closing Tag is not closed."); + let r3 = t2.substring(o2 + 2, e3).trim(); + if (this.options.removeNSPrefix) { + const t3 = r3.indexOf(":"); + -1 !== t3 && (r3 = r3.substr(t3 + 1)); + } + this.options.transformTagName && (r3 = this.options.transformTagName(r3)), i2 && (n2 = this.saveTextToParentTag(n2, i2, s2)); + const a2 = s2.substring(s2.lastIndexOf(".") + 1); + if (r3 && -1 !== this.options.unpairedTags.indexOf(r3)) + throw new Error(`Unpaired tag can not be used as closing tag: `); + let l2 = 0; + a2 && -1 !== this.options.unpairedTags.indexOf(a2) ? (l2 = s2.lastIndexOf(".", s2.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : l2 = s2.lastIndexOf("."), s2 = s2.substring(0, l2), i2 = this.tagsNodeStack.pop(), n2 = "", o2 = e3; + } else if ("?" === t2[o2 + 1]) { + let e3 = X(t2, o2, false, "?>"); + if (!e3) + throw new Error("Pi Tag is not closed."); + if (n2 = this.saveTextToParentTag(n2, i2, s2), this.options.ignoreDeclaration && "?xml" === e3.tagName || this.options.ignorePiTags) + ; + else { + const t3 = new y(e3.tagName); + t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, s2)), this.addChild(i2, t3, s2, o2); + } + o2 = e3.closeIndex + 1; + } else if ("!--" === t2.substr(o2 + 1, 3)) { + const e3 = G(t2, "-->", o2 + 4, "Comment is not closed."); + if (this.options.commentPropName) { + const r3 = t2.substring(o2 + 4, e3 - 2); + n2 = this.saveTextToParentTag(n2, i2, s2), i2.add(this.options.commentPropName, [{ [this.options.textNodeName]: r3 }]); + } + o2 = e3; + } else if ("!D" === t2.substr(o2 + 1, 2)) { + const e3 = r2.readDocType(t2, o2); + this.docTypeEntities = e3.entities, o2 = e3.i; + } else if ("![" === t2.substr(o2 + 1, 2)) { + const e3 = G(t2, "]]>", o2, "CDATA is not closed.") - 2, r3 = t2.substring(o2 + 9, e3); + n2 = this.saveTextToParentTag(n2, i2, s2); + let a2 = this.parseTextData(r3, i2.tagname, s2, true, false, true, true); + null == a2 && (a2 = ""), this.options.cdataPropName ? i2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: r3 }]) : i2.add(this.options.textNodeName, a2), o2 = e3 + 2; + } else { + let r3 = X(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; + const l2 = r3.rawTagName; + let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + if (this.options.transformTagName) { + const t3 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t3), a2 = t3; + } + i2 && n2 && "!xml" !== i2.tagname && (n2 = this.saveTextToParentTag(n2, i2, s2, false)); + const p2 = i2; + p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (i2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); + const f2 = o2; + if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s2, a2)) { + let e3 = ""; + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) + "/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), o2 = r3.closeIndex; + else if (-1 !== this.options.unpairedTags.indexOf(a2)) + o2 = r3.closeIndex; + else { + const i3 = this.readStopNodeData(t2, l2, d2 + 1); + if (!i3) + throw new Error(`Unexpected end of ${l2}`); + o2 = i3.i, e3 = i3.tagContent; + } + const n3 = new y(a2); + a2 !== u2 && h2 && (n3[":@"] = this.buildAttributesMap(u2, s2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), n3.add(this.options.textNodeName, e3), this.addChild(i2, n3, s2, f2); + } else { + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) { + if ("/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), this.options.transformTagName) { + const t4 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t4), a2 = t4; + } + const t3 = new y(a2); + a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + } else { + const t3 = new y(a2); + this.tagsNodeStack.push(i2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), i2 = t3; + } + n2 = "", o2 = d2; + } + } + else + n2 += t2[o2]; + return e2.child; + }, "L"); + function U(t2, e2, i2, n2) { + this.options.captureMetaData || (n2 = void 0); + const s2 = this.options.updateTag(e2.tagname, i2, e2[":@"]); + false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, n2)) : t2.addChild(e2, n2)); + } + __name(U, "U"); + const B = /* @__PURE__ */ __name(function(t2) { + if (this.options.processEntities) { + for (let e2 in this.docTypeEntities) { + const i2 = this.docTypeEntities[e2]; + t2 = t2.replace(i2.regx, i2.val); + } + for (let e2 in this.lastEntities) { + const i2 = this.lastEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + if (this.options.htmlEntities) + for (let e2 in this.htmlEntities) { + const i2 = this.htmlEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + t2 = t2.replace(this.ampEntity.regex, this.ampEntity.val); + } + return t2; + }, "B"); + function R(t2, e2, i2, n2) { + return t2 && (void 0 === n2 && (n2 = 0 === e2.child.length), void 0 !== (t2 = this.parseTextData(t2, e2.tagname, i2, false, !!e2[":@"] && 0 !== Object.keys(e2[":@"]).length, n2)) && "" !== t2 && e2.add(this.options.textNodeName, t2), t2 = ""), t2; + } + __name(R, "R"); + function Y(t2, e2, i2, n2) { + return !(!e2 || !e2.has(n2)) || !(!t2 || !t2.has(i2)); + } + __name(Y, "Y"); + function G(t2, e2, i2, n2) { + const s2 = t2.indexOf(e2, i2); + if (-1 === s2) + throw new Error(n2); + return s2 + e2.length - 1; + } + __name(G, "G"); + function X(t2, e2, i2, n2 = ">") { + const s2 = function(t3, e3, i3 = ">") { + let n3, s3 = ""; + for (let r3 = e3; r3 < t3.length; r3++) { + let e4 = t3[r3]; + if (n3) + e4 === n3 && (n3 = ""); + else if ('"' === e4 || "'" === e4) + n3 = e4; + else if (e4 === i3[0]) { + if (!i3[1]) + return { data: s3, index: r3 }; + if (t3[r3 + 1] === i3[1]) + return { data: s3, index: r3 }; + } else + " " === e4 && (e4 = " "); + s3 += e4; + } + }(t2, e2 + 1, n2); + if (!s2) + return; + let r2 = s2.data; + const o2 = s2.index, a2 = r2.search(/\s/); + let l2 = r2, u2 = true; + -1 !== a2 && (l2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart()); + const h2 = l2; + if (i2) { + const t3 = l2.indexOf(":"); + -1 !== t3 && (l2 = l2.substr(t3 + 1), u2 = l2 !== s2.data.substr(t3 + 1)); + } + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: h2 }; + } + __name(X, "X"); + function W(t2, e2, i2) { + const n2 = i2; + let s2 = 1; + for (; i2 < t2.length; i2++) + if ("<" === t2[i2]) + if ("/" === t2[i2 + 1]) { + const r2 = G(t2, ">", i2, `${e2} is not closed`); + if (t2.substring(i2 + 2, r2).trim() === e2 && (s2--, 0 === s2)) + return { tagContent: t2.substring(n2, i2), i: r2 }; + i2 = r2; + } else if ("?" === t2[i2 + 1]) + i2 = G(t2, "?>", i2 + 1, "StopNode is not closed."); + else if ("!--" === t2.substr(i2 + 1, 3)) + i2 = G(t2, "-->", i2 + 3, "StopNode is not closed."); + else if ("![" === t2.substr(i2 + 1, 2)) + i2 = G(t2, "]]>", i2, "StopNode is not closed.") - 2; + else { + const n3 = X(t2, i2, ">"); + n3 && ((n3 && n3.tagName) === e2 && "/" !== n3.tagExp[n3.tagExp.length - 1] && s2++, i2 = n3.closeIndex); + } + } + __name(W, "W"); + function q(t2, e2, i2) { + if (e2 && "string" == typeof t2) { + const e3 = t2.trim(); + return "true" === e3 || "false" !== e3 && function(t3, e4 = {}) { + if (e4 = Object.assign({}, C, e4), !t3 || "string" != typeof t3) + return t3; + let i3 = t3.trim(); + if (void 0 !== e4.skipLike && e4.skipLike.test(i3)) + return t3; + if ("0" === t3) + return 0; + if (e4.hex && A.test(i3)) + return function(t4) { + if (parseInt) + return parseInt(t4, 16); + if (Number.parseInt) + return Number.parseInt(t4, 16); + if (window && window.parseInt) + return window.parseInt(t4, 16); + throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); + }(i3); + if (-1 !== i3.search(/.+[eE].+/)) + return function(t4, e5, i4) { + if (!i4.eNotation) + return t4; + const n3 = e5.match(V); + if (n3) { + let s2 = n3[1] || ""; + const r2 = -1 === n3[3].indexOf("e") ? "E" : "e", o2 = n3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; + return o2.length > 1 && a2 ? t4 : 1 !== o2.length || !n3[3].startsWith(`.${r2}`) && n3[3][0] !== r2 ? i4.leadingZeros && !a2 ? (e5 = (n3[1] || "") + n3[3], Number(e5)) : t4 : Number(e5); + } + return t4; + }(t3, i3, e4); + { + const s2 = S.exec(i3); + if (s2) { + const r2 = s2[1] || "", o2 = s2[2]; + let a2 = (n2 = s2[3]) && -1 !== n2.indexOf(".") ? ("." === (n2 = n2.replace(/0+$/, "")) ? n2 = "0" : "." === n2[0] ? n2 = "0" + n2 : "." === n2[n2.length - 1] && (n2 = n2.substring(0, n2.length - 1)), n2) : n2; + const l2 = r2 ? "." === t3[o2.length + 1] : "." === t3[o2.length]; + if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) + return t3; + { + const n3 = Number(i3), s3 = String(n3); + if (0 === n3 || -0 === n3) + return n3; + if (-1 !== s3.search(/[eE]/)) + return e4.eNotation ? n3 : t3; + if (-1 !== i3.indexOf(".")) + return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? n3 : t3; + let l3 = o2 ? a2 : i3; + return o2 ? l3 === s3 || r2 + l3 === s3 ? n3 : t3 : l3 === s3 || l3 === r2 + s3 ? n3 : t3; + } + } + return t3; + } + var n2; + }(t2, i2); + } + return void 0 !== t2 ? t2 : ""; + } + __name(q, "q"); + const Z = y.getMetaDataSymbol(); + function K(t2, e2) { + return Q(t2, e2); + } + __name(K, "K"); + function Q(t2, e2, i2) { + let n2; + const s2 = {}; + for (let r2 = 0; r2 < t2.length; r2++) { + const o2 = t2[r2], a2 = z(o2); + let l2 = ""; + if (l2 = void 0 === i2 ? a2 : i2 + "." + a2, a2 === e2.textNodeName) + void 0 === n2 ? n2 = o2[a2] : n2 += "" + o2[a2]; + else { + if (void 0 === a2) + continue; + if (o2[a2]) { + let t3 = Q(o2[a2], e2, l2); + const i3 = H(t3, e2); + void 0 !== o2[Z] && (t3[Z] = o2[Z]), o2[":@"] ? J(t3, o2[":@"], l2, e2) : 1 !== Object.keys(t3).length || void 0 === t3[e2.textNodeName] || e2.alwaysCreateTextNode ? 0 === Object.keys(t3).length && (e2.alwaysCreateTextNode ? t3[e2.textNodeName] = "" : t3 = "") : t3 = t3[e2.textNodeName], void 0 !== s2[a2] && s2.hasOwnProperty(a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, i3) ? s2[a2] = [t3] : s2[a2] = t3; + } + } + } + return "string" == typeof n2 ? n2.length > 0 && (s2[e2.textNodeName] = n2) : void 0 !== n2 && (s2[e2.textNodeName] = n2), s2; + } + __name(Q, "Q"); + function z(t2) { + const e2 = Object.keys(t2); + for (let t3 = 0; t3 < e2.length; t3++) { + const i2 = e2[t3]; + if (":@" !== i2) + return i2; + } + } + __name(z, "z"); + function J(t2, e2, i2, n2) { + if (e2) { + const s2 = Object.keys(e2), r2 = s2.length; + for (let o2 = 0; o2 < r2; o2++) { + const r3 = s2[o2]; + n2.isArray(r3, i2 + "." + r3, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3]; + } + } + } + __name(J, "J"); + function H(t2, e2) { + const { textNodeName: i2 } = e2, n2 = Object.keys(t2).length; + return 0 === n2 || !(1 !== n2 || !t2[i2] && "boolean" != typeof t2[i2] && 0 !== t2[i2]); + } + __name(H, "H"); + class tt { + static { + __name(this, "tt"); + } + constructor(t2) { + this.externalEntities = {}, this.options = function(t3) { + return Object.assign({}, v, t3); + }(t2); + } + parse(t2, e2) { + if ("string" != typeof t2 && t2.toString) + t2 = t2.toString(); + else if ("string" != typeof t2) + throw new Error("XML data is accepted in String or Bytes[] form."); + if (e2) { + true === e2 && (e2 = {}); + const i3 = a(t2, e2); + if (true !== i3) + throw Error(`${i3.err.msg}:${i3.err.line}:${i3.err.col}`); + } + const i2 = new D(this.options); + i2.addExternalEntities(this.externalEntities); + const n2 = i2.parseXml(t2); + return this.options.preserveOrder || void 0 === n2 ? n2 : K(n2, this.options); + } + addEntity(t2, e2) { + if (-1 !== e2.indexOf("&")) + throw new Error("Entity value can't have '&'"); + if (-1 !== t2.indexOf("&") || -1 !== t2.indexOf(";")) + throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); + if ("&" === e2) + throw new Error("An entity with value '&' is not permitted"); + this.externalEntities[t2] = e2; + } + static getMetaDataSymbol() { + return y.getMetaDataSymbol(); + } + } + function et(t2, e2) { + let i2 = ""; + return e2.format && e2.indentBy.length > 0 && (i2 = "\n"), it(t2, e2, "", i2); + } + __name(et, "et"); + function it(t2, e2, i2, n2) { + let s2 = "", r2 = false; + for (let o2 = 0; o2 < t2.length; o2++) { + const a2 = t2[o2], l2 = nt(a2); + if (void 0 === l2) + continue; + let u2 = ""; + if (u2 = 0 === i2.length ? l2 : `${i2}.${l2}`, l2 === e2.textNodeName) { + let t3 = a2[l2]; + rt(u2, e2) || (t3 = e2.tagValueProcessor(l2, t3), t3 = ot(t3, e2)), r2 && (s2 += n2), s2 += t3, r2 = false; + continue; + } + if (l2 === e2.cdataPropName) { + r2 && (s2 += n2), s2 += ``, r2 = false; + continue; + } + if (l2 === e2.commentPropName) { + s2 += n2 + ``, r2 = true; + continue; + } + if ("?" === l2[0]) { + const t3 = st(a2[":@"], e2), i3 = "?xml" === l2 ? "" : n2; + let o3 = a2[l2][0][e2.textNodeName]; + o3 = 0 !== o3.length ? " " + o3 : "", s2 += i3 + `<${l2}${o3}${t3}?>`, r2 = true; + continue; + } + let h2 = n2; + "" !== h2 && (h2 += e2.indentBy); + const d2 = n2 + `<${l2}${st(a2[":@"], e2)}`, p2 = it(a2[l2], e2, u2, h2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += d2 + ">" : s2 += d2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += d2 + `>${p2}${n2}` : (s2 += d2 + ">", p2 && "" !== n2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + } + return s2; + } + __name(it, "it"); + function nt(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + if (t2.hasOwnProperty(n2) && ":@" !== n2) + return n2; + } + } + __name(nt, "nt"); + function st(t2, e2) { + let i2 = ""; + if (t2 && !e2.ignoreAttributes) + for (let n2 in t2) { + if (!t2.hasOwnProperty(n2)) + continue; + let s2 = e2.attributeValueProcessor(n2, t2[n2]); + s2 = ot(s2, e2), true === s2 && e2.suppressBooleanAttributes ? i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}` : i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}="${s2}"`; + } + return i2; + } + __name(st, "st"); + function rt(t2, e2) { + let i2 = (t2 = t2.substr(0, t2.length - e2.textNodeName.length - 1)).substr(t2.lastIndexOf(".") + 1); + for (let n2 in e2.stopNodes) + if (e2.stopNodes[n2] === t2 || e2.stopNodes[n2] === "*." + i2) + return true; + return false; + } + __name(rt, "rt"); + function ot(t2, e2) { + if (t2 && t2.length > 0 && e2.processEntities) + for (let i2 = 0; i2 < e2.entities.length; i2++) { + const n2 = e2.entities[i2]; + t2 = t2.replace(n2.regex, n2.val); + } + return t2; + } + __name(ot, "ot"); + const at = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e2) { + return e2; + }, attributeValueProcessor: function(t2, e2) { + return e2; + }, preserveOrder: false, commentPropName: false, unpairedTags: [], entities: [{ regex: new RegExp("&", "g"), val: "&" }, { regex: new RegExp(">", "g"), val: ">" }, { regex: new RegExp("<", "g"), val: "<" }, { regex: new RegExp("'", "g"), val: "'" }, { regex: new RegExp('"', "g"), val: """ }], processEntities: true, stopNodes: [], oneListGroup: false }; + function lt(t2) { + this.options = Object.assign({}, at, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + return false; + } : (this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = dt), this.processTextOrObjNode = ut, this.options.format ? (this.indentate = ht, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + return ""; + }, this.tagEndChar = ">", this.newLine = ""); + } + __name(lt, "lt"); + function ut(t2, e2, i2, n2) { + const s2 = this.j2x(t2, i2 + 1, n2.concat(e2)); + return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, i2) : this.buildObjectNode(s2.val, e2, s2.attrStr, i2); + } + __name(ut, "ut"); + function ht(t2) { + return this.options.indentBy.repeat(t2); + } + __name(ht, "ht"); + function dt(t2) { + return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); + } + __name(dt, "dt"); + lt.prototype.build = function(t2) { + return this.options.preserveOrder ? et(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); + }, lt.prototype.j2x = function(t2, e2, i2) { + let n2 = "", s2 = ""; + const r2 = i2.join("."); + for (let o2 in t2) + if (Object.prototype.hasOwnProperty.call(t2, o2)) + if (void 0 === t2[o2]) + this.isAttribute(o2) && (s2 += ""); + else if (null === t2[o2]) + this.isAttribute(o2) || o2 === this.options.cdataPropName ? s2 += "" : "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if (t2[o2] instanceof Date) + s2 += this.buildTextValNode(t2[o2], o2, "", e2); + else if ("object" != typeof t2[o2]) { + const i3 = this.isAttribute(o2); + if (i3 && !this.ignoreAttributesFn(i3, r2)) + n2 += this.buildAttrPairStr(i3, "" + t2[o2]); + else if (!i3) + if (o2 === this.options.textNodeName) { + let e3 = this.options.tagValueProcessor(o2, "" + t2[o2]); + s2 += this.replaceEntitiesValue(e3); + } else + s2 += this.buildTextValNode(t2[o2], o2, "", e2); + } else if (Array.isArray(t2[o2])) { + const n3 = t2[o2].length; + let r3 = "", a2 = ""; + for (let l2 = 0; l2 < n3; l2++) { + const n4 = t2[o2][l2]; + if (void 0 === n4) + ; + else if (null === n4) + "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if ("object" == typeof n4) + if (this.options.oneListGroup) { + const t3 = this.j2x(n4, e2 + 1, i2.concat(o2)); + r3 += t3.val, this.options.attributesGroupName && n4.hasOwnProperty(this.options.attributesGroupName) && (a2 += t3.attrStr); + } else + r3 += this.processTextOrObjNode(n4, o2, e2, i2); + else if (this.options.oneListGroup) { + let t3 = this.options.tagValueProcessor(o2, n4); + t3 = this.replaceEntitiesValue(t3), r3 += t3; + } else + r3 += this.buildTextValNode(n4, o2, "", e2); + } + this.options.oneListGroup && (r3 = this.buildObjectNode(r3, o2, a2, e2)), s2 += r3; + } else if (this.options.attributesGroupName && o2 === this.options.attributesGroupName) { + const e3 = Object.keys(t2[o2]), i3 = e3.length; + for (let s3 = 0; s3 < i3; s3++) + n2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); + } else + s2 += this.processTextOrObjNode(t2[o2], o2, e2, i2); + return { attrStr: n2, val: s2 }; + }, lt.prototype.buildAttrPairStr = function(t2, e2) { + return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; + }, lt.prototype.buildObjectNode = function(t2, e2, i2, n2) { + if ("" === t2) + return "?" === e2[0] ? this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar; + { + let s2 = "` + this.newLine : this.indentate(n2) + "<" + e2 + i2 + r2 + this.tagEndChar + t2 + this.indentate(n2) + s2 : this.indentate(n2) + "<" + e2 + i2 + r2 + ">" + t2 + s2; + } + }, lt.prototype.closeTag = function(t2) { + let e2 = ""; + return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `>` + this.newLine; + if (false !== this.options.commentPropName && e2 === this.options.commentPropName) + return this.indentate(n2) + `` + this.newLine; + if ("?" === e2[0]) + return this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar; + { + let s2 = this.options.tagValueProcessor(e2, t2); + return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + ">" + s2 + " 0 && this.options.processEntities) + for (let e2 = 0; e2 < this.options.entities.length; e2++) { + const i2 = this.options.entities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + return t2; + }; + const pt = { validate: a }; + module2.exports = e; + })(); } }); @@ -36144,7 +37157,7 @@ var require_xml = __commonJS({ } __name(getSerializerOptions, "getSerializerOptions"); function getParserOptions(options = {}) { - return Object.assign(Object.assign({}, getCommonOptions(options)), { parseAttributeValue: false, parseTagValue: false, attributeNamePrefix: "", stopNodes: options.stopNodes, processEntities: true }); + return Object.assign(Object.assign({}, getCommonOptions(options)), { parseAttributeValue: false, parseTagValue: false, attributeNamePrefix: "", stopNodes: options.stopNodes, processEntities: true, trimValues: false }); } __name(getParserOptions, "getParserOptions"); function stringifyXML(obj, opts = {}) { @@ -36203,6 +37216,17 @@ var require_commonjs10 = __commonJS({ } }); +// node_modules/@azure/storage-blob/dist/commonjs/log.js +var require_log5 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/log.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.logger = void 0; + var logger_1 = require_commonjs2(); + exports2.logger = (0, logger_1.createClientLogger)("storage-blob"); + } +}); + // node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js var require_AbortError3 = __commonJS({ "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { @@ -36235,1263 +37259,18 @@ var require_commonjs11 = __commonJS({ } }); -// node_modules/@azure/core-lro/dist/commonjs/logger.js -var require_logger = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/logger.js"(exports2) { +// node_modules/@azure/storage-blob/dist/commonjs/policies/RequestPolicy.js +var require_RequestPolicy = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/policies/RequestPolicy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.logger = void 0; - var logger_1 = require_commonjs(); - exports2.logger = (0, logger_1.createClientLogger)("core-lro"); - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/poller/constants.js -var require_constants9 = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/poller/constants.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.terminalStates = exports2.POLL_INTERVAL_IN_MS = void 0; - exports2.POLL_INTERVAL_IN_MS = 2e3; - exports2.terminalStates = ["succeeded", "canceled", "failed"]; - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/poller/operation.js -var require_operation = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/poller/operation.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.pollOperation = exports2.initOperation = exports2.deserializeState = void 0; - var logger_js_1 = require_logger(); - var constants_js_1 = require_constants9(); - function deserializeState(serializedState) { - try { - return JSON.parse(serializedState).state; - } catch (e) { - throw new Error(`Unable to deserialize input state: ${serializedState}`); - } - } - __name(deserializeState, "deserializeState"); - exports2.deserializeState = deserializeState; - function setStateError(inputs) { - const { state, stateProxy, isOperationError } = inputs; - return (error) => { - if (isOperationError(error)) { - stateProxy.setError(state, error); - stateProxy.setFailed(state); - } - throw error; - }; - } - __name(setStateError, "setStateError"); - function appendReadableErrorMessage(currentMessage, innerMessage) { - let message = currentMessage; - if (message.slice(-1) !== ".") { - message = message + "."; - } - return message + " " + innerMessage; - } - __name(appendReadableErrorMessage, "appendReadableErrorMessage"); - function simplifyError(err) { - let message = err.message; - let code = err.code; - let curErr = err; - while (curErr.innererror) { - curErr = curErr.innererror; - code = curErr.code; - message = appendReadableErrorMessage(message, curErr.message); - } - return { - code, - message - }; - } - __name(simplifyError, "simplifyError"); - function processOperationStatus(result) { - const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result; - switch (status) { - case "succeeded": { - stateProxy.setSucceeded(state); - break; - } - case "failed": { - const err = getError === null || getError === void 0 ? void 0 : getError(response); - let postfix = ""; - if (err) { - const { code, message } = simplifyError(err); - postfix = `. ${code}. ${message}`; - } - const errStr = `The long-running operation has failed${postfix}`; - stateProxy.setError(state, new Error(errStr)); - stateProxy.setFailed(state); - logger_js_1.logger.warning(errStr); - break; - } - case "canceled": { - stateProxy.setCanceled(state); - break; - } - } - if ((isDone === null || isDone === void 0 ? void 0 : isDone(response, state)) || isDone === void 0 && ["succeeded", "canceled"].concat(setErrorAsResult ? [] : ["failed"]).includes(status)) { - stateProxy.setResult(state, buildResult({ - response, - state, - processResult - })); - } - } - __name(processOperationStatus, "processOperationStatus"); - function buildResult(inputs) { - const { processResult, response, state } = inputs; - return processResult ? processResult(response, state) : response; - } - __name(buildResult, "buildResult"); - async function initOperation(inputs) { - const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init(); - if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - const config = { - metadata, - operationLocation, - resourceLocation - }; - logger_js_1.logger.verbose(`LRO: Operation description:`, config); - const state = stateProxy.initState(config); - const status = getOperationStatus({ response, state, operationLocation }); - processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); - return state; - } - __name(initOperation, "initOperation"); - exports2.initOperation = initOperation; - async function pollOperationHelper(inputs) { - const { poll, state, stateProxy, operationLocation, getOperationStatus, getResourceLocation, isOperationError, options } = inputs; - const response = await poll(operationLocation, options).catch(setStateError({ - state, - stateProxy, - isOperationError - })); - const status = getOperationStatus(response, state); - logger_js_1.logger.verbose(`LRO: Status: - Polling from: ${state.config.operationLocation} - Operation status: ${status} - Polling status: ${constants_js_1.terminalStates.includes(status) ? "Stopped" : "Running"}`); - if (status === "succeeded") { - const resourceLocation = getResourceLocation(response, state); - if (resourceLocation !== void 0) { - return { - response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError })), - status - }; - } - } - return { response, status }; - } - __name(pollOperationHelper, "pollOperationHelper"); - async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult } = inputs; - const { operationLocation } = state.config; - if (operationLocation !== void 0) { - const { response, status } = await pollOperationHelper({ - poll, - getOperationStatus, - state, - stateProxy, - operationLocation, - getResourceLocation, - isOperationError, - options - }); - processOperationStatus({ - status, - response, - state, - stateProxy, - isDone, - processResult, - getError, - setErrorAsResult - }); - if (!constants_js_1.terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); - if (intervalInMs) - setDelay(intervalInMs); - const location = getOperationLocation === null || getOperationLocation === void 0 ? void 0 : getOperationLocation(response, state); - if (location !== void 0) { - const isUpdated = operationLocation !== location; - state.config.operationLocation = location; - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(location, isUpdated); - } else - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - } - updateState === null || updateState === void 0 ? void 0 : updateState(state, response); - } - } - __name(pollOperation, "pollOperation"); - exports2.pollOperation = pollOperation; - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/http/operation.js -var require_operation2 = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/http/operation.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.pollHttpOperation = exports2.isOperationError = exports2.getResourceLocation = exports2.getOperationStatus = exports2.getOperationLocation = exports2.initHttpOperation = exports2.getStatusFromInitialResponse = exports2.getErrorFromResponse = exports2.parseRetryAfter = exports2.inferLroMode = void 0; - var operation_js_1 = require_operation(); - var logger_js_1 = require_logger(); - function getOperationLocationPollingUrl(inputs) { - const { azureAsyncOperation, operationLocation } = inputs; - return operationLocation !== null && operationLocation !== void 0 ? operationLocation : azureAsyncOperation; - } - __name(getOperationLocationPollingUrl, "getOperationLocationPollingUrl"); - function getLocationHeader(rawResponse) { - return rawResponse.headers["location"]; - } - __name(getLocationHeader, "getLocationHeader"); - function getOperationLocationHeader(rawResponse) { - return rawResponse.headers["operation-location"]; - } - __name(getOperationLocationHeader, "getOperationLocationHeader"); - function getAzureAsyncOperationHeader(rawResponse) { - return rawResponse.headers["azure-asyncoperation"]; - } - __name(getAzureAsyncOperationHeader, "getAzureAsyncOperationHeader"); - function findResourceLocation(inputs) { - var _a; - const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; - switch (requestMethod) { - case "PUT": { - return requestPath; - } - case "DELETE": { - return void 0; - } - case "PATCH": { - return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; - } - default: { - return getDefault(); - } - } - function getDefault() { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return void 0; - } - case "original-uri": { - return requestPath; - } - case "location": - default: { - return location; - } - } - } - __name(getDefault, "getDefault"); - } - __name(findResourceLocation, "findResourceLocation"); - function inferLroMode(inputs) { - const { rawResponse, requestMethod, requestPath, resourceLocationConfig } = inputs; - const operationLocation = getOperationLocationHeader(rawResponse); - const azureAsyncOperation = getAzureAsyncOperationHeader(rawResponse); - const pollingUrl = getOperationLocationPollingUrl({ operationLocation, azureAsyncOperation }); - const location = getLocationHeader(rawResponse); - const normalizedRequestMethod = requestMethod === null || requestMethod === void 0 ? void 0 : requestMethod.toLocaleUpperCase(); - if (pollingUrl !== void 0) { - return { - mode: "OperationLocation", - operationLocation: pollingUrl, - resourceLocation: findResourceLocation({ - requestMethod: normalizedRequestMethod, - location, - requestPath, - resourceLocationConfig - }) - }; - } else if (location !== void 0) { - return { - mode: "ResourceLocation", - operationLocation: location - }; - } else if (normalizedRequestMethod === "PUT" && requestPath) { - return { - mode: "Body", - operationLocation: requestPath - }; - } else { - return void 0; - } - } - __name(inferLroMode, "inferLroMode"); - exports2.inferLroMode = inferLroMode; - function transformStatus(inputs) { - const { status, statusCode } = inputs; - if (typeof status !== "string" && status !== void 0) { - throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${status}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`); - } - switch (status === null || status === void 0 ? void 0 : status.toLocaleLowerCase()) { - case void 0: - return toOperationStatus(statusCode); - case "succeeded": - return "succeeded"; - case "failed": - return "failed"; - case "running": - case "accepted": - case "started": - case "canceling": - case "cancelling": - return "running"; - case "canceled": - case "cancelled": - return "canceled"; - default: { - logger_js_1.logger.verbose(`LRO: unrecognized operation status: ${status}`); - return status; - } - } - } - __name(transformStatus, "transformStatus"); - function getStatus(rawResponse) { - var _a; - const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - return transformStatus({ status, statusCode: rawResponse.statusCode }); - } - __name(getStatus, "getStatus"); - function getProvisioningState(rawResponse) { - var _a, _b; - const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - const status = (_b = properties === null || properties === void 0 ? void 0 : properties.provisioningState) !== null && _b !== void 0 ? _b : provisioningState; - return transformStatus({ status, statusCode: rawResponse.statusCode }); - } - __name(getProvisioningState, "getProvisioningState"); - function toOperationStatus(statusCode) { - if (statusCode === 202) { - return "running"; - } else if (statusCode < 300) { - return "succeeded"; - } else { - return "failed"; - } - } - __name(toOperationStatus, "toOperationStatus"); - function parseRetryAfter({ rawResponse }) { - const retryAfter = rawResponse.headers["retry-after"]; - if (retryAfter !== void 0) { - const retryAfterInSeconds = parseInt(retryAfter); - return isNaN(retryAfterInSeconds) ? calculatePollingIntervalFromDate(new Date(retryAfter)) : retryAfterInSeconds * 1e3; - } - return void 0; - } - __name(parseRetryAfter, "parseRetryAfter"); - exports2.parseRetryAfter = parseRetryAfter; - function getErrorFromResponse(response) { - const error = accessBodyProperty(response, "error"); - if (!error) { - logger_js_1.logger.warning(`The long-running operation failed but there is no error property in the response's body`); - return; - } - if (!error.code || !error.message) { - logger_js_1.logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); - return; - } - return error; - } - __name(getErrorFromResponse, "getErrorFromResponse"); - exports2.getErrorFromResponse = getErrorFromResponse; - function calculatePollingIntervalFromDate(retryAfterDate) { - const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); - const retryAfterTime = retryAfterDate.getTime(); - if (timeNow < retryAfterTime) { - return retryAfterTime - timeNow; - } - return void 0; - } - __name(calculatePollingIntervalFromDate, "calculatePollingIntervalFromDate"); - function getStatusFromInitialResponse(inputs) { - const { response, state, operationLocation } = inputs; - function helper() { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case void 0: - return toOperationStatus(response.rawResponse.statusCode); - case "Body": - return getOperationStatus(response, state); - default: - return "running"; - } - } - __name(helper, "helper"); - const status = helper(); - return status === "running" && operationLocation === void 0 ? "succeeded" : status; - } - __name(getStatusFromInitialResponse, "getStatusFromInitialResponse"); - exports2.getStatusFromInitialResponse = getStatusFromInitialResponse; - async function initHttpOperation(inputs) { - const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; - return (0, operation_js_1.initOperation)({ - init: async () => { - const response = await lro.sendInitialRequest(); - const config = inferLroMode({ - rawResponse: response.rawResponse, - requestPath: lro.requestPath, - requestMethod: lro.requestMethod, - resourceLocationConfig - }); - return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, (config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {}); - }, - stateProxy, - processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse, - getOperationStatus: getStatusFromInitialResponse, - setErrorAsResult - }); - } - __name(initHttpOperation, "initHttpOperation"); - exports2.initHttpOperation = initHttpOperation; - function getOperationLocation({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getOperationLocationPollingUrl({ - operationLocation: getOperationLocationHeader(rawResponse), - azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) - }); - } - case "ResourceLocation": { - return getLocationHeader(rawResponse); - } - case "Body": - default: { - return void 0; - } - } - } - __name(getOperationLocation, "getOperationLocation"); - exports2.getOperationLocation = getOperationLocation; - function getOperationStatus({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getStatus(rawResponse); - } - case "ResourceLocation": { - return toOperationStatus(rawResponse.statusCode); - } - case "Body": { - return getProvisioningState(rawResponse); - } - default: - throw new Error(`Internal error: Unexpected operation mode: ${mode}`); - } - } - __name(getOperationStatus, "getOperationStatus"); - exports2.getOperationStatus = getOperationStatus; - function accessBodyProperty({ flatResponse, rawResponse }, prop) { - var _a, _b; - return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_b = rawResponse.body) === null || _b === void 0 ? void 0 : _b[prop]; - } - __name(accessBodyProperty, "accessBodyProperty"); - function getResourceLocation(res, state) { - const loc = accessBodyProperty(res, "resourceLocation"); - if (loc && typeof loc === "string") { - state.config.resourceLocation = loc; - } - return state.config.resourceLocation; - } - __name(getResourceLocation, "getResourceLocation"); - exports2.getResourceLocation = getResourceLocation; - function isOperationError(e) { - return e.name === "RestError"; - } - __name(isOperationError, "isOperationError"); - exports2.isOperationError = isOperationError; - async function pollHttpOperation(inputs) { - const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult } = inputs; - return (0, operation_js_1.pollOperation)({ - state, - stateProxy, - setDelay, - processResult: processResult ? ({ flatResponse }, inputState) => processResult(flatResponse, inputState) : ({ flatResponse }) => flatResponse, - getError: getErrorFromResponse, - updateState, - getPollingInterval: parseRetryAfter, - getOperationLocation, - getOperationStatus, - isOperationError, - getResourceLocation, - options, - /** - * The expansion here is intentional because `lro` could be an object that - * references an inner this, so we need to preserve a reference to it. - */ - poll: async (location, inputOptions) => lro.sendPollRequest(location, inputOptions), - setErrorAsResult - }); - } - __name(pollHttpOperation, "pollHttpOperation"); - exports2.pollHttpOperation = pollHttpOperation; - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/poller/poller.js -var require_poller = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/poller/poller.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.buildCreatePoller = void 0; - var operation_js_1 = require_operation(); - var constants_js_1 = require_constants9(); - var core_util_1 = require_commonjs3(); - var createStateProxy = /* @__PURE__ */ __name(() => ({ - /** - * The state at this point is created to be of type OperationState. - * It will be updated later to be of type TState when the - * customer-provided callback, `updateState`, is called during polling. - */ - initState: (config) => ({ status: "running", config }), - setCanceled: (state) => state.status = "canceled", - setError: (state, error) => state.error = error, - setResult: (state, result) => state.result = result, - setRunning: (state) => state.status = "running", - setSucceeded: (state) => state.status = "succeeded", - setFailed: (state) => state.status = "failed", - getError: (state) => state.error, - getResult: (state) => state.result, - isCanceled: (state) => state.status === "canceled", - isFailed: (state) => state.status === "failed", - isRunning: (state) => state.status === "running", - isSucceeded: (state) => state.status === "succeeded" - }), "createStateProxy"); - function buildCreatePoller(inputs) { - const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, getError, resolveOnUnsuccessful } = inputs; - return async ({ init, poll }, options) => { - const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = constants_js_1.POLL_INTERVAL_IN_MS, restoreFrom } = options || {}; - const stateProxy = createStateProxy(); - const withOperationLocation = withOperationLocationCallback ? /* @__PURE__ */ (() => { - let called = false; - return (operationLocation, isUpdated) => { - if (isUpdated) - withOperationLocationCallback(operationLocation); - else if (!called) - withOperationLocationCallback(operationLocation); - called = true; - }; - })() : void 0; - const state = restoreFrom ? (0, operation_js_1.deserializeState)(restoreFrom) : await (0, operation_js_1.initOperation)({ - init, - stateProxy, - processResult, - getOperationStatus: getStatusFromInitialResponse, - withOperationLocation, - setErrorAsResult: !resolveOnUnsuccessful - }); - let resultPromise; - const abortController = new AbortController(); - const handlers = /* @__PURE__ */ new Map(); - const handleProgressEvents = /* @__PURE__ */ __name(async () => handlers.forEach((h) => h(state)), "handleProgressEvents"); - const cancelErrMsg = "Operation was canceled"; - let currentPollIntervalInMs = intervalInMs; - const poller = { - getOperationState: () => state, - getResult: () => state.result, - isDone: () => ["succeeded", "failed", "canceled"].includes(state.status), - isStopped: () => resultPromise === void 0, - stopPolling: () => { - abortController.abort(); - }, - toString: () => JSON.stringify({ - state - }), - onProgress: (callback) => { - const s = Symbol(); - handlers.set(s, callback); - return () => handlers.delete(s); - }, - pollUntilDone: (pollOptions) => resultPromise !== null && resultPromise !== void 0 ? resultPromise : resultPromise = (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - function abortListener() { - abortController.abort(); - } - __name(abortListener, "abortListener"); - const abortSignal = abortController.signal; - if (inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.aborted) { - abortController.abort(); - } else if (!abortSignal.aborted) { - inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.addEventListener("abort", abortListener, { once: true }); - } - try { - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await (0, core_util_1.delay)(currentPollIntervalInMs, { abortSignal }); - await poller.poll({ abortSignal }); - } - } - } finally { - inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.removeEventListener("abort", abortListener); - } - if (resolveOnUnsuccessful) { - return poller.getResult(); - } else { - switch (state.status) { - case "succeeded": - return poller.getResult(); - case "canceled": - throw new Error(cancelErrMsg); - case "failed": - throw state.error; - case "notStarted": - case "running": - throw new Error(`Polling completed without succeeding or failing`); - } - } - })().finally(() => { - resultPromise = void 0; - }), - async poll(pollOptions) { - if (resolveOnUnsuccessful) { - if (poller.isDone()) - return; - } else { - switch (state.status) { - case "succeeded": - return; - case "canceled": - throw new Error(cancelErrMsg); - case "failed": - throw state.error; - } - } - await (0, operation_js_1.pollOperation)({ - poll, - state, - stateProxy, - getOperationLocation, - isOperationError, - withOperationLocation, - getPollingInterval, - getOperationStatus: getStatusFromPollResponse, - getResourceLocation, - processResult, - getError, - updateState, - options: pollOptions, - setDelay: (pollIntervalInMs) => { - currentPollIntervalInMs = pollIntervalInMs; - }, - setErrorAsResult: !resolveOnUnsuccessful - }); - await handleProgressEvents(); - if (!resolveOnUnsuccessful) { - switch (state.status) { - case "canceled": - throw new Error(cancelErrMsg); - case "failed": - throw state.error; - } - } - } - }; - return poller; - }; - } - __name(buildCreatePoller, "buildCreatePoller"); - exports2.buildCreatePoller = buildCreatePoller; - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/http/poller.js -var require_poller2 = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/http/poller.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createHttpPoller = void 0; - var operation_js_1 = require_operation2(); - var poller_js_1 = require_poller(); - async function createHttpPoller(lro, options) { - const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false } = options || {}; - return (0, poller_js_1.buildCreatePoller)({ - getStatusFromInitialResponse: operation_js_1.getStatusFromInitialResponse, - getStatusFromPollResponse: operation_js_1.getOperationStatus, - isOperationError: operation_js_1.isOperationError, - getOperationLocation: operation_js_1.getOperationLocation, - getResourceLocation: operation_js_1.getResourceLocation, - getPollingInterval: operation_js_1.parseRetryAfter, - getError: operation_js_1.getErrorFromResponse, - resolveOnUnsuccessful - })({ - init: async () => { - const response = await lro.sendInitialRequest(); - const config = (0, operation_js_1.inferLroMode)({ - rawResponse: response.rawResponse, - requestPath: lro.requestPath, - requestMethod: lro.requestMethod, - resourceLocationConfig - }); - return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, (config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {}); - }, - poll: lro.sendPollRequest - }, { - intervalInMs, - withOperationLocation, - restoreFrom, - updateState, - processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse - }); - } - __name(createHttpPoller, "createHttpPoller"); - exports2.createHttpPoller = createHttpPoller; - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/operation.js -var require_operation3 = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/operation.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.GenericPollOperation = void 0; - var operation_js_1 = require_operation2(); - var logger_js_1 = require_logger(); - var createStateProxy = /* @__PURE__ */ __name(() => ({ - initState: (config) => ({ config, isStarted: true }), - setCanceled: (state) => state.isCancelled = true, - setError: (state, error) => state.error = error, - setResult: (state, result) => state.result = result, - setRunning: (state) => state.isStarted = true, - setSucceeded: (state) => state.isCompleted = true, - setFailed: () => { - }, - getError: (state) => state.error, - getResult: (state) => state.result, - isCanceled: (state) => !!state.isCancelled, - isFailed: (state) => !!state.error, - isRunning: (state) => !!state.isStarted, - isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error) - }), "createStateProxy"); - var GenericPollOperation = class { - static { - __name(this, "GenericPollOperation"); - } - constructor(state, lro, setErrorAsResult, lroResourceLocationConfig, processResult, updateState, isDone) { - this.state = state; - this.lro = lro; - this.setErrorAsResult = setErrorAsResult; - this.lroResourceLocationConfig = lroResourceLocationConfig; - this.processResult = processResult; - this.updateState = updateState; - this.isDone = isDone; - } - setPollerConfig(pollerConfig) { - this.pollerConfig = pollerConfig; - } - async update(options) { - var _a; - const stateProxy = createStateProxy(); - if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), await (0, operation_js_1.initHttpOperation)({ - lro: this.lro, - stateProxy, - resourceLocationConfig: this.lroResourceLocationConfig, - processResult: this.processResult, - setErrorAsResult: this.setErrorAsResult - })); - } - const updateState = this.updateState; - const isDone = this.isDone; - if (!this.state.isCompleted && this.state.error === void 0) { - await (0, operation_js_1.pollHttpOperation)({ - lro: this.lro, - state: this.state, - stateProxy, - processResult: this.processResult, - updateState: updateState ? (state, { rawResponse }) => updateState(state, rawResponse) : void 0, - isDone: isDone ? ({ flatResponse }, state) => isDone(flatResponse, state) : void 0, - options, - setDelay: (intervalInMs) => { - this.pollerConfig.intervalInMs = intervalInMs; - }, - setErrorAsResult: this.setErrorAsResult - }); - } - (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); - return this; - } - async cancel() { - logger_js_1.logger.error("`cancelOperation` is deprecated because it wasn't implemented"); - return this; - } - /** - * Serializes the Poller operation. - */ - toString() { - return JSON.stringify({ - state: this.state - }); - } - }; - exports2.GenericPollOperation = GenericPollOperation; - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/legacy/poller.js -var require_poller3 = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/legacy/poller.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Poller = exports2.PollerCancelledError = exports2.PollerStoppedError = void 0; - var PollerStoppedError = class _PollerStoppedError extends Error { - static { - __name(this, "PollerStoppedError"); - } - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, _PollerStoppedError.prototype); - } - }; - exports2.PollerStoppedError = PollerStoppedError; - var PollerCancelledError = class _PollerCancelledError extends Error { - static { - __name(this, "PollerCancelledError"); - } - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, _PollerCancelledError.prototype); - } - }; - exports2.PollerCancelledError = PollerCancelledError; - var Poller = class { - static { - __name(this, "Poller"); - } - /** - * 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`. - */ - constructor(operation) { - this.resolveOnUnsuccessful = false; - this.stopped = true; - this.pollProgressCallbacks = []; - this.operation = operation; - this.promise = new Promise((resolve, reject) => { - this.resolve = resolve; - this.reject = reject; - }); - this.promise.catch(() => { - }); - } - /** - * Starts a loop that will break only if the poller is done - * or if the poller is stopped. - */ - async startPolling(pollOptions = {}) { - if (this.stopped) { - this.stopped = false; - } - while (!this.isStopped() && !this.isDone()) { - await this.poll(pollOptions); - await this.delay(); - } - } - /** - * 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. - * - * @param options - Optional properties passed to the operation's update method. - */ - async pollOnce(options = {}) { - if (!this.isDone()) { - this.operation = await this.operation.update({ - abortSignal: options.abortSignal, - fireProgress: this.fireProgress.bind(this) - }); - } - 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. - * - * @param state - The current operation state. - */ - fireProgress(state) { - for (const callback of this.pollProgressCallbacks) { - callback(state); - } - } - /** - * 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. - * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. - * - * @param options - Optional properties passed to the operation's update method. - */ - poll(options = {}) { - if (!this.pollOncePromise) { - this.pollOncePromise = this.pollOnce(options); - const clearPollOncePromise = /* @__PURE__ */ __name(() => { - this.pollOncePromise = void 0; - }, "clearPollOncePromise"); - 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()); - } - } - /** - * Returns a promise that will resolve once the underlying operation is completed. - */ - async pollUntilDone(pollOptions = {}) { - if (this.stopped) { - this.startPolling(pollOptions).catch(this.reject); - } - this.processUpdatedState(); - return this.promise; - } - /** - * Invokes the provided callback after each polling is completed, - * sending the current state of the poller's operation. - * - * It returns a method that can be used to stop receiving updates on the given callback function. - */ - onProgress(callback) { - this.pollProgressCallbacks.push(callback); - return () => { - this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); - }; - } - /** - * Returns true if the poller has finished polling. - */ - isDone() { - const state = this.operation.state; - return Boolean(state.isCompleted || state.isCancelled || state.error); - } - /** - * Stops the poller from continuing to poll. - */ - stopPolling() { - if (!this.stopped) { - this.stopped = true; - if (this.reject) { - this.reject(new PollerStoppedError("This poller is already stopped")); - } - } - } - /** - * Returns true if the poller is stopped. - */ - isStopped() { - return this.stopped; - } - /** - * 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. - * - * @param options - Optional properties passed to the operation's update method. - */ - 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; - } - /** - * 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; - * } - * - * // 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; - } - /** - * 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(); - } - }; - exports2.Poller = Poller; - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/lroEngine.js -var require_lroEngine = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/lroEngine.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.LroEngine = void 0; - var operation_js_1 = require_operation3(); - var constants_js_1 = require_constants9(); - var poller_js_1 = require_poller3(); - var operation_js_2 = require_operation(); - var LroEngine = class extends poller_js_1.Poller { - static { - __name(this, "LroEngine"); - } - constructor(lro, options) { - const { intervalInMs = constants_js_1.POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState } = options || {}; - const state = resumeFrom ? (0, operation_js_2.deserializeState)(resumeFrom) : {}; - const operation = new operation_js_1.GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); - super(operation); - this.resolveOnUnsuccessful = resolveOnUnsuccessful; - this.config = { intervalInMs }; - operation.setPollerConfig(this.config); - } - /** - * The method used by the poller to wait before attempting to update its operation. - */ - delay() { - return new Promise((resolve) => setTimeout(() => resolve(), this.config.intervalInMs)); - } - }; - exports2.LroEngine = LroEngine; - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/index.js -var require_lroEngine2 = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.LroEngine = void 0; - var lroEngine_js_1 = require_lroEngine(); - Object.defineProperty(exports2, "LroEngine", { enumerable: true, get: function() { - return lroEngine_js_1.LroEngine; - } }); - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/legacy/pollOperation.js -var require_pollOperation = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/legacy/pollOperation.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/@azure/core-lro/dist/commonjs/index.js -var require_commonjs12 = __commonJS({ - "node_modules/@azure/core-lro/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createHttpPoller = void 0; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var poller_js_1 = require_poller2(); - Object.defineProperty(exports2, "createHttpPoller", { enumerable: true, get: function() { - return poller_js_1.createHttpPoller; - } }); - tslib_1.__exportStar(require_lroEngine2(), exports2); - tslib_1.__exportStar(require_poller3(), exports2); - tslib_1.__exportStar(require_pollOperation(), exports2); - } -}); - -// node_modules/@azure/storage-blob/dist/index.js -var require_dist4 = __commonJS({ - "node_modules/@azure/storage-blob/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var coreRestPipeline = require_commonjs6(); - var tslib = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var coreAuth = require_commonjs7(); - var coreUtil = require_commonjs3(); - var coreHttpCompat = require_commonjs9(); - var coreClient = require_commonjs8(); - var coreXml = require_commonjs10(); - var logger$1 = require_commonjs(); - var abortController = require_commonjs11(); - var crypto4 = require("crypto"); - var coreTracing = require_commonjs5(); - var stream = require("stream"); - var coreLro = require_commonjs12(); - var events = require("events"); - var fs = require("fs"); - var util = require("util"); - var buffer = require("buffer"); - function _interopNamespaceDefault(e) { - var n = /* @__PURE__ */ Object.create(null); - if (e) { - Object.keys(e).forEach(function(k) { - if (k !== "default") { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function() { - return e[k]; - } - }); - } - }); - } - n.default = e; - return Object.freeze(n); - } - __name(_interopNamespaceDefault, "_interopNamespaceDefault"); - var coreHttpCompat__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreHttpCompat); - var coreClient__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreClient); - var fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs); - var util__namespace = /* @__PURE__ */ _interopNamespaceDefault(util); - var logger = logger$1.createClientLogger("storage-blob"); + exports2.BaseRequestPolicy = void 0; var BaseRequestPolicy = class { static { __name(this, "BaseRequestPolicy"); } + _nextPolicy; + _options; /** * The main method to implement that manipulates a request/response. */ @@ -37517,17 +37296,27 @@ var require_dist4 = __commonJS({ this._options.log(logLevel, message); } }; - var SDK_VERSION = "12.25.0"; - var SERVICE_VERSION = "2024-11-04"; - var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; - var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; - var BLOCK_BLOB_MAX_BLOCKS = 5e4; - var DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; - var DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; - var DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; - var REQUEST_TIMEOUT = 100 * 1e3; - var StorageOAuthScopes = "https://storage.azure.com/.default"; - var URLConstants = { + exports2.BaseRequestPolicy = BaseRequestPolicy; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/constants.js +var require_constants10 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/utils/constants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.PathStylePorts = exports2.BlobDoesNotUseCustomerSpecifiedEncryption = exports2.BlobUsesCustomerSpecifiedEncryptionMsg = exports2.StorageBlobLoggingAllowedQueryParameters = exports2.StorageBlobLoggingAllowedHeaderNames = exports2.DevelopmentConnectionString = exports2.EncryptionAlgorithmAES25 = exports2.HTTP_VERSION_1_1 = exports2.HTTP_LINE_ENDING = exports2.BATCH_MAX_PAYLOAD_IN_BYTES = exports2.BATCH_MAX_REQUEST = exports2.SIZE_1_MB = exports2.ETagAny = exports2.ETagNone = exports2.HeaderConstants = exports2.HTTPURLConnection = exports2.URLConstants = exports2.StorageOAuthScopes = exports2.REQUEST_TIMEOUT = exports2.DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = exports2.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = exports2.DEFAULT_BLOCK_BUFFER_SIZE_BYTES = exports2.BLOCK_BLOB_MAX_BLOCKS = exports2.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = exports2.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = exports2.SERVICE_VERSION = exports2.SDK_VERSION = void 0; + exports2.SDK_VERSION = "12.29.1"; + exports2.SERVICE_VERSION = "2025-11-05"; + exports2.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; + exports2.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; + exports2.BLOCK_BLOB_MAX_BLOCKS = 5e4; + exports2.DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; + exports2.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; + exports2.DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; + exports2.REQUEST_TIMEOUT = 100 * 1e3; + exports2.StorageOAuthScopes = "https://storage.azure.com/.default"; + exports2.URLConstants = { Parameters: { FORCE_BROWSER_NO_CACHE: "_", SIGNATURE: "sig", @@ -37536,14 +37325,14 @@ var require_dist4 = __commonJS({ TIMEOUT: "timeout" } }; - var HTTPURLConnection = { + exports2.HTTPURLConnection = { HTTP_ACCEPTED: 202, HTTP_CONFLICT: 409, HTTP_NOT_FOUND: 404, HTTP_PRECON_FAILED: 412, HTTP_RANGE_NOT_SATISFIABLE: 416 }; - var HeaderConstants = { + exports2.HeaderConstants = { AUTHORIZATION: "Authorization", AUTHORIZATION_SCHEME: "Bearer", CONTENT_ENCODING: "Content-Encoding", @@ -37569,16 +37358,16 @@ var require_dist4 = __commonJS({ X_MS_VERSION: "x-ms-version", X_MS_CopySourceErrorCode: "x-ms-copy-source-error-code" }; - var ETagNone = ""; - var ETagAny = "*"; - var SIZE_1_MB = 1 * 1024 * 1024; - var BATCH_MAX_REQUEST = 256; - var BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; - var HTTP_LINE_ENDING = "\r\n"; - var HTTP_VERSION_1_1 = "HTTP/1.1"; - var EncryptionAlgorithmAES25 = "AES256"; - var DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; - var StorageBlobLoggingAllowedHeaderNames = [ + exports2.ETagNone = ""; + exports2.ETagAny = "*"; + exports2.SIZE_1_MB = 1 * 1024 * 1024; + exports2.BATCH_MAX_REQUEST = 256; + exports2.BATCH_MAX_PAYLOAD_IN_BYTES = 4 * exports2.SIZE_1_MB; + exports2.HTTP_LINE_ENDING = "\r\n"; + exports2.HTTP_VERSION_1_1 = "HTTP/1.1"; + exports2.EncryptionAlgorithmAES25 = "AES256"; + exports2.DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; + exports2.StorageBlobLoggingAllowedHeaderNames = [ "Access-Control-Allow-Origin", "Cache-Control", "Content-Length", @@ -37676,7 +37465,7 @@ var require_dist4 = __commonJS({ "x-ms-if-tags", "x-ms-source-if-tags" ]; - var StorageBlobLoggingAllowedQueryParameters = [ + exports2.StorageBlobLoggingAllowedQueryParameters = [ "comp", "maxresults", "rscc", @@ -37711,9 +37500,9 @@ var require_dist4 = __commonJS({ "skv", "snapshot" ]; - var BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; - var BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; - var PathStylePorts = [ + exports2.BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; + exports2.BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; + exports2.PathStylePorts = [ "10000", "10001", "10002", @@ -37735,8 +37524,55 @@ var require_dist4 = __commonJS({ "11103", "11104" ]; - function escapeURLPath(url2) { - const urlParsed = new URL(url2); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/utils.common.js +var require_utils_common = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/utils/utils.common.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.escapeURLPath = escapeURLPath; + exports2.getValueInConnString = getValueInConnString; + exports2.extractConnectionStringParts = extractConnectionStringParts; + exports2.appendToURLPath = appendToURLPath; + exports2.setURLParameter = setURLParameter; + exports2.getURLParameter = getURLParameter; + exports2.setURLHost = setURLHost; + exports2.getURLPath = getURLPath; + exports2.getURLScheme = getURLScheme; + exports2.getURLPathAndQuery = getURLPathAndQuery; + exports2.getURLQueries = getURLQueries; + exports2.appendToURLQuery = appendToURLQuery; + exports2.truncatedISO8061Date = truncatedISO8061Date; + exports2.base64encode = base64encode; + exports2.base64decode = base64decode; + exports2.generateBlockID = generateBlockID; + exports2.delay = delay; + exports2.padStart = padStart; + exports2.sanitizeURL = sanitizeURL; + exports2.sanitizeHeaders = sanitizeHeaders; + exports2.iEqual = iEqual; + exports2.getAccountNameFromUrl = getAccountNameFromUrl; + exports2.isIpEndpointStyle = isIpEndpointStyle; + exports2.toBlobTagsString = toBlobTagsString; + exports2.toBlobTags = toBlobTags; + exports2.toTags = toTags; + exports2.toQuerySerialization = toQuerySerialization; + exports2.parseObjectReplicationRecord = parseObjectReplicationRecord; + exports2.attachCredential = attachCredential; + exports2.httpAuthorizationToString = httpAuthorizationToString; + exports2.BlobNameToString = BlobNameToString; + exports2.ConvertInternalResponseOfListBlobFlat = ConvertInternalResponseOfListBlobFlat; + exports2.ConvertInternalResponseOfListBlobHierarchy = ConvertInternalResponseOfListBlobHierarchy; + exports2.ExtractPageRangeInfoItems = ExtractPageRangeInfoItems; + exports2.EscapePath = EscapePath; + exports2.assertResponse = assertResponse; + var core_rest_pipeline_1 = require_commonjs6(); + var core_util_1 = require_commonjs4(); + var constants_js_1 = require_constants10(); + function escapeURLPath(url) { + const urlParsed = new URL(url); let path2 = urlParsed.pathname; path2 = path2 || "/"; path2 = escape(path2); @@ -37771,7 +37607,7 @@ var require_dist4 = __commonJS({ let proxyUri = ""; if (connectionString.startsWith("UseDevelopmentStorage=true")) { proxyUri = getProxyUriFromDevConnString(connectionString); - connectionString = DevelopmentConnectionString; + connectionString = constants_js_1.DevelopmentConnectionString; } let blobEndpoint = getValueInConnString(connectionString, "BlobEndpoint"); blobEndpoint = blobEndpoint.endsWith("/") ? blobEndpoint.slice(0, -1) : blobEndpoint; @@ -37828,16 +37664,16 @@ var require_dist4 = __commonJS({ return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); } __name(escape, "escape"); - function appendToURLPath(url2, name) { - const urlParsed = new URL(url2); + function appendToURLPath(url, name) { + const urlParsed = new URL(url); let path2 = urlParsed.pathname; path2 = path2 ? path2.endsWith("/") ? `${path2}${name}` : `${path2}/${name}` : name; urlParsed.pathname = path2; return urlParsed.toString(); } __name(appendToURLPath, "appendToURLPath"); - function setURLParameter(url2, name, value) { - const urlParsed = new URL(url2); + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); const encodedName = encodeURIComponent(name); const encodedValue = value ? encodeURIComponent(value) : void 0; const searchString = urlParsed.search === "" ? "?" : urlParsed.search; @@ -37857,38 +37693,37 @@ var require_dist4 = __commonJS({ return urlParsed.toString(); } __name(setURLParameter, "setURLParameter"); - function getURLParameter(url2, name) { - var _a; - const urlParsed = new URL(url2); - return (_a = urlParsed.searchParams.get(name)) !== null && _a !== void 0 ? _a : void 0; + function getURLParameter(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; } __name(getURLParameter, "getURLParameter"); - function setURLHost(url2, host) { - const urlParsed = new URL(url2); + function setURLHost(url, host) { + const urlParsed = new URL(url); urlParsed.hostname = host; return urlParsed.toString(); } __name(setURLHost, "setURLHost"); - function getURLPath(url2) { + function getURLPath(url) { try { - const urlParsed = new URL(url2); + const urlParsed = new URL(url); return urlParsed.pathname; } catch (e) { return void 0; } } __name(getURLPath, "getURLPath"); - function getURLScheme(url2) { + function getURLScheme(url) { try { - const urlParsed = new URL(url2); + const urlParsed = new URL(url); return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; } catch (e) { return void 0; } } __name(getURLScheme, "getURLScheme"); - function getURLPathAndQuery(url2) { - const urlParsed = new URL(url2); + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); const pathString = urlParsed.pathname; if (!pathString) { throw new RangeError("Invalid url without valid path."); @@ -37901,8 +37736,8 @@ var require_dist4 = __commonJS({ return `${pathString}${queryString}`; } __name(getURLPathAndQuery, "getURLPathAndQuery"); - function getURLQueries(url2) { - let queryString = new URL(url2).search; + function getURLQueries(url) { + let queryString = new URL(url).search; if (!queryString) { return {}; } @@ -37924,8 +37759,8 @@ var require_dist4 = __commonJS({ return queries; } __name(getURLQueries, "getURLQueries"); - function appendToURLQuery(url2, queryParts) { - const urlParsed = new URL(url2); + function appendToURLQuery(url, queryParts) { + const urlParsed = new URL(url); let query = urlParsed.search; if (query) { query += "&" + queryParts; @@ -37942,9 +37777,13 @@ var require_dist4 = __commonJS({ } __name(truncatedISO8061Date, "truncatedISO8061Date"); function base64encode(content) { - return !coreUtil.isNode ? btoa(content) : Buffer.from(content).toString("base64"); + return !core_util_1.isNodeLike ? btoa(content) : Buffer.from(content).toString("base64"); } __name(base64encode, "base64encode"); + function base64decode(encodedString) { + return !core_util_1.isNodeLike ? atob(encodedString) : Buffer.from(encodedString, "base64").toString(); + } + __name(base64decode, "base64decode"); function generateBlockID(blockIDPrefix, blockIndex) { const maxSourceStringLength = 48; const maxBlockIndexLength = 6; @@ -37994,12 +37833,34 @@ var require_dist4 = __commonJS({ } } __name(padStart, "padStart"); + function sanitizeURL(url) { + let safeURL = url; + if (getURLParameter(safeURL, constants_js_1.URLConstants.Parameters.SIGNATURE)) { + safeURL = setURLParameter(safeURL, constants_js_1.URLConstants.Parameters.SIGNATURE, "*****"); + } + return safeURL; + } + __name(sanitizeURL, "sanitizeURL"); + function sanitizeHeaders(originalHeader) { + const headers = (0, core_rest_pipeline_1.createHttpHeaders)(); + for (const [name, value] of originalHeader) { + if (name.toLowerCase() === constants_js_1.HeaderConstants.AUTHORIZATION.toLowerCase()) { + headers.set(name, "*****"); + } else if (name.toLowerCase() === constants_js_1.HeaderConstants.X_MS_COPY_SOURCE) { + headers.set(name, sanitizeURL(value)); + } else { + headers.set(name, value); + } + } + return headers; + } + __name(sanitizeHeaders, "sanitizeHeaders"); function iEqual(str1, str2) { return str1.toLocaleLowerCase() === str2.toLocaleLowerCase(); } __name(iEqual, "iEqual"); - function getAccountNameFromUrl(url2) { - const parsedUrl = new URL(url2); + function getAccountNameFromUrl(url) { + const parsedUrl = new URL(url); let accountName; try { if (parsedUrl.hostname.split(".")[1] === "blob") { @@ -38017,33 +37878,33 @@ var require_dist4 = __commonJS({ __name(getAccountNameFromUrl, "getAccountNameFromUrl"); function isIpEndpointStyle(parsedUrl) { const host = parsedUrl.host; - 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) || Boolean(parsedUrl.port) && PathStylePorts.includes(parsedUrl.port); + 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) || Boolean(parsedUrl.port) && constants_js_1.PathStylePorts.includes(parsedUrl.port); } __name(isIpEndpointStyle, "isIpEndpointStyle"); - function toBlobTagsString(tags2) { - if (tags2 === void 0) { + function toBlobTagsString(tags) { + if (tags === void 0) { return void 0; } const tagPairs = []; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; + for (const key in tags) { + if (Object.prototype.hasOwnProperty.call(tags, key)) { + const value = tags[key]; tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); } } return tagPairs.join("&"); } __name(toBlobTagsString, "toBlobTagsString"); - function toBlobTags(tags2) { - if (tags2 === void 0) { + function toBlobTags(tags) { + if (tags === void 0) { return void 0; } const res = { blobTagSet: [] }; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; + for (const key in tags) { + if (Object.prototype.hasOwnProperty.call(tags, key)) { + const value = tags[key]; res.blobTagSet.push({ key, value @@ -38053,12 +37914,12 @@ var require_dist4 = __commonJS({ return res; } __name(toBlobTags, "toBlobTags"); - function toTags(tags2) { - if (tags2 === void 0) { + function toTags(tags) { + if (tags === void 0) { return void 0; } const res = {}; - for (const blobTag of tags2.blobTagSet) { + for (const blobTag of tags.blobTagSet) { res[blobTag.key] = blobTag.value; } return res; @@ -38142,6 +38003,11 @@ var require_dist4 = __commonJS({ return orProperties; } __name(parseObjectReplicationRecord, "parseObjectReplicationRecord"); + function attachCredential(thing, credential) { + thing.credential = credential; + return thing; + } + __name(attachCredential, "attachCredential"); function httpAuthorizationToString(httpAuthorization) { return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : void 0; } @@ -38155,26 +38021,40 @@ var require_dist4 = __commonJS({ } __name(BlobNameToString, "BlobNameToString"); 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; - }) - } }); + return { + ...internalResponse, + segment: { + blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { + const blobItem = { + ...blobItemInteral, + name: BlobNameToString(blobItemInteral.name) + }; + return blobItem; + }) + } + }; } __name(ConvertInternalResponseOfListBlobFlat, "ConvertInternalResponseOfListBlobFlat"); function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { - var _a; - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.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; - }) - } }); + return { + ...internalResponse, + segment: { + blobPrefixes: internalResponse.segment.blobPrefixes?.map((blobPrefixInternal) => { + const blobPrefix = { + ...blobPrefixInternal, + name: BlobNameToString(blobPrefixInternal.name) + }; + return blobPrefix; + }), + blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { + const blobItem = { + ...blobItemInteral, + name: BlobNameToString(blobItemInteral.name) + }; + return blobItem; + }) + } + }; } __name(ConvertInternalResponseOfListBlobHierarchy, "ConvertInternalResponseOfListBlobHierarchy"); function* ExtractPageRangeInfoItems(getPageRangesSegment) { @@ -38234,25 +38114,62 @@ var require_dist4 = __commonJS({ throw new TypeError(`Unexpected response object ${response}`); } __name(assertResponse, "assertResponse"); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/policies/StorageRetryPolicyType.js +var require_StorageRetryPolicyType = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/policies/StorageRetryPolicyType.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); exports2.StorageRetryPolicyType = void 0; + var StorageRetryPolicyType; (function(StorageRetryPolicyType2) { StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(exports2.StorageRetryPolicyType || (exports2.StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS$1 = { + })(StorageRetryPolicyType || (exports2.StorageRetryPolicyType = StorageRetryPolicyType = {})); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/policies/StorageRetryPolicy.js +var require_StorageRetryPolicy = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/policies/StorageRetryPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageRetryPolicy = void 0; + exports2.NewRetryPolicyFactory = NewRetryPolicyFactory; + var abort_controller_1 = require_commonjs11(); + var RequestPolicy_js_1 = require_RequestPolicy(); + var constants_js_1 = require_constants10(); + var utils_common_js_1 = require_utils_common(); + var log_js_1 = require_log5(); + var StorageRetryPolicyType_js_1 = require_StorageRetryPolicyType(); + function NewRetryPolicyFactory(retryOptions) { + return { + create: (nextPolicy, options) => { + return new StorageRetryPolicy(nextPolicy, options, retryOptions); + } + }; + } + __name(NewRetryPolicyFactory, "NewRetryPolicyFactory"); + var DEFAULT_RETRY_OPTIONS = { maxRetryDelayInMs: 120 * 1e3, maxTries: 4, retryDelayInMs: 4 * 1e3, - retryPolicyType: exports2.StorageRetryPolicyType.EXPONENTIAL, + retryPolicyType: StorageRetryPolicyType_js_1.StorageRetryPolicyType.EXPONENTIAL, secondaryHost: "", tryTimeoutInMs: void 0 // Use server side default timeout strategy }; - var RETRY_ABORT_ERROR$1 = new abortController.AbortError("The operation was aborted."); - var StorageRetryPolicy = class extends BaseRequestPolicy { + var RETRY_ABORT_ERROR = new abort_controller_1.AbortError("The operation was aborted."); + var StorageRetryPolicy = class extends RequestPolicy_js_1.BaseRequestPolicy { static { __name(this, "StorageRetryPolicy"); } + /** + * RetryOptions. + */ + retryOptions; /** * Creates an instance of RetryPolicy. * @@ -38260,15 +38177,15 @@ var require_dist4 = __commonJS({ * @param options - * @param retryOptions - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS$1) { + constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS) { super(nextPolicy, options); this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS$1.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS$1.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS$1.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS$1.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS$1.secondaryHost + 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 }; } /** @@ -38293,21 +38210,21 @@ var require_dist4 = __commonJS({ 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); + newRequest.url = (0, utils_common_js_1.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()); + newRequest.url = (0, utils_common_js_1.setURLParameter)(newRequest.url, constants_js_1.URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); } let response; try { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); + log_js_1.logger.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) { - logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); + log_js_1.logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) { throw err; } @@ -38325,10 +38242,10 @@ var require_dist4 = __commonJS({ */ shouldRetry(isPrimaryRetry, attempt, response, err) { if (attempt >= this.retryOptions.maxTries) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); + log_js_1.logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); return false; } - const retriableErrors2 = [ + const retriableErrors = [ "ETIMEDOUT", "ESOCKETTIMEDOUT", "ECONNREFUSED", @@ -38341,9 +38258,9 @@ var require_dist4 = __commonJS({ // For default xhr based http client provided in ms-rest-js ]; if (err) { - for (const retriableError of retriableErrors2) { + for (const retriableError of retriableErrors) { if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); + log_js_1.logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); return true; } } @@ -38351,16 +38268,29 @@ var require_dist4 = __commonJS({ if (response || err) { const statusCode = response ? response.status : err ? err.statusCode : 0; if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); + log_js_1.logger.info(`RetryPolicy: Secondary access with 404, will retry.`); return true; } if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); + log_js_1.logger.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`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); + if (response) { + if (response?.status >= 400) { + const copySourceError = response.headers.get(constants_js_1.HeaderConstants.X_MS_CopySourceErrorCode); + if (copySourceError !== void 0) { + switch (copySourceError) { + case "InternalError": + case "OperationTimedOut": + case "ServerBusy": + return true; + } + } + } + } + if (err?.code === "PARSE_ERROR" && err?.message.startsWith(`Error "Error: Unclosed root tag`)) { + log_js_1.logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); return true; } return false; @@ -38376,24 +38306,43 @@ var require_dist4 = __commonJS({ let delayTimeInMs = 0; if (isPrimaryRetry) { switch (this.retryOptions.retryPolicyType) { - case exports2.StorageRetryPolicyType.EXPONENTIAL: + case StorageRetryPolicyType_js_1.StorageRetryPolicyType.EXPONENTIAL: delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); break; - case exports2.StorageRetryPolicyType.FIXED: + case StorageRetryPolicyType_js_1.StorageRetryPolicyType.FIXED: delayTimeInMs = this.retryOptions.retryDelayInMs; break; } } else { delayTimeInMs = Math.random() * 1e3; } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delay(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR$1); + log_js_1.logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); + return (0, utils_common_js_1.delay)(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR); } }; + exports2.StorageRetryPolicy = StorageRetryPolicy; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/StorageRetryPolicyFactory.js +var require_StorageRetryPolicyFactory = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/StorageRetryPolicyFactory.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageRetryPolicyFactory = exports2.StorageRetryPolicy = exports2.StorageRetryPolicyType = void 0; + var StorageRetryPolicy_js_1 = require_StorageRetryPolicy(); + Object.defineProperty(exports2, "StorageRetryPolicy", { enumerable: true, get: function() { + return StorageRetryPolicy_js_1.StorageRetryPolicy; + } }); + var StorageRetryPolicyType_js_1 = require_StorageRetryPolicyType(); + Object.defineProperty(exports2, "StorageRetryPolicyType", { enumerable: true, get: function() { + return StorageRetryPolicyType_js_1.StorageRetryPolicyType; + } }); var StorageRetryPolicyFactory = class { static { __name(this, "StorageRetryPolicyFactory"); } + retryOptions; /** * Creates an instance of StorageRetryPolicyFactory. * @param retryOptions - @@ -38408,10 +38357,21 @@ var require_dist4 = __commonJS({ * @param options - */ create(nextPolicy, options) { - return new StorageRetryPolicy(nextPolicy, options, this.retryOptions); + return new StorageRetryPolicy_js_1.StorageRetryPolicy(nextPolicy, options, this.retryOptions); } }; - var CredentialPolicy = class extends BaseRequestPolicy { + exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/policies/CredentialPolicy.js +var require_CredentialPolicy = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/policies/CredentialPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.CredentialPolicy = void 0; + var RequestPolicy_js_1 = require_RequestPolicy(); + var CredentialPolicy = class extends RequestPolicy_js_1.BaseRequestPolicy { static { __name(this, "CredentialPolicy"); } @@ -38433,6 +38393,16 @@ var require_dist4 = __commonJS({ return request; } }; + exports2.CredentialPolicy = CredentialPolicy; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/SharedKeyComparator.js +var require_SharedKeyComparator = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/utils/SharedKeyComparator.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.compareHeader = compareHeader; var table_lv0 = new Uint32Array([ 0, 0, @@ -38858,10 +38828,27 @@ var require_dist4 = __commonJS({ return false; } __name(isLessThan, "isLessThan"); - var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js +var require_StorageSharedKeyCredentialPolicy = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageSharedKeyCredentialPolicy = void 0; + var constants_js_1 = require_constants10(); + var utils_common_js_1 = require_utils_common(); + var CredentialPolicy_js_1 = require_CredentialPolicy(); + var SharedKeyComparator_js_1 = require_SharedKeyComparator(); + var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy_js_1.CredentialPolicy { static { __name(this, "StorageSharedKeyCredentialPolicy"); } + /** + * Reference to StorageSharedKeyCredential which generates StorageSharedKeyCredentialPolicy + */ + factory; /** * Creates an instance of StorageSharedKeyCredentialPolicy. * @param nextPolicy - @@ -38878,31 +38865,31 @@ var require_dist4 = __commonJS({ * @param request - */ signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + request.headers.set(constants_js_1.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)); + request.headers.set(constants_js_1.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) + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.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}`); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); return request; } /** * Retrieve header value according to shared key sign rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key + * @see https://learn.microsoft.com/rest/api/storageservices/authenticate-with-shared-key * * @param request - * @param headerName - @@ -38912,7 +38899,7 @@ var require_dist4 = __commonJS({ if (!value) { return ""; } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { return ""; } return value; @@ -38932,10 +38919,10 @@ var require_dist4 = __commonJS({ */ getCanonicalizedHeadersString(request) { let headersArray = request.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); + return value.name.toLowerCase().startsWith(constants_js_1.HeaderConstants.PREFIX_FOR_STORAGE); }); headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); + return (0, SharedKeyComparator_js_1.compareHeader)(a.name.toLowerCase(), b.name.toLowerCase()); }); headersArray = headersArray.filter((value, index, array) => { if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { @@ -38956,10 +38943,10 @@ var require_dist4 = __commonJS({ * @param request - */ getCanonicalizedResourceString(request) { - const path2 = getURLPath(request.url) || "/"; + const path2 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; let canonicalizedResourceString = ""; canonicalizedResourceString += `/${this.factory.accountName}${path2}`; - const queries = getURLQueries(request.url); + const queries = (0, utils_common_js_1.getURLQueries)(request.url); const lowercaseQueries = {}; if (queries) { const queryKeys = []; @@ -38979,6 +38966,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return canonicalizedResourceString; } }; + exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/credentials/Credential.js +var require_Credential = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/credentials/Credential.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Credential = void 0; var Credential = class { static { __name(this, "Credential"); @@ -38993,10 +38990,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Method should be implemented in children classes."); } }; - var StorageSharedKeyCredential = class extends Credential { + exports2.Credential = Credential; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/credentials/StorageSharedKeyCredential.js +var require_StorageSharedKeyCredential = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/credentials/StorageSharedKeyCredential.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageSharedKeyCredential = void 0; + var node_crypto_1 = require("node:crypto"); + var StorageSharedKeyCredentialPolicy_js_1 = require_StorageSharedKeyCredentialPolicy(); + var Credential_js_1 = require_Credential(); + var StorageSharedKeyCredential = class extends Credential_js_1.Credential { static { __name(this, "StorageSharedKeyCredential"); } + /** + * Azure Storage account name; readonly. + */ + accountName; + /** + * Azure Storage account key; readonly. + */ + accountKey; /** * Creates an instance of StorageSharedKeyCredential. * @param accountName - @@ -39014,7 +39032,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ create(nextPolicy, options) { - return new StorageSharedKeyCredentialPolicy(nextPolicy, options, this); + return new StorageSharedKeyCredentialPolicy_js_1.StorageSharedKeyCredentialPolicy(nextPolicy, options, this); } /** * Generates a hash signature for an HTTP request or for a SAS. @@ -39022,10 +39040,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param stringToSign - */ computeHMACSHA256(stringToSign) { - return crypto4.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); + return (0, node_crypto_1.createHmac)("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); } }; - var AnonymousCredentialPolicy = class extends CredentialPolicy { + exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/policies/AnonymousCredentialPolicy.js +var require_AnonymousCredentialPolicy = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/policies/AnonymousCredentialPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AnonymousCredentialPolicy = void 0; + var CredentialPolicy_js_1 = require_CredentialPolicy(); + var AnonymousCredentialPolicy = class extends CredentialPolicy_js_1.CredentialPolicy { static { __name(this, "AnonymousCredentialPolicy"); } @@ -39040,7 +39069,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; super(nextPolicy, options); } }; - var AnonymousCredential = class extends Credential { + exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/credentials/AnonymousCredential.js +var require_AnonymousCredential = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/credentials/AnonymousCredential.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AnonymousCredential = void 0; + var AnonymousCredentialPolicy_js_1 = require_AnonymousCredentialPolicy(); + var Credential_js_1 = require_Credential(); + var AnonymousCredential = class extends Credential_js_1.Credential { static { __name(this, "AnonymousCredential"); } @@ -39051,46 +39092,2135 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ create(nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); + return new AnonymousCredentialPolicy_js_1.AnonymousCredentialPolicy(nextPolicy, options); } }; + exports2.AnonymousCredential = AnonymousCredential; + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/BuffersStream.js +var require_BuffersStream = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/BuffersStream.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BuffersStream = void 0; + var node_stream_1 = require("node:stream"); + var BuffersStream = class extends node_stream_1.Readable { + static { + __name(this, "BuffersStream"); + } + buffers; + byteLength; + /** + * The offset of data to be read in the current buffer. + */ + byteOffsetInCurrentBuffer; + /** + * The index of buffer to be read in the array of buffers. + */ + bufferIndex; + /** + * The total length of data already read. + */ + pushedBytesLength; + /** + * 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."); + } + } + /** + * 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 i = 0; + while (i < 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 - i) { + const end = this.byteOffsetInCurrentBuffer + size - i; + outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end)); + this.pushedBytesLength += size - i; + this.byteOffsetInCurrentBuffer = end; + i = 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; + i += remaining; + } + } + if (outBuffers.length > 1) { + this.push(Buffer.concat(outBuffers)); + } else if (outBuffers.length === 1) { + this.push(outBuffers[0]); + } + } + }; + exports2.BuffersStream = BuffersStream; + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/PooledBuffer.js +var require_PooledBuffer = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/PooledBuffer.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.PooledBuffer = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var BuffersStream_js_1 = require_BuffersStream(); + var node_buffer_1 = tslib_1.__importDefault(require("node:buffer")); + var maxBufferLength = node_buffer_1.default.constants.MAX_LENGTH; + var PooledBuffer = class { + static { + __name(this, "PooledBuffer"); + } + /** + * Internal buffers used to keep the data. + * Each buffer has a length of the maxBufferLength except last one. + */ + buffers = []; + /** + * The total size of internal buffers. + */ + capacity; + /** + * The total size of data contained in internal buffers. + */ + _size; + /** + * The size of the data contained in the pooled buffers. + */ + get size() { + return this._size; + } + constructor(capacity, buffers, totalLength) { + this.capacity = capacity; + this._size = 0; + const bufferNum = Math.ceil(capacity / maxBufferLength); + for (let i = 0; i < bufferNum; i++) { + let len = i === bufferNum - 1 ? capacity % maxBufferLength : maxBufferLength; + if (len === 0) { + len = maxBufferLength; + } + this.buffers.push(Buffer.allocUnsafe(len)); + } + if (buffers) { + this.fill(buffers, totalLength); + } + } + /** + * 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 i = 0, j = 0, targetOffset = 0, sourceOffset = 0, totalCopiedNum = 0; + while (totalCopiedNum < this._size) { + const source = buffers[i]; + const target = this.buffers[j]; + const copiedNum = source.copy(target, targetOffset, sourceOffset); + totalCopiedNum += copiedNum; + sourceOffset += copiedNum; + targetOffset += copiedNum; + if (sourceOffset === source.length) { + i++; + sourceOffset = 0; + } + if (targetOffset === target.length) { + j++; + targetOffset = 0; + } + } + buffers.splice(0, i); + 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_js_1.BuffersStream(this.buffers, this.size); + } + }; + exports2.PooledBuffer = PooledBuffer; + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/BufferScheduler.js +var require_BufferScheduler = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/BufferScheduler.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BufferScheduler = void 0; + var events_1 = require("events"); + var PooledBuffer_js_1 = require_PooledBuffer(); + var BufferScheduler = class { + static { + __name(this, "BufferScheduler"); + } + /** + * Size of buffers in incoming and outgoing queues. This class will try to align + * data read from Readable stream into buffer chunks with bufferSize defined. + */ + bufferSize; + /** + * How many buffers can be created or maintained. + */ + maxBuffers; + /** + * A Node.js Readable stream. + */ + readable; + /** + * OutgoingHandler is an async function triggered by BufferScheduler when there + * are available buffers in outgoing array. + */ + outgoingHandler; + /** + * An internal event emitter. + */ + emitter = new events_1.EventEmitter(); + /** + * Concurrency of executing outgoingHandlers. (0 lesser than concurrency lesser than or equal to maxBuffers) + */ + concurrency; + /** + * An internal offset marker to track data offset in bytes of next outgoingHandler. + */ + offset = 0; + /** + * An internal marker to track whether stream is end. + */ + isStreamEnd = false; + /** + * An internal marker to track whether stream or outgoingHandler returns error. + */ + isError = false; + /** + * How many handlers are executing. + */ + executingOutgoingHandlers = 0; + /** + * Encoding of the input Readable stream which has string data type instead of Buffer. + */ + encoding; + /** + * How many buffers have been allocated. + */ + numBuffers = 0; + /** + * Because this class doesn't know how much data every time stream pops, which + * is defined by highWaterMarker of the stream. So BufferScheduler will cache + * data received from the stream, when data in unresolvedDataArray exceeds the + * blockSize defined, it will try to concat a blockSize of buffer, fill into available + * buffers from incoming and push to outgoing array. + */ + unresolvedDataArray = []; + /** + * How much data consisted in unresolvedDataArray. + */ + unresolvedLength = 0; + /** + * The array includes all the available buffers can be used to fill data from stream. + */ + incoming = []; + /** + * The array (queue) includes all the buffers filled from stream data. + */ + outgoing = []; + /** + * 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) { + 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}`); + } + 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((resolve, 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(resolve).catch(reject); + } else if (this.unresolvedLength >= this.bufferSize) { + return; + } else { + resolve(); + } + } + }); + }); + } + /** + * Insert a new data into unresolved array. + * + * @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. + * + */ + shiftBufferFromUnresolvedDataArray(buffer) { + if (!buffer) { + buffer = new PooledBuffer_js_1.PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); + } else { + buffer.fill(this.unresolvedDataArray, this.unresolvedLength); + } + 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. + * + * @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; + } + } + 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; + } + buffer = this.outgoing.shift(); + if (buffer) { + this.triggerOutgoingHandler(buffer); + } + } while (buffer); + } + /** + * Trigger a outgoing handler for a buffer shifted from outgoing. + * + * @param buffer - + */ + 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"); + } + /** + * Return buffer used by outgoing handler into incoming. + * + * @param buffer - + */ + reuseBuffer(buffer) { + this.incoming.push(buffer); + if (!this.isError && this.resolveData() && !this.isStreamEnd) { + this.readable.resume(); + } + } + }; + exports2.BufferScheduler = BufferScheduler; + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/cache.js +var require_cache2 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/cache.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; + var core_rest_pipeline_1 = require_commonjs6(); var _defaultHttpClient; function getCachedDefaultHttpClient() { if (!_defaultHttpClient) { - _defaultHttpClient = coreRestPipeline.createDefaultHttpClient(); + _defaultHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); } return _defaultHttpClient; } __name(getCachedDefaultHttpClient, "getCachedDefaultHttpClient"); - var storageBrowserPolicyName = "storageBrowserPolicy"; + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/policies/RequestPolicy.js +var require_RequestPolicy2 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/policies/RequestPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BaseRequestPolicy = void 0; + var BaseRequestPolicy = class { + static { + __name(this, "BaseRequestPolicy"); + } + _nextPolicy; + _options; + /** + * The main method to implement that manipulates a request/response. + */ + constructor(_nextPolicy, _options) { + this._nextPolicy = _nextPolicy; + this._options = _options; + } + /** + * Get whether or not a log with the provided log level should be logged. + * @param logLevel - The log level of the log that will be logged. + * @returns Whether or not a log with the provided log level should be logged. + */ + shouldLog(logLevel) { + return this._options.shouldLog(logLevel); + } + /** + * Attempt to log the provided message to the provided logger. If no logger was provided or if + * the log level does not meat the logger's threshold, then nothing will be logged. + * @param logLevel - The log level of this log. + * @param message - The message of this log. + */ + log(logLevel, message) { + this._options.log(logLevel, message); + } + }; + exports2.BaseRequestPolicy = BaseRequestPolicy; + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/utils/constants.js +var require_constants11 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/utils/constants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.PathStylePorts = exports2.DevelopmentConnectionString = exports2.HeaderConstants = exports2.URLConstants = exports2.SDK_VERSION = void 0; + exports2.SDK_VERSION = "1.0.0"; + exports2.URLConstants = { + Parameters: { + FORCE_BROWSER_NO_CACHE: "_", + SIGNATURE: "sig", + SNAPSHOT: "snapshot", + VERSIONID: "versionid", + TIMEOUT: "timeout" + } + }; + exports2.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", + X_MS_CopySourceErrorCode: "x-ms-copy-source-error-code" + }; + exports2.DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; + exports2.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-common/dist/commonjs/utils/utils.common.js +var require_utils_common2 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/utils/utils.common.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.escapeURLPath = escapeURLPath; + exports2.getValueInConnString = getValueInConnString; + exports2.extractConnectionStringParts = extractConnectionStringParts; + exports2.appendToURLPath = appendToURLPath; + exports2.setURLParameter = setURLParameter; + exports2.getURLParameter = getURLParameter; + exports2.setURLHost = setURLHost; + exports2.getURLPath = getURLPath; + exports2.getURLScheme = getURLScheme; + exports2.getURLPathAndQuery = getURLPathAndQuery; + exports2.getURLQueries = getURLQueries; + exports2.appendToURLQuery = appendToURLQuery; + exports2.truncatedISO8061Date = truncatedISO8061Date; + exports2.base64encode = base64encode; + exports2.base64decode = base64decode; + exports2.generateBlockID = generateBlockID; + exports2.delay = delay; + exports2.padStart = padStart; + exports2.sanitizeURL = sanitizeURL; + exports2.sanitizeHeaders = sanitizeHeaders; + exports2.iEqual = iEqual; + exports2.getAccountNameFromUrl = getAccountNameFromUrl; + exports2.isIpEndpointStyle = isIpEndpointStyle; + exports2.attachCredential = attachCredential; + exports2.httpAuthorizationToString = httpAuthorizationToString; + exports2.EscapePath = EscapePath; + exports2.assertResponse = assertResponse; + var core_rest_pipeline_1 = require_commonjs6(); + var core_util_1 = require_commonjs4(); + var constants_js_1 = require_constants11(); + function escapeURLPath(url) { + const urlParsed = new URL(url); + let path2 = urlParsed.pathname; + path2 = path2 || "/"; + path2 = escape(path2); + urlParsed.pathname = path2; + return urlParsed.toString(); + } + __name(escapeURLPath, "escapeURLPath"); + 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; + } + __name(getProxyUriFromDevConnString, "getProxyUriFromDevConnString"); + 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 ""; + } + __name(getValueInConnString, "getValueInConnString"); + function extractConnectionStringParts(connectionString) { + let proxyUri = ""; + if (connectionString.startsWith("UseDevelopmentStorage=true")) { + proxyUri = getProxyUriFromDevConnString(connectionString); + connectionString = constants_js_1.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 { + let 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"); + } + if (accountSas.startsWith("?")) { + accountSas = accountSas.substring(1); + } + return { kind: "SASConnString", url: blobEndpoint, accountName, accountSas }; + } + } + __name(extractConnectionStringParts, "extractConnectionStringParts"); + function escape(text) { + return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); + } + __name(escape, "escape"); + function appendToURLPath(url, name) { + const urlParsed = new URL(url); + let path2 = urlParsed.pathname; + path2 = path2 ? path2.endsWith("/") ? `${path2}${name}` : `${path2}/${name}` : name; + urlParsed.pathname = path2; + return urlParsed.toString(); + } + __name(appendToURLPath, "appendToURLPath"); + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); + const encodedName = encodeURIComponent(name); + const encodedValue = value ? encodeURIComponent(value) : void 0; + const searchString = urlParsed.search === "" ? "?" : urlParsed.search; + const searchPieces = []; + for (const pair of searchString.slice(1).split("&")) { + if (pair) { + const [key] = pair.split("=", 2); + if (key !== encodedName) { + searchPieces.push(pair); + } + } + } + if (encodedValue) { + searchPieces.push(`${encodedName}=${encodedValue}`); + } + urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; + return urlParsed.toString(); + } + __name(setURLParameter, "setURLParameter"); + function getURLParameter(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; + } + __name(getURLParameter, "getURLParameter"); + function setURLHost(url, host) { + const urlParsed = new URL(url); + urlParsed.hostname = host; + return urlParsed.toString(); + } + __name(setURLHost, "setURLHost"); + function getURLPath(url) { + try { + const urlParsed = new URL(url); + return urlParsed.pathname; + } catch (e) { + return void 0; + } + } + __name(getURLPath, "getURLPath"); + function getURLScheme(url) { + try { + const urlParsed = new URL(url); + return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; + } catch (e) { + return void 0; + } + } + __name(getURLScheme, "getURLScheme"); + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); + const pathString = urlParsed.pathname; + if (!pathString) { + throw new RangeError("Invalid url without valid path."); + } + let queryString = urlParsed.search || ""; + queryString = queryString.trim(); + if (queryString !== "") { + queryString = queryString.startsWith("?") ? queryString : `?${queryString}`; + } + return `${pathString}${queryString}`; + } + __name(getURLPathAndQuery, "getURLPathAndQuery"); + function getURLQueries(url) { + let queryString = new URL(url).search; + if (!queryString) { + return {}; + } + queryString = queryString.trim(); + queryString = queryString.startsWith("?") ? queryString.substring(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; + } + __name(getURLQueries, "getURLQueries"); + function appendToURLQuery(url, queryParts) { + const urlParsed = new URL(url); + let query = urlParsed.search; + if (query) { + query += "&" + queryParts; + } else { + query = queryParts; + } + urlParsed.search = query; + return urlParsed.toString(); + } + __name(appendToURLQuery, "appendToURLQuery"); + 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"; + } + __name(truncatedISO8061Date, "truncatedISO8061Date"); + function base64encode(content) { + return !core_util_1.isNodeLike ? btoa(content) : Buffer.from(content).toString("base64"); + } + __name(base64encode, "base64encode"); + function base64decode(encodedString) { + return !core_util_1.isNodeLike ? atob(encodedString) : Buffer.from(encodedString, "base64").toString(); + } + __name(base64decode, "base64decode"); + 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); + } + __name(generateBlockID, "generateBlockID"); + async function delay(timeInMs, aborter, abortError) { + return new Promise((resolve, reject) => { + let timeout; + const abortHandler = /* @__PURE__ */ __name(() => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }, "abortHandler"); + const resolveHandler = /* @__PURE__ */ __name(() => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve(); + }, "resolveHandler"); + timeout = setTimeout(resolveHandler, timeInMs); + if (aborter !== void 0) { + aborter.addEventListener("abort", abortHandler); + } + }); + } + __name(delay, "delay"); + 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; + } + } + __name(padStart, "padStart"); + function sanitizeURL(url) { + let safeURL = url; + if (getURLParameter(safeURL, constants_js_1.URLConstants.Parameters.SIGNATURE)) { + safeURL = setURLParameter(safeURL, constants_js_1.URLConstants.Parameters.SIGNATURE, "*****"); + } + return safeURL; + } + __name(sanitizeURL, "sanitizeURL"); + function sanitizeHeaders(originalHeader) { + const headers = (0, core_rest_pipeline_1.createHttpHeaders)(); + for (const [name, value] of originalHeader) { + if (name.toLowerCase() === constants_js_1.HeaderConstants.AUTHORIZATION.toLowerCase()) { + headers.set(name, "*****"); + } else if (name.toLowerCase() === constants_js_1.HeaderConstants.X_MS_COPY_SOURCE) { + headers.set(name, sanitizeURL(value)); + } else { + headers.set(name, value); + } + } + return headers; + } + __name(sanitizeHeaders, "sanitizeHeaders"); + function iEqual(str1, str2) { + return str1.toLocaleLowerCase() === str2.toLocaleLowerCase(); + } + __name(iEqual, "iEqual"); + function getAccountNameFromUrl(url) { + const parsedUrl = new URL(url); + let accountName; + try { + if (parsedUrl.hostname.split(".")[1] === "blob") { + accountName = parsedUrl.hostname.split(".")[0]; + } else if (isIpEndpointStyle(parsedUrl)) { + accountName = parsedUrl.pathname.split("/")[1]; + } else { + accountName = ""; + } + return accountName; + } catch (error) { + throw new Error("Unable to extract accountName with provided information."); + } + } + __name(getAccountNameFromUrl, "getAccountNameFromUrl"); + function isIpEndpointStyle(parsedUrl) { + const host = parsedUrl.host; + 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) || Boolean(parsedUrl.port) && constants_js_1.PathStylePorts.includes(parsedUrl.port); + } + __name(isIpEndpointStyle, "isIpEndpointStyle"); + function attachCredential(thing, credential) { + thing.credential = credential; + return thing; + } + __name(attachCredential, "attachCredential"); + function httpAuthorizationToString(httpAuthorization) { + return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : void 0; + } + __name(httpAuthorizationToString, "httpAuthorizationToString"); + function EscapePath(blobName) { + const split = blobName.split("/"); + for (let i = 0; i < split.length; i++) { + split[i] = encodeURIComponent(split[i]); + } + return split.join("/"); + } + __name(EscapePath, "EscapePath"); + function assertResponse(response) { + if (`_response` in response) { + return response; + } + throw new TypeError(`Unexpected response object ${response}`); + } + __name(assertResponse, "assertResponse"); + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/policies/StorageBrowserPolicy.js +var require_StorageBrowserPolicy = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/policies/StorageBrowserPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageBrowserPolicy = void 0; + var RequestPolicy_js_1 = require_RequestPolicy2(); + var core_util_1 = require_commonjs4(); + var constants_js_1 = require_constants11(); + var utils_common_js_1 = require_utils_common2(); + var StorageBrowserPolicy = class extends RequestPolicy_js_1.BaseRequestPolicy { + static { + __name(this, "StorageBrowserPolicy"); + } + /** + * 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 (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + exports2.StorageBrowserPolicy = StorageBrowserPolicy; + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/StorageBrowserPolicyFactory.js +var require_StorageBrowserPolicyFactory = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/StorageBrowserPolicyFactory.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageBrowserPolicyFactory = exports2.StorageBrowserPolicy = void 0; + var StorageBrowserPolicy_js_1 = require_StorageBrowserPolicy(); + Object.defineProperty(exports2, "StorageBrowserPolicy", { enumerable: true, get: function() { + return StorageBrowserPolicy_js_1.StorageBrowserPolicy; + } }); + var StorageBrowserPolicyFactory = class { + static { + __name(this, "StorageBrowserPolicyFactory"); + } + /** + * Creates a StorageBrowserPolicyFactory object. + * + * @param nextPolicy - + * @param options - + */ + create(nextPolicy, options) { + return new StorageBrowserPolicy_js_1.StorageBrowserPolicy(nextPolicy, options); + } + }; + exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/policies/CredentialPolicy.js +var require_CredentialPolicy2 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/policies/CredentialPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.CredentialPolicy = void 0; + var RequestPolicy_js_1 = require_RequestPolicy2(); + var CredentialPolicy = class extends RequestPolicy_js_1.BaseRequestPolicy { + static { + __name(this, "CredentialPolicy"); + } + /** + * 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; + } + }; + exports2.CredentialPolicy = CredentialPolicy; + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/policies/AnonymousCredentialPolicy.js +var require_AnonymousCredentialPolicy2 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/policies/AnonymousCredentialPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AnonymousCredentialPolicy = void 0; + var CredentialPolicy_js_1 = require_CredentialPolicy2(); + var AnonymousCredentialPolicy = class extends CredentialPolicy_js_1.CredentialPolicy { + static { + __name(this, "AnonymousCredentialPolicy"); + } + /** + * 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); + } + }; + exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/credentials/Credential.js +var require_Credential2 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/credentials/Credential.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Credential = void 0; + var Credential = class { + static { + __name(this, "Credential"); + } + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/credentials/AnonymousCredential.js +var require_AnonymousCredential2 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/credentials/AnonymousCredential.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AnonymousCredential = void 0; + var AnonymousCredentialPolicy_js_1 = require_AnonymousCredentialPolicy2(); + var Credential_js_1 = require_Credential2(); + var AnonymousCredential = class extends Credential_js_1.Credential { + static { + __name(this, "AnonymousCredential"); + } + /** + * Creates an {@link AnonymousCredentialPolicy} object. + * + * @param nextPolicy - + * @param options - + */ + create(nextPolicy, options) { + return new AnonymousCredentialPolicy_js_1.AnonymousCredentialPolicy(nextPolicy, options); + } + }; + exports2.AnonymousCredential = AnonymousCredential; + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/utils/SharedKeyComparator.js +var require_SharedKeyComparator2 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/utils/SharedKeyComparator.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.compareHeader = compareHeader; + var table_lv0 = new Uint32Array([ + 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, + 1820, + 0, + 1823, + 1825, + 1827, + 1829, + 0, + 0, + 0, + 1837, + 2051, + 0, + 0, + 1843, + 0, + 3331, + 3354, + 3356, + 3358, + 3360, + 3362, + 3364, + 3366, + 3368, + 3370, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3586, + 3593, + 3594, + 3610, + 3617, + 3619, + 3621, + 3628, + 3634, + 3637, + 3638, + 3656, + 3665, + 3696, + 3708, + 3710, + 3721, + 3722, + 3729, + 3737, + 3743, + 3746, + 3748, + 3750, + 3751, + 3753, + 0, + 0, + 0, + 1859, + 1860, + 1864, + 3586, + 3593, + 3594, + 3610, + 3617, + 3619, + 3621, + 3628, + 3634, + 3637, + 3638, + 3656, + 3665, + 3696, + 3708, + 3710, + 3721, + 3722, + 3729, + 3737, + 3743, + 3746, + 3748, + 3750, + 3751, + 3753, + 0, + 1868, + 0, + 1872, + 0 + ]); + var table_lv2 = new Uint32Array([ + 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, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 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 + ]); + var table_lv4 = new Uint32Array([ + 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, + 32786, + 0, + 0, + 0, + 0, + 0, + 33298, + 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, + 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 + ]); + function compareHeader(lhs, rhs) { + if (isLessThan(lhs, rhs)) + return -1; + return 1; + } + __name(compareHeader, "compareHeader"); + function isLessThan(lhs, rhs) { + const tables = [table_lv0, table_lv2, table_lv4]; + let curr_level = 0; + let i = 0; + let j = 0; + while (curr_level < tables.length) { + if (curr_level === tables.length - 1 && i !== j) { + return i > j; + } + const weight1 = i < lhs.length ? tables[curr_level][lhs[i].charCodeAt(0)] : 1; + const weight2 = j < rhs.length ? tables[curr_level][rhs[j].charCodeAt(0)] : 1; + if (weight1 === 1 && weight2 === 1) { + i = 0; + j = 0; + ++curr_level; + } else if (weight1 === weight2) { + ++i; + ++j; + } else if (weight1 === 0) { + ++i; + } else if (weight2 === 0) { + ++j; + } else { + return weight1 < weight2; + } + } + return false; + } + __name(isLessThan, "isLessThan"); + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js +var require_StorageSharedKeyCredentialPolicy2 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageSharedKeyCredentialPolicy = void 0; + var constants_js_1 = require_constants11(); + var utils_common_js_1 = require_utils_common2(); + var CredentialPolicy_js_1 = require_CredentialPolicy2(); + var SharedKeyComparator_js_1 = require_SharedKeyComparator2(); + var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy_js_1.CredentialPolicy { + static { + __name(this, "StorageSharedKeyCredentialPolicy"); + } + /** + * Reference to StorageSharedKeyCredential which generates StorageSharedKeyCredentialPolicy + */ + factory; + /** + * Creates an instance of StorageSharedKeyCredentialPolicy. + * @param nextPolicy - + * @param options - + * @param factory - + */ + constructor(nextPolicy, options, factory) { + super(nextPolicy, options); + this.factory = factory; + } + /** + * Signs request. + * + * @param request - + */ + signRequest(request) { + request.headers.set(constants_js_1.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(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * Retrieve header value according to shared key sign rules. + * @see https://learn.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key + * + * @param request - + * @param headerName - + */ + getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + /** + * 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 - + */ + getCanonicalizedHeadersString(request) { + let headersArray = request.headers.headersArray().filter((value) => { + return value.name.toLowerCase().startsWith(constants_js_1.HeaderConstants.PREFIX_FOR_STORAGE); + }); + headersArray.sort((a, b) => { + return (0, SharedKeyComparator_js_1.compareHeader)(a.name.toLowerCase(), b.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; + } + /** + * Retrieves the webResource canonicalized resource string. + * + * @param request - + */ + getCanonicalizedResourceString(request) { + const path2 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path2}`; + const queries = (0, utils_common_js_1.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; + } + }; + exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/credentials/StorageSharedKeyCredential.js +var require_StorageSharedKeyCredential2 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/credentials/StorageSharedKeyCredential.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageSharedKeyCredential = void 0; + var node_crypto_1 = require("node:crypto"); + var StorageSharedKeyCredentialPolicy_js_1 = require_StorageSharedKeyCredentialPolicy2(); + var Credential_js_1 = require_Credential2(); + var StorageSharedKeyCredential = class extends Credential_js_1.Credential { + static { + __name(this, "StorageSharedKeyCredential"); + } + /** + * Azure Storage account name; readonly. + */ + accountName; + /** + * Azure Storage account key; readonly. + */ + accountKey; + /** + * Creates an instance of StorageSharedKeyCredential. + * @param accountName - + * @param accountKey - + */ + constructor(accountName, accountKey) { + super(); + this.accountName = accountName; + this.accountKey = Buffer.from(accountKey, "base64"); + } + /** + * Creates a StorageSharedKeyCredentialPolicy object. + * + * @param nextPolicy - + * @param options - + */ + create(nextPolicy, options) { + return new StorageSharedKeyCredentialPolicy_js_1.StorageSharedKeyCredentialPolicy(nextPolicy, options, this); + } + /** + * Generates a hash signature for an HTTP request or for a SAS. + * + * @param stringToSign - + */ + computeHMACSHA256(stringToSign) { + return (0, node_crypto_1.createHmac)("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); + } + }; + exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; + } +}); + +// node_modules/@azure/storage-common/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js +var require_AbortError4 = __commonJS({ + "node_modules/@azure/storage-common/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AbortError = void 0; + var AbortError = class extends Error { + static { + __name(this, "AbortError"); + } + constructor(message) { + super(message); + this.name = "AbortError"; + } + }; + exports2.AbortError = AbortError; + } +}); + +// node_modules/@azure/storage-common/node_modules/@azure/abort-controller/dist/commonjs/index.js +var require_commonjs12 = __commonJS({ + "node_modules/@azure/storage-common/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AbortError = void 0; + var AbortError_js_1 = require_AbortError4(); + Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { + return AbortError_js_1.AbortError; + } }); + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/log.js +var require_log6 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/log.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.logger = void 0; + var logger_1 = require_commonjs2(); + exports2.logger = (0, logger_1.createClientLogger)("storage-common"); + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/policies/StorageRetryPolicyType.js +var require_StorageRetryPolicyType2 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/policies/StorageRetryPolicyType.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageRetryPolicyType = void 0; + var StorageRetryPolicyType; + (function(StorageRetryPolicyType2) { + StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; + StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; + })(StorageRetryPolicyType || (exports2.StorageRetryPolicyType = StorageRetryPolicyType = {})); + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/policies/StorageRetryPolicy.js +var require_StorageRetryPolicy2 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/policies/StorageRetryPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageRetryPolicy = void 0; + exports2.NewRetryPolicyFactory = NewRetryPolicyFactory; + var abort_controller_1 = require_commonjs12(); + var RequestPolicy_js_1 = require_RequestPolicy2(); + var constants_js_1 = require_constants11(); + var utils_common_js_1 = require_utils_common2(); + var log_js_1 = require_log6(); + var StorageRetryPolicyType_js_1 = require_StorageRetryPolicyType2(); + function NewRetryPolicyFactory(retryOptions) { + return { + create: (nextPolicy, options) => { + return new StorageRetryPolicy(nextPolicy, options, retryOptions); + } + }; + } + __name(NewRetryPolicyFactory, "NewRetryPolicyFactory"); + var DEFAULT_RETRY_OPTIONS = { + maxRetryDelayInMs: 120 * 1e3, + maxTries: 4, + retryDelayInMs: 4 * 1e3, + retryPolicyType: StorageRetryPolicyType_js_1.StorageRetryPolicyType.EXPONENTIAL, + secondaryHost: "", + tryTimeoutInMs: void 0 + // Use server side default timeout strategy + }; + var RETRY_ABORT_ERROR = new abort_controller_1.AbortError("The operation was aborted."); + var StorageRetryPolicy = class extends RequestPolicy_js_1.BaseRequestPolicy { + static { + __name(this, "StorageRetryPolicy"); + } + /** + * RetryOptions. + */ + retryOptions; + /** + * 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 = (0, utils_common_js_1.setURLHost)(newRequest.url, this.retryOptions.secondaryHost); + } + if (this.retryOptions.tryTimeoutInMs) { + newRequest.url = (0, utils_common_js_1.setURLParameter)(newRequest.url, constants_js_1.URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); + } + let response; + try { + log_js_1.logger.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) { + log_js_1.logger.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); + } + /** + * 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) { + log_js_1.logger.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) { + log_js_1.logger.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) { + log_js_1.logger.info(`RetryPolicy: Secondary access with 404, will retry.`); + return true; + } + if (statusCode === 503 || statusCode === 500) { + log_js_1.logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); + return true; + } + } + if (response) { + if (response?.status >= 400) { + const copySourceError = response.headers.get(constants_js_1.HeaderConstants.X_MS_CopySourceErrorCode); + if (copySourceError !== void 0) { + switch (copySourceError) { + case "InternalError": + case "OperationTimedOut": + case "ServerBusy": + return true; + } + } + } + } + if (err?.code === "PARSE_ERROR" && err?.message.startsWith(`Error "Error: Unclosed root tag`)) { + log_js_1.logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); + return true; + } + 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_js_1.StorageRetryPolicyType.EXPONENTIAL: + delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); + break; + case StorageRetryPolicyType_js_1.StorageRetryPolicyType.FIXED: + delayTimeInMs = this.retryOptions.retryDelayInMs; + break; + } + } else { + delayTimeInMs = Math.random() * 1e3; + } + log_js_1.logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); + return (0, utils_common_js_1.delay)(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR); + } + }; + exports2.StorageRetryPolicy = StorageRetryPolicy; + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/StorageRetryPolicyFactory.js +var require_StorageRetryPolicyFactory2 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/StorageRetryPolicyFactory.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageRetryPolicyFactory = exports2.StorageRetryPolicy = exports2.StorageRetryPolicyType = void 0; + var StorageRetryPolicy_js_1 = require_StorageRetryPolicy2(); + Object.defineProperty(exports2, "StorageRetryPolicy", { enumerable: true, get: function() { + return StorageRetryPolicy_js_1.StorageRetryPolicy; + } }); + var StorageRetryPolicyType_js_1 = require_StorageRetryPolicyType2(); + Object.defineProperty(exports2, "StorageRetryPolicyType", { enumerable: true, get: function() { + return StorageRetryPolicyType_js_1.StorageRetryPolicyType; + } }); + var StorageRetryPolicyFactory = class { + static { + __name(this, "StorageRetryPolicyFactory"); + } + retryOptions; + /** + * 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_js_1.StorageRetryPolicy(nextPolicy, options, this.retryOptions); + } + }; + exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/policies/StorageBrowserPolicyV2.js +var require_StorageBrowserPolicyV2 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/policies/StorageBrowserPolicyV2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.storageBrowserPolicyName = void 0; + exports2.storageBrowserPolicy = storageBrowserPolicy; + var core_util_1 = require_commonjs4(); + var constants_js_1 = require_constants11(); + var utils_common_js_1 = require_utils_common2(); + exports2.storageBrowserPolicyName = "storageBrowserPolicy"; function storageBrowserPolicy() { return { - name: storageBrowserPolicyName, + name: exports2.storageBrowserPolicyName, async sendRequest(request, next) { - if (coreUtil.isNode) { + if (core_util_1.isNodeLike) { return next(request); } if (request.method === "GET" || request.method === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); } - request.headers.delete(HeaderConstants.COOKIE); - request.headers.delete(HeaderConstants.CONTENT_LENGTH); + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); return next(request); } }; } __name(storageBrowserPolicy, "storageBrowserPolicy"); - var storageRetryPolicyName = "storageRetryPolicy"; - var StorageRetryPolicyType; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(StorageRetryPolicyType || (StorageRetryPolicyType = {})); + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/policies/StorageCorrectContentLengthPolicy.js +var require_StorageCorrectContentLengthPolicy = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/policies/StorageCorrectContentLengthPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.storageCorrectContentLengthPolicyName = void 0; + exports2.storageCorrectContentLengthPolicy = storageCorrectContentLengthPolicy; + var constants_js_1 = require_constants11(); + exports2.storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; + function storageCorrectContentLengthPolicy() { + function correctContentLength(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + __name(correctContentLength, "correctContentLength"); + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + __name(storageCorrectContentLengthPolicy, "storageCorrectContentLengthPolicy"); + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/policies/StorageRetryPolicyV2.js +var require_StorageRetryPolicyV2 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/policies/StorageRetryPolicyV2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.storageRetryPolicyName = void 0; + exports2.storageRetryPolicy = storageRetryPolicy; + var abort_controller_1 = require_commonjs12(); + var core_rest_pipeline_1 = require_commonjs6(); + var core_util_1 = require_commonjs4(); + var StorageRetryPolicyFactory_js_1 = require_StorageRetryPolicyFactory2(); + var constants_js_1 = require_constants11(); + var utils_common_js_1 = require_utils_common2(); + var log_js_1 = require_log6(); + exports2.storageRetryPolicyName = "storageRetryPolicy"; var DEFAULT_RETRY_OPTIONS = { maxRetryDelayInMs: 120 * 1e3, maxTries: 4, retryDelayInMs: 4 * 1e3, - retryPolicyType: StorageRetryPolicyType.EXPONENTIAL, + retryPolicyType: StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.EXPONENTIAL, secondaryHost: "", tryTimeoutInMs: void 0 // Use server side default timeout strategy @@ -39106,44 +41236,55 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; "EPIPE", "REQUEST_SEND_ERROR" ]; - var RETRY_ABORT_ERROR = new abortController.AbortError("The operation was aborted."); + var RETRY_ABORT_ERROR = new abort_controller_1.AbortError("The operation was aborted."); function storageRetryPolicy(options = {}) { - var _a, _b, _c, _d, _e, _f; - const retryPolicyType = (_a = options.retryPolicyType) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_OPTIONS.retryPolicyType; - const maxTries = (_b = options.maxTries) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_OPTIONS.maxTries; - const retryDelayInMs = (_c = options.retryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_RETRY_OPTIONS.retryDelayInMs; - const maxRetryDelayInMs = (_d = options.maxRetryDelayInMs) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; - const secondaryHost = (_e = options.secondaryHost) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.secondaryHost; - const tryTimeoutInMs = (_f = options.tryTimeoutInMs) !== null && _f !== void 0 ? _f : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; + const retryPolicyType = options.retryPolicyType ?? DEFAULT_RETRY_OPTIONS.retryPolicyType; + const maxTries = options.maxTries ?? DEFAULT_RETRY_OPTIONS.maxTries; + const retryDelayInMs = options.retryDelayInMs ?? DEFAULT_RETRY_OPTIONS.retryDelayInMs; + const maxRetryDelayInMs = options.maxRetryDelayInMs ?? DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; + const secondaryHost = options.secondaryHost ?? DEFAULT_RETRY_OPTIONS.secondaryHost; + const tryTimeoutInMs = options.tryTimeoutInMs ?? DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; function shouldRetry({ isPrimaryRetry, attempt, response, error }) { - var _a2, _b2; if (attempt >= maxTries) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); + log_js_1.logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); return false; } if (error) { for (const retriableError of retriableErrors) { if (error.name.toUpperCase().includes(retriableError) || error.message.toUpperCase().includes(retriableError) || error.code && error.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); + log_js_1.logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); return true; } } - if ((error === null || error === void 0 ? void 0 : error.code) === "PARSE_ERROR" && (error === null || error === void 0 ? void 0 : error.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); + if (error?.code === "PARSE_ERROR" && error?.message.startsWith(`Error "Error: Unclosed root tag`)) { + log_js_1.logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); return true; } } if (response || error) { - const statusCode = (_b2 = (_a2 = response === null || response === void 0 ? void 0 : response.status) !== null && _a2 !== void 0 ? _a2 : error === null || error === void 0 ? void 0 : error.statusCode) !== null && _b2 !== void 0 ? _b2 : 0; + const statusCode = response?.status ?? error?.statusCode ?? 0; if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); + log_js_1.logger.info(`RetryPolicy: Secondary access with 404, will retry.`); return true; } if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); + log_js_1.logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); return true; } } + if (response) { + if (response?.status >= 400) { + const copySourceError = response.headers.get(constants_js_1.HeaderConstants.X_MS_CopySourceErrorCode); + if (copySourceError !== void 0) { + switch (copySourceError) { + case "InternalError": + case "OperationTimedOut": + case "ServerBusy": + return true; + } + } + } + } return false; } __name(shouldRetry, "shouldRetry"); @@ -39151,28 +41292,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; let delayTimeInMs = 0; if (isPrimaryRetry) { switch (retryPolicyType) { - case StorageRetryPolicyType.EXPONENTIAL: + case StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.EXPONENTIAL: delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs); break; - case StorageRetryPolicyType.FIXED: + case StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.FIXED: delayTimeInMs = retryDelayInMs; break; } } else { delayTimeInMs = Math.random() * 1e3; } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); + log_js_1.logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); return delayTimeInMs; } __name(calculateDelay, "calculateDelay"); return { - name: storageRetryPolicyName, + name: exports2.storageRetryPolicyName, async sendRequest(request, next) { if (tryTimeoutInMs) { - request.url = setURLParameter(request.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); } const primaryUrl = request.url; - const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : void 0; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.url, secondaryHost) : void 0; let secondaryHas404 = false; let attempt = 1; let retryAgain = true; @@ -39184,55 +41325,69 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; response = void 0; error = void 0; try { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); + log_js_1.logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); response = await next(request); secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; } catch (e) { - if (coreRestPipeline.isRestError(e)) { - logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); + if ((0, core_rest_pipeline_1.isRestError)(e)) { + log_js_1.logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); error = e; } else { - logger.error(`RetryPolicy: Caught error, message: ${coreUtil.getErrorMessage(e)}`); + log_js_1.logger.error(`RetryPolicy: Caught error, message: ${(0, core_util_1.getErrorMessage)(e)}`); throw e; } } retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error }); if (retryAgain) { - await delay(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); + await (0, utils_common_js_1.delay)(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); } attempt++; } if (response) { return response; } - throw error !== null && error !== void 0 ? error : new coreRestPipeline.RestError("RetryPolicy failed without known error."); + throw error ?? new core_rest_pipeline_1.RestError("RetryPolicy failed without known error."); } }; } __name(storageRetryPolicy, "storageRetryPolicy"); - var storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.js +var require_StorageSharedKeyCredentialPolicyV2 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.storageSharedKeyCredentialPolicyName = void 0; + exports2.storageSharedKeyCredentialPolicy = storageSharedKeyCredentialPolicy; + var node_crypto_1 = require("node:crypto"); + var constants_js_1 = require_constants11(); + var utils_common_js_1 = require_utils_common2(); + var SharedKeyComparator_js_1 = require_SharedKeyComparator2(); + exports2.storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; function storageSharedKeyCredentialPolicy(options) { function signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); } const stringToSign = [ request.method.toUpperCase(), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - getHeaderValueToSign(request, HeaderConstants.DATE), - getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.RANGE) + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); - const signature = crypto4.createHmac("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); } __name(signRequest, "signRequest"); function getHeaderValueToSign(request, headerName) { @@ -39240,7 +41395,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!value) { return ""; } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { return ""; } return value; @@ -39249,12 +41404,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; function getCanonicalizedHeadersString(request) { let headersArray = []; for (const [name, value] of request.headers) { - if (name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE)) { + if (name.toLowerCase().startsWith(constants_js_1.HeaderConstants.PREFIX_FOR_STORAGE)) { headersArray.push({ name, value }); } } headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); + return (0, SharedKeyComparator_js_1.compareHeader)(a.name.toLowerCase(), b.name.toLowerCase()); }); headersArray = headersArray.filter((value, index, array) => { if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { @@ -39271,10 +41426,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } __name(getCanonicalizedHeadersString, "getCanonicalizedHeadersString"); function getCanonicalizedResourceString(request) { - const path2 = getURLPath(request.url) || "/"; + const path2 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; let canonicalizedResourceString = ""; canonicalizedResourceString += `/${options.accountName}${path2}`; - const queries = getURLQueries(request.url); + const queries = (0, utils_common_js_1.getURLQueries)(request.url); const lowercaseQueries = {}; if (queries) { const queryKeys = []; @@ -39295,7 +41450,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } __name(getCanonicalizedResourceString, "getCanonicalizedResourceString"); return { - name: storageSharedKeyCredentialPolicyName, + name: exports2.storageSharedKeyCredentialPolicyName, async sendRequest(request, next) { signRequest(request); return next(request); @@ -39303,7 +41458,377 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; } __name(storageSharedKeyCredentialPolicy, "storageSharedKeyCredentialPolicy"); - var StorageBrowserPolicy = class extends BaseRequestPolicy { + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/policies/StorageRequestFailureDetailsParserPolicy.js +var require_StorageRequestFailureDetailsParserPolicy = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/policies/StorageRequestFailureDetailsParserPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.storageRequestFailureDetailsParserPolicyName = void 0; + exports2.storageRequestFailureDetailsParserPolicy = storageRequestFailureDetailsParserPolicy; + exports2.storageRequestFailureDetailsParserPolicyName = "storageRequestFailureDetailsParserPolicy"; + function storageRequestFailureDetailsParserPolicy() { + return { + name: exports2.storageRequestFailureDetailsParserPolicyName, + async sendRequest(request, next) { + try { + const response = await next(request); + return response; + } catch (err) { + if (typeof err === "object" && err !== null && err.response && err.response.parsedBody) { + if (err.response.parsedBody.code === "InvalidHeaderValue" && err.response.parsedBody.HeaderName === "x-ms-version") { + err.message = "The provided service version is not enabled on this storage account. Please see https://learn.microsoft.com/rest/api/storageservices/versioning-for-the-azure-storage-services for additional information.\n"; + } + } + throw err; + } + } + }; + } + __name(storageRequestFailureDetailsParserPolicy, "storageRequestFailureDetailsParserPolicy"); + } +}); + +// node_modules/@azure/storage-common/dist/commonjs/index.js +var require_commonjs13 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BaseRequestPolicy = exports2.getCachedDefaultHttpClient = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + tslib_1.__exportStar(require_BufferScheduler(), exports2); + var cache_js_1 = require_cache2(); + Object.defineProperty(exports2, "getCachedDefaultHttpClient", { enumerable: true, get: function() { + return cache_js_1.getCachedDefaultHttpClient; + } }); + tslib_1.__exportStar(require_StorageBrowserPolicyFactory(), exports2); + tslib_1.__exportStar(require_AnonymousCredential2(), exports2); + tslib_1.__exportStar(require_Credential2(), exports2); + tslib_1.__exportStar(require_StorageSharedKeyCredential2(), exports2); + tslib_1.__exportStar(require_StorageRetryPolicyFactory2(), exports2); + var RequestPolicy_js_1 = require_RequestPolicy2(); + Object.defineProperty(exports2, "BaseRequestPolicy", { enumerable: true, get: function() { + return RequestPolicy_js_1.BaseRequestPolicy; + } }); + tslib_1.__exportStar(require_AnonymousCredentialPolicy2(), exports2); + tslib_1.__exportStar(require_CredentialPolicy2(), exports2); + tslib_1.__exportStar(require_StorageBrowserPolicy(), exports2); + tslib_1.__exportStar(require_StorageBrowserPolicyV2(), exports2); + tslib_1.__exportStar(require_StorageCorrectContentLengthPolicy(), exports2); + tslib_1.__exportStar(require_StorageRetryPolicyType2(), exports2); + tslib_1.__exportStar(require_StorageRetryPolicy2(), exports2); + tslib_1.__exportStar(require_StorageRetryPolicyV2(), exports2); + tslib_1.__exportStar(require_StorageSharedKeyCredentialPolicy2(), exports2); + tslib_1.__exportStar(require_StorageSharedKeyCredentialPolicyV2(), exports2); + tslib_1.__exportStar(require_StorageRetryPolicyFactory2(), exports2); + tslib_1.__exportStar(require_StorageRequestFailureDetailsParserPolicy(), exports2); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/policies/StorageBrowserPolicyV2.js +var require_StorageBrowserPolicyV22 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/policies/StorageBrowserPolicyV2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.storageBrowserPolicyName = void 0; + exports2.storageBrowserPolicy = storageBrowserPolicy; + var core_util_1 = require_commonjs4(); + var constants_js_1 = require_constants10(); + var utils_common_js_1 = require_utils_common(); + exports2.storageBrowserPolicyName = "storageBrowserPolicy"; + function storageBrowserPolicy() { + return { + name: exports2.storageBrowserPolicyName, + async sendRequest(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + __name(storageBrowserPolicy, "storageBrowserPolicy"); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/policies/StorageRetryPolicyV2.js +var require_StorageRetryPolicyV22 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/policies/StorageRetryPolicyV2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.storageRetryPolicyName = void 0; + exports2.storageRetryPolicy = storageRetryPolicy; + var abort_controller_1 = require_commonjs11(); + var core_rest_pipeline_1 = require_commonjs6(); + var core_util_1 = require_commonjs4(); + var StorageRetryPolicyFactory_js_1 = require_StorageRetryPolicyFactory(); + var constants_js_1 = require_constants10(); + var utils_common_js_1 = require_utils_common(); + var log_js_1 = require_log5(); + exports2.storageRetryPolicyName = "storageRetryPolicy"; + var DEFAULT_RETRY_OPTIONS = { + maxRetryDelayInMs: 120 * 1e3, + maxTries: 4, + retryDelayInMs: 4 * 1e3, + retryPolicyType: StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.EXPONENTIAL, + secondaryHost: "", + tryTimeoutInMs: void 0 + // Use server side default timeout strategy + }; + var retriableErrors = [ + "ETIMEDOUT", + "ESOCKETTIMEDOUT", + "ECONNREFUSED", + "ECONNRESET", + "ENOENT", + "ENOTFOUND", + "TIMEOUT", + "EPIPE", + "REQUEST_SEND_ERROR" + ]; + var RETRY_ABORT_ERROR = new abort_controller_1.AbortError("The operation was aborted."); + function storageRetryPolicy(options = {}) { + const retryPolicyType = options.retryPolicyType ?? DEFAULT_RETRY_OPTIONS.retryPolicyType; + const maxTries = options.maxTries ?? DEFAULT_RETRY_OPTIONS.maxTries; + const retryDelayInMs = options.retryDelayInMs ?? DEFAULT_RETRY_OPTIONS.retryDelayInMs; + const maxRetryDelayInMs = options.maxRetryDelayInMs ?? DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; + const secondaryHost = options.secondaryHost ?? DEFAULT_RETRY_OPTIONS.secondaryHost; + const tryTimeoutInMs = options.tryTimeoutInMs ?? DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; + function shouldRetry({ isPrimaryRetry, attempt, response, error }) { + if (attempt >= maxTries) { + log_js_1.logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); + return false; + } + if (error) { + for (const retriableError of retriableErrors) { + if (error.name.toUpperCase().includes(retriableError) || error.message.toUpperCase().includes(retriableError) || error.code && error.code.toString().toUpperCase() === retriableError) { + log_js_1.logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); + return true; + } + } + if (error?.code === "PARSE_ERROR" && error?.message.startsWith(`Error "Error: Unclosed root tag`)) { + log_js_1.logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); + return true; + } + } + if (response || error) { + const statusCode = response?.status ?? error?.statusCode ?? 0; + if (!isPrimaryRetry && statusCode === 404) { + log_js_1.logger.info(`RetryPolicy: Secondary access with 404, will retry.`); + return true; + } + if (statusCode === 503 || statusCode === 500) { + log_js_1.logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); + return true; + } + } + if (response) { + if (response?.status >= 400) { + const copySourceError = response.headers.get(constants_js_1.HeaderConstants.X_MS_CopySourceErrorCode); + if (copySourceError !== void 0) { + switch (copySourceError) { + case "InternalError": + case "OperationTimedOut": + case "ServerBusy": + return true; + } + } + } + } + return false; + } + __name(shouldRetry, "shouldRetry"); + function calculateDelay(isPrimaryRetry, attempt) { + let delayTimeInMs = 0; + if (isPrimaryRetry) { + switch (retryPolicyType) { + case StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.EXPONENTIAL: + delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs); + break; + case StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.FIXED: + delayTimeInMs = retryDelayInMs; + break; + } + } else { + delayTimeInMs = Math.random() * 1e3; + } + log_js_1.logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); + return delayTimeInMs; + } + __name(calculateDelay, "calculateDelay"); + return { + name: exports2.storageRetryPolicyName, + async sendRequest(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.url, secondaryHost) : void 0; + let secondaryHas404 = false; + let attempt = 1; + let retryAgain = true; + let response; + let error; + while (retryAgain) { + const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request.method) || attempt % 2 === 1; + request.url = isPrimaryRetry ? primaryUrl : secondaryUrl; + response = void 0; + error = void 0; + try { + log_js_1.logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); + response = await next(request); + secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; + } catch (e) { + if ((0, core_rest_pipeline_1.isRestError)(e)) { + log_js_1.logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); + error = e; + } else { + log_js_1.logger.error(`RetryPolicy: Caught error, message: ${(0, core_util_1.getErrorMessage)(e)}`); + throw e; + } + } + retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error }); + if (retryAgain) { + await (0, utils_common_js_1.delay)(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); + } + attempt++; + } + if (response) { + return response; + } + throw error ?? new core_rest_pipeline_1.RestError("RetryPolicy failed without known error."); + } + }; + } + __name(storageRetryPolicy, "storageRetryPolicy"); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.js +var require_StorageSharedKeyCredentialPolicyV22 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.storageSharedKeyCredentialPolicyName = void 0; + exports2.storageSharedKeyCredentialPolicy = storageSharedKeyCredentialPolicy; + var node_crypto_1 = require("node:crypto"); + var constants_js_1 = require_constants10(); + var utils_common_js_1 = require_utils_common(); + var SharedKeyComparator_js_1 = require_SharedKeyComparator(); + exports2.storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; + function storageSharedKeyCredentialPolicy(options) { + function signRequest(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + __name(signRequest, "signRequest"); + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + __name(getHeaderValueToSign, "getHeaderValueToSign"); + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.headers) { + if (name.toLowerCase().startsWith(constants_js_1.HeaderConstants.PREFIX_FOR_STORAGE)) { + headersArray.push({ name, value }); + } + } + headersArray.sort((a, b) => { + return (0, SharedKeyComparator_js_1.compareHeader)(a.name.toLowerCase(), b.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; + } + __name(getCanonicalizedHeadersString, "getCanonicalizedHeadersString"); + function getCanonicalizedResourceString(request) { + const path2 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path2}`; + const queries = (0, utils_common_js_1.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; + } + __name(getCanonicalizedResourceString, "getCanonicalizedResourceString"); + return { + name: exports2.storageSharedKeyCredentialPolicyName, + async sendRequest(request, next) { + signRequest(request); + return next(request); + } + }; + } + __name(storageSharedKeyCredentialPolicy, "storageSharedKeyCredentialPolicy"); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/policies/StorageBrowserPolicy.js +var require_StorageBrowserPolicy2 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/policies/StorageBrowserPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageBrowserPolicy = void 0; + var RequestPolicy_js_1 = require_RequestPolicy(); + var core_util_1 = require_commonjs4(); + var constants_js_1 = require_constants10(); + var utils_common_js_1 = require_utils_common(); + var StorageBrowserPolicy = class extends RequestPolicy_js_1.BaseRequestPolicy { static { __name(this, "StorageBrowserPolicy"); } @@ -39323,17 +41848,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param request - */ async sendRequest(request) { - if (coreUtil.isNode) { + if (core_util_1.isNodeLike) { return this._nextPolicy.sendRequest(request); } 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.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); } - request.headers.remove(HeaderConstants.COOKIE); - request.headers.remove(HeaderConstants.CONTENT_LENGTH); + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); return this._nextPolicy.sendRequest(request); } }; + exports2.StorageBrowserPolicy = StorageBrowserPolicy; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/StorageBrowserPolicyFactory.js +var require_StorageBrowserPolicyFactory2 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/StorageBrowserPolicyFactory.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageBrowserPolicyFactory = exports2.StorageBrowserPolicy = void 0; + var StorageBrowserPolicy_js_1 = require_StorageBrowserPolicy2(); + Object.defineProperty(exports2, "StorageBrowserPolicy", { enumerable: true, get: function() { + return StorageBrowserPolicy_js_1.StorageBrowserPolicy; + } }); var StorageBrowserPolicyFactory = class { static { __name(this, "StorageBrowserPolicyFactory"); @@ -39345,19 +41884,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ create(nextPolicy, options) { - return new StorageBrowserPolicy(nextPolicy, options); + return new StorageBrowserPolicy_js_1.StorageBrowserPolicy(nextPolicy, options); } }; - var storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; + exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/policies/StorageCorrectContentLengthPolicy.js +var require_StorageCorrectContentLengthPolicy2 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/policies/StorageCorrectContentLengthPolicy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.storageCorrectContentLengthPolicyName = void 0; + exports2.storageCorrectContentLengthPolicy = storageCorrectContentLengthPolicy; + var constants_js_1 = require_constants10(); + exports2.storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; function storageCorrectContentLengthPolicy() { function correctContentLength(request) { if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); } } __name(correctContentLength, "correctContentLength"); return { - name: storageCorrectContentLengthPolicyName, + name: exports2.storageCorrectContentLengthPolicyName, async sendRequest(request, next) { correctContentLength(request); return next(request); @@ -39365,6 +41916,38 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; } __name(storageCorrectContentLengthPolicy, "storageCorrectContentLengthPolicy"); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/Pipeline.js +var require_Pipeline = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/Pipeline.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Pipeline = exports2.StorageOAuthScopes = void 0; + exports2.isPipelineLike = isPipelineLike; + exports2.newPipeline = newPipeline; + exports2.getCoreClientOptions = getCoreClientOptions; + exports2.getCredentialFromPipeline = getCredentialFromPipeline; + var core_http_compat_1 = require_commonjs9(); + var core_rest_pipeline_1 = require_commonjs6(); + var core_client_1 = require_commonjs8(); + var core_xml_1 = require_commonjs10(); + var core_auth_1 = require_commonjs7(); + var log_js_1 = require_log5(); + var StorageRetryPolicyFactory_js_1 = require_StorageRetryPolicyFactory(); + var StorageSharedKeyCredential_js_1 = require_StorageSharedKeyCredential(); + var AnonymousCredential_js_1 = require_AnonymousCredential(); + var constants_js_1 = require_constants10(); + Object.defineProperty(exports2, "StorageOAuthScopes", { enumerable: true, get: function() { + return constants_js_1.StorageOAuthScopes; + } }); + var storage_common_1 = require_commonjs13(); + var StorageBrowserPolicyV2_js_1 = require_StorageBrowserPolicyV22(); + var StorageRetryPolicyV2_js_1 = require_StorageRetryPolicyV22(); + var StorageSharedKeyCredentialPolicyV2_js_1 = require_StorageSharedKeyCredentialPolicyV22(); + var StorageBrowserPolicyFactory_js_1 = require_StorageBrowserPolicyFactory2(); + var StorageCorrectContentLengthPolicy_js_1 = require_StorageCorrectContentLengthPolicy2(); function isPipelineLike(pipeline) { if (!pipeline || typeof pipeline !== "object") { return false; @@ -39377,6 +41960,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; static { __name(this, "Pipeline"); } + /** + * A list of chained request policy factories. + */ + factories; + /** + * Configures pipeline logger and HTTP client. + */ + options; /** * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface. * @@ -39400,9 +41991,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; } }; + exports2.Pipeline = Pipeline; function newPipeline(credential, pipelineOptions = {}) { if (!credential) { - credential = new AnonymousCredential(); + credential = new AnonymousCredential_js_1.AnonymousCredential(); } const pipeline = new Pipeline([], pipelineOptions); pipeline._credential = credential; @@ -39426,7 +42018,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (novelFactories.length) { const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory)); return { - wrappedPolicies: coreHttpCompat.createRequestPolicyFactoryPolicy(novelFactories), + wrappedPolicies: (0, core_http_compat_1.createRequestPolicyFactoryPolicy)(novelFactories), afterRetry: hasInjector }; } @@ -39435,76 +42027,87 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } __name(processDownlevelPipeline, "processDownlevelPipeline"); function getCoreClientOptions(pipeline) { - var _a; - const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = tslib.__rest(_b, ["httpClient"]); + const { httpClient: v1Client, ...restOptions } = pipeline.options; let httpClient = pipeline._coreHttpClient; if (!httpClient) { - httpClient = v1Client ? coreHttpCompat.convertHttpClient(v1Client) : getCachedDefaultHttpClient(); + httpClient = v1Client ? (0, core_http_compat_1.convertHttpClient)(v1Client) : (0, storage_common_1.getCachedDefaultHttpClient)(); pipeline._coreHttpClient = httpClient; } let corePipeline = pipeline._corePipeline; if (!corePipeline) { - const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`; + const packageDetails = `azsdk-js-azure-storage-blob/${constants_js_1.SDK_VERSION}`; const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - corePipeline = coreClient.createClientPipeline(Object.assign(Object.assign({}, restOptions), { loggingOptions: { - additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames, - additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters, - logger: logger.info - }, userAgentOptions: { - userAgentPrefix - }, serializationOptions: { - stringifyXML: coreXml.stringifyXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + corePipeline = (0, core_client_1.createClientPipeline)({ + ...restOptions, + loggingOptions: { + additionalAllowedHeaderNames: constants_js_1.StorageBlobLoggingAllowedHeaderNames, + additionalAllowedQueryParameters: constants_js_1.StorageBlobLoggingAllowedQueryParameters, + logger: log_js_1.logger.info + }, + userAgentOptions: { + userAgentPrefix + }, + serializationOptions: { + stringifyXML: core_xml_1.stringifyXML, + serializerOptions: { + xml: { + // Use customized XML char key of "#" so we can deserialize metadata + // with "_" key + xmlCharKey: "#" + } + } + }, + deserializationOptions: { + parseXML: core_xml_1.parseXML, + serializerOptions: { + xml: { + // Use customized XML char key of "#" so we can deserialize metadata + // with "_" key + xmlCharKey: "#" + } } } - }, deserializationOptions: { - parseXML: coreXml.parseXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" - } - } - } })); + }); corePipeline.removePolicy({ phase: "Retry" }); - corePipeline.removePolicy({ name: coreRestPipeline.decompressResponsePolicyName }); - corePipeline.addPolicy(storageCorrectContentLengthPolicy()); - corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" }); - corePipeline.addPolicy(storageBrowserPolicy()); + corePipeline.removePolicy({ name: core_rest_pipeline_1.decompressResponsePolicyName }); + corePipeline.addPolicy((0, StorageCorrectContentLengthPolicy_js_1.storageCorrectContentLengthPolicy)()); + corePipeline.addPolicy((0, StorageRetryPolicyV2_js_1.storageRetryPolicy)(restOptions.retryOptions), { phase: "Retry" }); + corePipeline.addPolicy((0, storage_common_1.storageRequestFailureDetailsParserPolicy)()); + corePipeline.addPolicy((0, StorageBrowserPolicyV2_js_1.storageBrowserPolicy)()); const downlevelResults = processDownlevelPipeline(pipeline); if (downlevelResults) { corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); } const credential = getCredentialFromPipeline(pipeline); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ + if ((0, core_auth_1.isTokenCredential)(credential)) { + corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ credential, - scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } + scopes: restOptions.audience ?? constants_js_1.StorageOAuthScopes, + challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge } }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ + } else if (credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { + corePipeline.addPolicy((0, StorageSharedKeyCredentialPolicyV2_js_1.storageSharedKeyCredentialPolicy)({ accountName: credential.accountName, accountKey: credential.accountKey }), { phase: "Sign" }); } pipeline._corePipeline = corePipeline; } - return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline }); + return { + ...restOptions, + allowInsecureConnection: true, + httpClient, + pipeline: corePipeline + }; } __name(getCoreClientOptions, "getCoreClientOptions"); function getCredentialFromPipeline(pipeline) { if (pipeline._credential) { return pipeline._credential; } - let credential = new AnonymousCredential(); + let credential = new AnonymousCredential_js_1.AnonymousCredential(); for (const factory of pipeline.factories) { - if (coreAuth.isTokenCredential(factory.credential)) { + if ((0, core_auth_1.isTokenCredential)(factory.credential)) { credential = factory.credential; } else if (isStorageSharedKeyCredential(factory)) { return factory; @@ -39514,32 +42117,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } __name(getCredentialFromPipeline, "getCredentialFromPipeline"); function isStorageSharedKeyCredential(factory) { - if (factory instanceof StorageSharedKeyCredential) { + if (factory instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { return true; } return factory.constructor.name === "StorageSharedKeyCredential"; } __name(isStorageSharedKeyCredential, "isStorageSharedKeyCredential"); function isAnonymousCredential(factory) { - if (factory instanceof AnonymousCredential) { + if (factory instanceof AnonymousCredential_js_1.AnonymousCredential) { return true; } return factory.constructor.name === "AnonymousCredential"; } __name(isAnonymousCredential, "isAnonymousCredential"); function isCoreHttpBearerTokenFactory(factory) { - return coreAuth.isTokenCredential(factory.credential); + return (0, core_auth_1.isTokenCredential)(factory.credential); } __name(isCoreHttpBearerTokenFactory, "isCoreHttpBearerTokenFactory"); function isStorageBrowserPolicyFactory(factory) { - if (factory instanceof StorageBrowserPolicyFactory) { + if (factory instanceof StorageBrowserPolicyFactory_js_1.StorageBrowserPolicyFactory) { return true; } return factory.constructor.name === "StorageBrowserPolicyFactory"; } __name(isStorageBrowserPolicyFactory, "isStorageBrowserPolicyFactory"); function isStorageRetryPolicyFactory(factory) { - if (factory instanceof StorageRetryPolicyFactory) { + if (factory instanceof StorageRetryPolicyFactory_js_1.StorageRetryPolicyFactory) { return true; } return factory.constructor.name === "StorageRetryPolicyFactory"; @@ -39586,7 +42189,160 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } __name(isCoreHttpPolicyFactory, "isCoreHttpPolicyFactory"); - var BlobServiceProperties = { + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/models/index.js +var require_models = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/models/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.KnownStorageErrorCode = exports2.KnownBlobExpiryOptions = exports2.KnownFileShareTokenIntent = exports2.KnownEncryptionAlgorithmType = void 0; + var KnownEncryptionAlgorithmType; + (function(KnownEncryptionAlgorithmType2) { + KnownEncryptionAlgorithmType2["AES256"] = "AES256"; + })(KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = KnownEncryptionAlgorithmType = {})); + var KnownFileShareTokenIntent; + (function(KnownFileShareTokenIntent2) { + KnownFileShareTokenIntent2["Backup"] = "backup"; + })(KnownFileShareTokenIntent || (exports2.KnownFileShareTokenIntent = KnownFileShareTokenIntent = {})); + var KnownBlobExpiryOptions; + (function(KnownBlobExpiryOptions2) { + KnownBlobExpiryOptions2["NeverExpire"] = "NeverExpire"; + KnownBlobExpiryOptions2["RelativeToCreation"] = "RelativeToCreation"; + KnownBlobExpiryOptions2["RelativeToNow"] = "RelativeToNow"; + KnownBlobExpiryOptions2["Absolute"] = "Absolute"; + })(KnownBlobExpiryOptions || (exports2.KnownBlobExpiryOptions = KnownBlobExpiryOptions = {})); + var KnownStorageErrorCode; + (function(KnownStorageErrorCode2) { + KnownStorageErrorCode2["AccountAlreadyExists"] = "AccountAlreadyExists"; + KnownStorageErrorCode2["AccountBeingCreated"] = "AccountBeingCreated"; + KnownStorageErrorCode2["AccountIsDisabled"] = "AccountIsDisabled"; + KnownStorageErrorCode2["AuthenticationFailed"] = "AuthenticationFailed"; + KnownStorageErrorCode2["AuthorizationFailure"] = "AuthorizationFailure"; + KnownStorageErrorCode2["ConditionHeadersNotSupported"] = "ConditionHeadersNotSupported"; + KnownStorageErrorCode2["ConditionNotMet"] = "ConditionNotMet"; + KnownStorageErrorCode2["EmptyMetadataKey"] = "EmptyMetadataKey"; + KnownStorageErrorCode2["InsufficientAccountPermissions"] = "InsufficientAccountPermissions"; + KnownStorageErrorCode2["InternalError"] = "InternalError"; + KnownStorageErrorCode2["InvalidAuthenticationInfo"] = "InvalidAuthenticationInfo"; + KnownStorageErrorCode2["InvalidHeaderValue"] = "InvalidHeaderValue"; + KnownStorageErrorCode2["InvalidHttpVerb"] = "InvalidHttpVerb"; + KnownStorageErrorCode2["InvalidInput"] = "InvalidInput"; + KnownStorageErrorCode2["InvalidMd5"] = "InvalidMd5"; + KnownStorageErrorCode2["InvalidMetadata"] = "InvalidMetadata"; + KnownStorageErrorCode2["InvalidQueryParameterValue"] = "InvalidQueryParameterValue"; + KnownStorageErrorCode2["InvalidRange"] = "InvalidRange"; + KnownStorageErrorCode2["InvalidResourceName"] = "InvalidResourceName"; + KnownStorageErrorCode2["InvalidUri"] = "InvalidUri"; + KnownStorageErrorCode2["InvalidXmlDocument"] = "InvalidXmlDocument"; + KnownStorageErrorCode2["InvalidXmlNodeValue"] = "InvalidXmlNodeValue"; + KnownStorageErrorCode2["Md5Mismatch"] = "Md5Mismatch"; + KnownStorageErrorCode2["MetadataTooLarge"] = "MetadataTooLarge"; + KnownStorageErrorCode2["MissingContentLengthHeader"] = "MissingContentLengthHeader"; + KnownStorageErrorCode2["MissingRequiredQueryParameter"] = "MissingRequiredQueryParameter"; + KnownStorageErrorCode2["MissingRequiredHeader"] = "MissingRequiredHeader"; + KnownStorageErrorCode2["MissingRequiredXmlNode"] = "MissingRequiredXmlNode"; + KnownStorageErrorCode2["MultipleConditionHeadersNotSupported"] = "MultipleConditionHeadersNotSupported"; + KnownStorageErrorCode2["OperationTimedOut"] = "OperationTimedOut"; + KnownStorageErrorCode2["OutOfRangeInput"] = "OutOfRangeInput"; + KnownStorageErrorCode2["OutOfRangeQueryParameterValue"] = "OutOfRangeQueryParameterValue"; + KnownStorageErrorCode2["RequestBodyTooLarge"] = "RequestBodyTooLarge"; + KnownStorageErrorCode2["ResourceTypeMismatch"] = "ResourceTypeMismatch"; + KnownStorageErrorCode2["RequestUrlFailedToParse"] = "RequestUrlFailedToParse"; + KnownStorageErrorCode2["ResourceAlreadyExists"] = "ResourceAlreadyExists"; + KnownStorageErrorCode2["ResourceNotFound"] = "ResourceNotFound"; + KnownStorageErrorCode2["ServerBusy"] = "ServerBusy"; + KnownStorageErrorCode2["UnsupportedHeader"] = "UnsupportedHeader"; + KnownStorageErrorCode2["UnsupportedXmlNode"] = "UnsupportedXmlNode"; + KnownStorageErrorCode2["UnsupportedQueryParameter"] = "UnsupportedQueryParameter"; + KnownStorageErrorCode2["UnsupportedHttpVerb"] = "UnsupportedHttpVerb"; + KnownStorageErrorCode2["AppendPositionConditionNotMet"] = "AppendPositionConditionNotMet"; + KnownStorageErrorCode2["BlobAlreadyExists"] = "BlobAlreadyExists"; + KnownStorageErrorCode2["BlobImmutableDueToPolicy"] = "BlobImmutableDueToPolicy"; + KnownStorageErrorCode2["BlobNotFound"] = "BlobNotFound"; + KnownStorageErrorCode2["BlobOverwritten"] = "BlobOverwritten"; + KnownStorageErrorCode2["BlobTierInadequateForContentLength"] = "BlobTierInadequateForContentLength"; + KnownStorageErrorCode2["BlobUsesCustomerSpecifiedEncryption"] = "BlobUsesCustomerSpecifiedEncryption"; + KnownStorageErrorCode2["BlockCountExceedsLimit"] = "BlockCountExceedsLimit"; + KnownStorageErrorCode2["BlockListTooLong"] = "BlockListTooLong"; + KnownStorageErrorCode2["CannotChangeToLowerTier"] = "CannotChangeToLowerTier"; + KnownStorageErrorCode2["CannotVerifyCopySource"] = "CannotVerifyCopySource"; + KnownStorageErrorCode2["ContainerAlreadyExists"] = "ContainerAlreadyExists"; + KnownStorageErrorCode2["ContainerBeingDeleted"] = "ContainerBeingDeleted"; + KnownStorageErrorCode2["ContainerDisabled"] = "ContainerDisabled"; + KnownStorageErrorCode2["ContainerNotFound"] = "ContainerNotFound"; + KnownStorageErrorCode2["ContentLengthLargerThanTierLimit"] = "ContentLengthLargerThanTierLimit"; + KnownStorageErrorCode2["CopyAcrossAccountsNotSupported"] = "CopyAcrossAccountsNotSupported"; + KnownStorageErrorCode2["CopyIdMismatch"] = "CopyIdMismatch"; + KnownStorageErrorCode2["FeatureVersionMismatch"] = "FeatureVersionMismatch"; + KnownStorageErrorCode2["IncrementalCopyBlobMismatch"] = "IncrementalCopyBlobMismatch"; + KnownStorageErrorCode2["IncrementalCopyOfEarlierVersionSnapshotNotAllowed"] = "IncrementalCopyOfEarlierVersionSnapshotNotAllowed"; + KnownStorageErrorCode2["IncrementalCopySourceMustBeSnapshot"] = "IncrementalCopySourceMustBeSnapshot"; + KnownStorageErrorCode2["InfiniteLeaseDurationRequired"] = "InfiniteLeaseDurationRequired"; + KnownStorageErrorCode2["InvalidBlobOrBlock"] = "InvalidBlobOrBlock"; + KnownStorageErrorCode2["InvalidBlobTier"] = "InvalidBlobTier"; + KnownStorageErrorCode2["InvalidBlobType"] = "InvalidBlobType"; + KnownStorageErrorCode2["InvalidBlockId"] = "InvalidBlockId"; + KnownStorageErrorCode2["InvalidBlockList"] = "InvalidBlockList"; + KnownStorageErrorCode2["InvalidOperation"] = "InvalidOperation"; + KnownStorageErrorCode2["InvalidPageRange"] = "InvalidPageRange"; + KnownStorageErrorCode2["InvalidSourceBlobType"] = "InvalidSourceBlobType"; + KnownStorageErrorCode2["InvalidSourceBlobUrl"] = "InvalidSourceBlobUrl"; + KnownStorageErrorCode2["InvalidVersionForPageBlobOperation"] = "InvalidVersionForPageBlobOperation"; + KnownStorageErrorCode2["LeaseAlreadyPresent"] = "LeaseAlreadyPresent"; + KnownStorageErrorCode2["LeaseAlreadyBroken"] = "LeaseAlreadyBroken"; + KnownStorageErrorCode2["LeaseIdMismatchWithBlobOperation"] = "LeaseIdMismatchWithBlobOperation"; + KnownStorageErrorCode2["LeaseIdMismatchWithContainerOperation"] = "LeaseIdMismatchWithContainerOperation"; + KnownStorageErrorCode2["LeaseIdMismatchWithLeaseOperation"] = "LeaseIdMismatchWithLeaseOperation"; + KnownStorageErrorCode2["LeaseIdMissing"] = "LeaseIdMissing"; + KnownStorageErrorCode2["LeaseIsBreakingAndCannotBeAcquired"] = "LeaseIsBreakingAndCannotBeAcquired"; + KnownStorageErrorCode2["LeaseIsBreakingAndCannotBeChanged"] = "LeaseIsBreakingAndCannotBeChanged"; + KnownStorageErrorCode2["LeaseIsBrokenAndCannotBeRenewed"] = "LeaseIsBrokenAndCannotBeRenewed"; + KnownStorageErrorCode2["LeaseLost"] = "LeaseLost"; + KnownStorageErrorCode2["LeaseNotPresentWithBlobOperation"] = "LeaseNotPresentWithBlobOperation"; + KnownStorageErrorCode2["LeaseNotPresentWithContainerOperation"] = "LeaseNotPresentWithContainerOperation"; + KnownStorageErrorCode2["LeaseNotPresentWithLeaseOperation"] = "LeaseNotPresentWithLeaseOperation"; + KnownStorageErrorCode2["MaxBlobSizeConditionNotMet"] = "MaxBlobSizeConditionNotMet"; + KnownStorageErrorCode2["NoAuthenticationInformation"] = "NoAuthenticationInformation"; + KnownStorageErrorCode2["NoPendingCopyOperation"] = "NoPendingCopyOperation"; + KnownStorageErrorCode2["OperationNotAllowedOnIncrementalCopyBlob"] = "OperationNotAllowedOnIncrementalCopyBlob"; + KnownStorageErrorCode2["PendingCopyOperation"] = "PendingCopyOperation"; + KnownStorageErrorCode2["PreviousSnapshotCannotBeNewer"] = "PreviousSnapshotCannotBeNewer"; + KnownStorageErrorCode2["PreviousSnapshotNotFound"] = "PreviousSnapshotNotFound"; + KnownStorageErrorCode2["PreviousSnapshotOperationNotSupported"] = "PreviousSnapshotOperationNotSupported"; + KnownStorageErrorCode2["SequenceNumberConditionNotMet"] = "SequenceNumberConditionNotMet"; + KnownStorageErrorCode2["SequenceNumberIncrementTooLarge"] = "SequenceNumberIncrementTooLarge"; + KnownStorageErrorCode2["SnapshotCountExceeded"] = "SnapshotCountExceeded"; + KnownStorageErrorCode2["SnapshotOperationRateExceeded"] = "SnapshotOperationRateExceeded"; + KnownStorageErrorCode2["SnapshotsPresent"] = "SnapshotsPresent"; + KnownStorageErrorCode2["SourceConditionNotMet"] = "SourceConditionNotMet"; + KnownStorageErrorCode2["SystemInUse"] = "SystemInUse"; + KnownStorageErrorCode2["TargetConditionNotMet"] = "TargetConditionNotMet"; + KnownStorageErrorCode2["UnauthorizedBlobOverwrite"] = "UnauthorizedBlobOverwrite"; + KnownStorageErrorCode2["BlobBeingRehydrated"] = "BlobBeingRehydrated"; + KnownStorageErrorCode2["BlobArchived"] = "BlobArchived"; + KnownStorageErrorCode2["BlobNotArchived"] = "BlobNotArchived"; + KnownStorageErrorCode2["AuthorizationSourceIPMismatch"] = "AuthorizationSourceIPMismatch"; + KnownStorageErrorCode2["AuthorizationProtocolMismatch"] = "AuthorizationProtocolMismatch"; + KnownStorageErrorCode2["AuthorizationPermissionMismatch"] = "AuthorizationPermissionMismatch"; + KnownStorageErrorCode2["AuthorizationServiceMismatch"] = "AuthorizationServiceMismatch"; + KnownStorageErrorCode2["AuthorizationResourceTypeMismatch"] = "AuthorizationResourceTypeMismatch"; + KnownStorageErrorCode2["BlobAccessTierNotSupportedForAccountType"] = "BlobAccessTierNotSupportedForAccountType"; + })(KnownStorageErrorCode || (exports2.KnownStorageErrorCode = KnownStorageErrorCode = {})); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/models/mappers.js +var require_mappers = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/models/mappers.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ServiceGetUserDelegationKeyHeaders = exports2.ServiceListContainersSegmentExceptionHeaders = exports2.ServiceListContainersSegmentHeaders = exports2.ServiceGetStatisticsExceptionHeaders = exports2.ServiceGetStatisticsHeaders = exports2.ServiceGetPropertiesExceptionHeaders = exports2.ServiceGetPropertiesHeaders = exports2.ServiceSetPropertiesExceptionHeaders = exports2.ServiceSetPropertiesHeaders = exports2.ArrowField = exports2.ArrowConfiguration = exports2.JsonTextConfiguration = exports2.DelimitedTextConfiguration = exports2.QueryFormat = exports2.QuerySerialization = exports2.QueryRequest = exports2.ClearRange = exports2.PageRange = exports2.PageList = exports2.Block = exports2.BlockList = exports2.BlockLookupList = exports2.BlobPrefix = exports2.BlobHierarchyListSegment = exports2.ListBlobsHierarchySegmentResponse = exports2.BlobPropertiesInternal = exports2.BlobName = exports2.BlobItemInternal = exports2.BlobFlatListSegment = exports2.ListBlobsFlatSegmentResponse = exports2.AccessPolicy = exports2.SignedIdentifier = exports2.BlobTag = exports2.BlobTags = exports2.FilterBlobItem = exports2.FilterBlobSegment = exports2.UserDelegationKey = exports2.KeyInfo = exports2.ContainerProperties = exports2.ContainerItem = exports2.ListContainersSegmentResponse = exports2.GeoReplication = exports2.BlobServiceStatistics = exports2.StorageError = exports2.StaticWebsite = exports2.CorsRule = exports2.Metrics = exports2.RetentionPolicy = exports2.Logging = exports2.BlobServiceProperties = void 0; + exports2.BlobUndeleteHeaders = exports2.BlobDeleteExceptionHeaders = exports2.BlobDeleteHeaders = exports2.BlobGetPropertiesExceptionHeaders = exports2.BlobGetPropertiesHeaders = exports2.BlobDownloadExceptionHeaders = exports2.BlobDownloadHeaders = exports2.ContainerGetAccountInfoExceptionHeaders = exports2.ContainerGetAccountInfoHeaders = exports2.ContainerListBlobHierarchySegmentExceptionHeaders = exports2.ContainerListBlobHierarchySegmentHeaders = exports2.ContainerListBlobFlatSegmentExceptionHeaders = exports2.ContainerListBlobFlatSegmentHeaders = exports2.ContainerChangeLeaseExceptionHeaders = exports2.ContainerChangeLeaseHeaders = exports2.ContainerBreakLeaseExceptionHeaders = exports2.ContainerBreakLeaseHeaders = exports2.ContainerRenewLeaseExceptionHeaders = exports2.ContainerRenewLeaseHeaders = exports2.ContainerReleaseLeaseExceptionHeaders = exports2.ContainerReleaseLeaseHeaders = exports2.ContainerAcquireLeaseExceptionHeaders = exports2.ContainerAcquireLeaseHeaders = exports2.ContainerFilterBlobsExceptionHeaders = exports2.ContainerFilterBlobsHeaders = exports2.ContainerSubmitBatchExceptionHeaders = exports2.ContainerSubmitBatchHeaders = exports2.ContainerRenameExceptionHeaders = exports2.ContainerRenameHeaders = exports2.ContainerRestoreExceptionHeaders = exports2.ContainerRestoreHeaders = exports2.ContainerSetAccessPolicyExceptionHeaders = exports2.ContainerSetAccessPolicyHeaders = exports2.ContainerGetAccessPolicyExceptionHeaders = exports2.ContainerGetAccessPolicyHeaders = exports2.ContainerSetMetadataExceptionHeaders = exports2.ContainerSetMetadataHeaders = exports2.ContainerDeleteExceptionHeaders = exports2.ContainerDeleteHeaders = exports2.ContainerGetPropertiesExceptionHeaders = exports2.ContainerGetPropertiesHeaders = exports2.ContainerCreateExceptionHeaders = exports2.ContainerCreateHeaders = exports2.ServiceFilterBlobsExceptionHeaders = exports2.ServiceFilterBlobsHeaders = exports2.ServiceSubmitBatchExceptionHeaders = exports2.ServiceSubmitBatchHeaders = exports2.ServiceGetAccountInfoExceptionHeaders = exports2.ServiceGetAccountInfoHeaders = exports2.ServiceGetUserDelegationKeyExceptionHeaders = void 0; + exports2.PageBlobGetPageRangesHeaders = exports2.PageBlobUploadPagesFromURLExceptionHeaders = exports2.PageBlobUploadPagesFromURLHeaders = exports2.PageBlobClearPagesExceptionHeaders = exports2.PageBlobClearPagesHeaders = exports2.PageBlobUploadPagesExceptionHeaders = exports2.PageBlobUploadPagesHeaders = exports2.PageBlobCreateExceptionHeaders = exports2.PageBlobCreateHeaders = exports2.BlobSetTagsExceptionHeaders = exports2.BlobSetTagsHeaders = exports2.BlobGetTagsExceptionHeaders = exports2.BlobGetTagsHeaders = exports2.BlobQueryExceptionHeaders = exports2.BlobQueryHeaders = exports2.BlobGetAccountInfoExceptionHeaders = exports2.BlobGetAccountInfoHeaders = exports2.BlobSetTierExceptionHeaders = exports2.BlobSetTierHeaders = exports2.BlobAbortCopyFromURLExceptionHeaders = exports2.BlobAbortCopyFromURLHeaders = exports2.BlobCopyFromURLExceptionHeaders = exports2.BlobCopyFromURLHeaders = exports2.BlobStartCopyFromURLExceptionHeaders = exports2.BlobStartCopyFromURLHeaders = exports2.BlobCreateSnapshotExceptionHeaders = exports2.BlobCreateSnapshotHeaders = exports2.BlobBreakLeaseExceptionHeaders = exports2.BlobBreakLeaseHeaders = exports2.BlobChangeLeaseExceptionHeaders = exports2.BlobChangeLeaseHeaders = exports2.BlobRenewLeaseExceptionHeaders = exports2.BlobRenewLeaseHeaders = exports2.BlobReleaseLeaseExceptionHeaders = exports2.BlobReleaseLeaseHeaders = exports2.BlobAcquireLeaseExceptionHeaders = exports2.BlobAcquireLeaseHeaders = exports2.BlobSetMetadataExceptionHeaders = exports2.BlobSetMetadataHeaders = exports2.BlobSetLegalHoldExceptionHeaders = exports2.BlobSetLegalHoldHeaders = exports2.BlobDeleteImmutabilityPolicyExceptionHeaders = exports2.BlobDeleteImmutabilityPolicyHeaders = exports2.BlobSetImmutabilityPolicyExceptionHeaders = exports2.BlobSetImmutabilityPolicyHeaders = exports2.BlobSetHttpHeadersExceptionHeaders = exports2.BlobSetHttpHeadersHeaders = exports2.BlobSetExpiryExceptionHeaders = exports2.BlobSetExpiryHeaders = exports2.BlobUndeleteExceptionHeaders = void 0; + exports2.BlockBlobGetBlockListExceptionHeaders = exports2.BlockBlobGetBlockListHeaders = exports2.BlockBlobCommitBlockListExceptionHeaders = exports2.BlockBlobCommitBlockListHeaders = exports2.BlockBlobStageBlockFromURLExceptionHeaders = exports2.BlockBlobStageBlockFromURLHeaders = exports2.BlockBlobStageBlockExceptionHeaders = exports2.BlockBlobStageBlockHeaders = exports2.BlockBlobPutBlobFromUrlExceptionHeaders = exports2.BlockBlobPutBlobFromUrlHeaders = exports2.BlockBlobUploadExceptionHeaders = exports2.BlockBlobUploadHeaders = exports2.AppendBlobSealExceptionHeaders = exports2.AppendBlobSealHeaders = exports2.AppendBlobAppendBlockFromUrlExceptionHeaders = exports2.AppendBlobAppendBlockFromUrlHeaders = exports2.AppendBlobAppendBlockExceptionHeaders = exports2.AppendBlobAppendBlockHeaders = exports2.AppendBlobCreateExceptionHeaders = exports2.AppendBlobCreateHeaders = exports2.PageBlobCopyIncrementalExceptionHeaders = exports2.PageBlobCopyIncrementalHeaders = exports2.PageBlobUpdateSequenceNumberExceptionHeaders = exports2.PageBlobUpdateSequenceNumberHeaders = exports2.PageBlobResizeExceptionHeaders = exports2.PageBlobResizeHeaders = exports2.PageBlobGetPageRangesDiffExceptionHeaders = exports2.PageBlobGetPageRangesDiffHeaders = exports2.PageBlobGetPageRangesExceptionHeaders = void 0; + exports2.BlobServiceProperties = { serializedName: "BlobServiceProperties", xmlName: "StorageServiceProperties", type: { @@ -39658,7 +42414,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var Logging = { + exports2.Logging = { serializedName: "Logging", type: { name: "Composite", @@ -39707,7 +42463,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var RetentionPolicy = { + exports2.RetentionPolicy = { serializedName: "RetentionPolicy", type: { name: "Composite", @@ -39734,7 +42490,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var Metrics = { + exports2.Metrics = { serializedName: "Metrics", type: { name: "Composite", @@ -39773,7 +42529,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var CorsRule = { + exports2.CorsRule = { serializedName: "CorsRule", type: { name: "Composite", @@ -39825,7 +42581,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var StaticWebsite = { + exports2.StaticWebsite = { serializedName: "StaticWebsite", type: { name: "Composite", @@ -39863,7 +42619,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var StorageError = { + exports2.StorageError = { serializedName: "StorageError", type: { name: "Composite", @@ -39876,6 +42632,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + copySourceStatusCode: { + serializedName: "CopySourceStatusCode", + xmlName: "CopySourceStatusCode", + type: { + name: "Number" + } + }, + copySourceErrorCode: { + serializedName: "CopySourceErrorCode", + xmlName: "CopySourceErrorCode", + type: { + name: "String" + } + }, + copySourceErrorMessage: { + serializedName: "CopySourceErrorMessage", + xmlName: "CopySourceErrorMessage", + type: { + name: "String" + } + }, code: { serializedName: "Code", xmlName: "Code", @@ -39893,7 +42670,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobServiceStatistics = { + exports2.BlobServiceStatistics = { serializedName: "BlobServiceStatistics", xmlName: "StorageServiceStats", type: { @@ -39911,7 +42688,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var GeoReplication = { + exports2.GeoReplication = { serializedName: "GeoReplication", type: { name: "Composite", @@ -39937,7 +42714,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ListContainersSegmentResponse = { + exports2.ListContainersSegmentResponse = { serializedName: "ListContainersSegmentResponse", xmlName: "EnumerationResults", type: { @@ -40000,7 +42777,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerItem = { + exports2.ContainerItem = { serializedName: "ContainerItem", xmlName: "Container", type: { @@ -40048,7 +42825,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerProperties = { + exports2.ContainerProperties = { serializedName: "ContainerProperties", type: { name: "Composite", @@ -40160,7 +42937,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var KeyInfo = { + exports2.KeyInfo = { serializedName: "KeyInfo", type: { name: "Composite", @@ -40185,7 +42962,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var UserDelegationKey = { + exports2.UserDelegationKey = { serializedName: "UserDelegationKey", type: { name: "Composite", @@ -40250,7 +43027,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var FilterBlobSegment = { + exports2.FilterBlobSegment = { serializedName: "FilterBlobSegment", xmlName: "EnumerationResults", type: { @@ -40300,7 +43077,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var FilterBlobItem = { + exports2.FilterBlobItem = { serializedName: "FilterBlobItem", xmlName: "Blob", type: { @@ -40334,7 +43111,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobTags = { + exports2.BlobTags = { serializedName: "BlobTags", xmlName: "Tags", type: { @@ -40360,7 +43137,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobTag = { + exports2.BlobTag = { serializedName: "BlobTag", xmlName: "Tag", type: { @@ -40386,7 +43163,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var SignedIdentifier = { + exports2.SignedIdentifier = { serializedName: "SignedIdentifier", xmlName: "SignedIdentifier", type: { @@ -40412,7 +43189,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var AccessPolicy = { + exports2.AccessPolicy = { serializedName: "AccessPolicy", type: { name: "Composite", @@ -40442,7 +43219,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ListBlobsFlatSegmentResponse = { + exports2.ListBlobsFlatSegmentResponse = { serializedName: "ListBlobsFlatSegmentResponse", xmlName: "EnumerationResults", type: { @@ -40506,7 +43283,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobFlatListSegment = { + exports2.BlobFlatListSegment = { serializedName: "BlobFlatListSegment", xmlName: "Blobs", type: { @@ -40531,7 +43308,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobItemInternal = { + exports2.BlobItemInternal = { serializedName: "BlobItemInternal", xmlName: "Blob", type: { @@ -40618,7 +43395,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobName = { + exports2.BlobName = { serializedName: "BlobName", type: { name: "Composite", @@ -40643,7 +43420,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobPropertiesInternal = { + exports2.BlobPropertiesInternal = { serializedName: "BlobPropertiesInternal", xmlName: "Properties", type: { @@ -40970,7 +43747,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ListBlobsHierarchySegmentResponse = { + exports2.ListBlobsHierarchySegmentResponse = { serializedName: "ListBlobsHierarchySegmentResponse", xmlName: "EnumerationResults", type: { @@ -41041,7 +43818,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobHierarchyListSegment = { + exports2.BlobHierarchyListSegment = { serializedName: "BlobHierarchyListSegment", xmlName: "Blobs", type: { @@ -41080,7 +43857,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobPrefix = { + exports2.BlobPrefix = { serializedName: "BlobPrefix", type: { name: "Composite", @@ -41097,7 +43874,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlockLookupList = { + exports2.BlockLookupList = { serializedName: "BlockLookupList", xmlName: "BlockList", type: { @@ -41146,7 +43923,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlockList = { + exports2.BlockList = { serializedName: "BlockList", type: { name: "Composite", @@ -41185,7 +43962,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var Block = { + exports2.Block = { serializedName: "Block", type: { name: "Composite", @@ -41210,7 +43987,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageList = { + exports2.PageList = { serializedName: "PageList", type: { name: "Composite", @@ -41254,7 +44031,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageRange = { + exports2.PageRange = { serializedName: "PageRange", xmlName: "PageRange", type: { @@ -41280,7 +44057,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ClearRange = { + exports2.ClearRange = { serializedName: "ClearRange", xmlName: "ClearRange", type: { @@ -41306,7 +44083,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var QueryRequest = { + exports2.QueryRequest = { serializedName: "QueryRequest", xmlName: "QueryRequest", type: { @@ -41348,7 +44125,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var QuerySerialization = { + exports2.QuerySerialization = { serializedName: "QuerySerialization", type: { name: "Composite", @@ -41365,7 +44142,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var QueryFormat = { + exports2.QueryFormat = { serializedName: "QueryFormat", type: { name: "Composite", @@ -41415,7 +44192,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var DelimitedTextConfiguration = { + exports2.DelimitedTextConfiguration = { serializedName: "DelimitedTextConfiguration", xmlName: "DelimitedTextConfiguration", type: { @@ -41460,7 +44237,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var JsonTextConfiguration = { + exports2.JsonTextConfiguration = { serializedName: "JsonTextConfiguration", xmlName: "JsonTextConfiguration", type: { @@ -41477,7 +44254,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ArrowConfiguration = { + exports2.ArrowConfiguration = { serializedName: "ArrowConfiguration", xmlName: "ArrowConfiguration", type: { @@ -41503,7 +44280,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ArrowField = { + exports2.ArrowField = { serializedName: "ArrowField", xmlName: "Field", type: { @@ -41542,7 +44319,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSetPropertiesHeaders = { + exports2.ServiceSetPropertiesHeaders = { serializedName: "Service_setPropertiesHeaders", type: { name: "Composite", @@ -41579,7 +44356,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSetPropertiesExceptionHeaders = { + exports2.ServiceSetPropertiesExceptionHeaders = { serializedName: "Service_setPropertiesExceptionHeaders", type: { name: "Composite", @@ -41595,7 +44372,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesHeaders = { + exports2.ServiceGetPropertiesHeaders = { serializedName: "Service_getPropertiesHeaders", type: { name: "Composite", @@ -41632,7 +44409,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesExceptionHeaders = { + exports2.ServiceGetPropertiesExceptionHeaders = { serializedName: "Service_getPropertiesExceptionHeaders", type: { name: "Composite", @@ -41648,7 +44425,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetStatisticsHeaders = { + exports2.ServiceGetStatisticsHeaders = { serializedName: "Service_getStatisticsHeaders", type: { name: "Composite", @@ -41692,7 +44469,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetStatisticsExceptionHeaders = { + exports2.ServiceGetStatisticsExceptionHeaders = { serializedName: "Service_getStatisticsExceptionHeaders", type: { name: "Composite", @@ -41708,7 +44485,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceListContainersSegmentHeaders = { + exports2.ServiceListContainersSegmentHeaders = { serializedName: "Service_listContainersSegmentHeaders", type: { name: "Composite", @@ -41745,7 +44522,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceListContainersSegmentExceptionHeaders = { + exports2.ServiceListContainersSegmentExceptionHeaders = { serializedName: "Service_listContainersSegmentExceptionHeaders", type: { name: "Composite", @@ -41761,7 +44538,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetUserDelegationKeyHeaders = { + exports2.ServiceGetUserDelegationKeyHeaders = { serializedName: "Service_getUserDelegationKeyHeaders", type: { name: "Composite", @@ -41805,7 +44582,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetUserDelegationKeyExceptionHeaders = { + exports2.ServiceGetUserDelegationKeyExceptionHeaders = { serializedName: "Service_getUserDelegationKeyExceptionHeaders", type: { name: "Composite", @@ -41821,7 +44598,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoHeaders = { + exports2.ServiceGetAccountInfoHeaders = { serializedName: "Service_getAccountInfoHeaders", type: { name: "Composite", @@ -41900,7 +44677,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoExceptionHeaders = { + exports2.ServiceGetAccountInfoExceptionHeaders = { serializedName: "Service_getAccountInfoExceptionHeaders", type: { name: "Composite", @@ -41916,7 +44693,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchHeaders = { + exports2.ServiceSubmitBatchHeaders = { serializedName: "Service_submitBatchHeaders", type: { name: "Composite", @@ -41960,7 +44737,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchExceptionHeaders = { + exports2.ServiceSubmitBatchExceptionHeaders = { serializedName: "Service_submitBatchExceptionHeaders", type: { name: "Composite", @@ -41976,7 +44753,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsHeaders = { + exports2.ServiceFilterBlobsHeaders = { serializedName: "Service_filterBlobsHeaders", type: { name: "Composite", @@ -42020,7 +44797,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsExceptionHeaders = { + exports2.ServiceFilterBlobsExceptionHeaders = { serializedName: "Service_filterBlobsExceptionHeaders", type: { name: "Composite", @@ -42036,7 +44813,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateHeaders = { + exports2.ContainerCreateHeaders = { serializedName: "Container_createHeaders", type: { name: "Composite", @@ -42094,7 +44871,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateExceptionHeaders = { + exports2.ContainerCreateExceptionHeaders = { serializedName: "Container_createExceptionHeaders", type: { name: "Composite", @@ -42110,7 +44887,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesHeaders = { + exports2.ContainerGetPropertiesHeaders = { serializedName: "Container_getPropertiesHeaders", type: { name: "Composite", @@ -42250,7 +45027,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesExceptionHeaders = { + exports2.ContainerGetPropertiesExceptionHeaders = { serializedName: "Container_getPropertiesExceptionHeaders", type: { name: "Composite", @@ -42266,7 +45043,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteHeaders = { + exports2.ContainerDeleteHeaders = { serializedName: "Container_deleteHeaders", type: { name: "Composite", @@ -42310,7 +45087,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteExceptionHeaders = { + exports2.ContainerDeleteExceptionHeaders = { serializedName: "Container_deleteExceptionHeaders", type: { name: "Composite", @@ -42326,7 +45103,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataHeaders = { + exports2.ContainerSetMetadataHeaders = { serializedName: "Container_setMetadataHeaders", type: { name: "Composite", @@ -42384,7 +45161,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataExceptionHeaders = { + exports2.ContainerSetMetadataExceptionHeaders = { serializedName: "Container_setMetadataExceptionHeaders", type: { name: "Composite", @@ -42400,7 +45177,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyHeaders = { + exports2.ContainerGetAccessPolicyHeaders = { serializedName: "Container_getAccessPolicyHeaders", type: { name: "Composite", @@ -42466,7 +45243,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyExceptionHeaders = { + exports2.ContainerGetAccessPolicyExceptionHeaders = { serializedName: "Container_getAccessPolicyExceptionHeaders", type: { name: "Composite", @@ -42482,7 +45259,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyHeaders = { + exports2.ContainerSetAccessPolicyHeaders = { serializedName: "Container_setAccessPolicyHeaders", type: { name: "Composite", @@ -42540,7 +45317,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyExceptionHeaders = { + exports2.ContainerSetAccessPolicyExceptionHeaders = { serializedName: "Container_setAccessPolicyExceptionHeaders", type: { name: "Composite", @@ -42556,7 +45333,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreHeaders = { + exports2.ContainerRestoreHeaders = { serializedName: "Container_restoreHeaders", type: { name: "Composite", @@ -42600,7 +45377,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreExceptionHeaders = { + exports2.ContainerRestoreExceptionHeaders = { serializedName: "Container_restoreExceptionHeaders", type: { name: "Composite", @@ -42616,7 +45393,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameHeaders = { + exports2.ContainerRenameHeaders = { serializedName: "Container_renameHeaders", type: { name: "Composite", @@ -42660,7 +45437,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameExceptionHeaders = { + exports2.ContainerRenameExceptionHeaders = { serializedName: "Container_renameExceptionHeaders", type: { name: "Composite", @@ -42676,7 +45453,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSubmitBatchHeaders = { + exports2.ContainerSubmitBatchHeaders = { serializedName: "Container_submitBatchHeaders", type: { name: "Composite", @@ -42706,7 +45483,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSubmitBatchExceptionHeaders = { + exports2.ContainerSubmitBatchExceptionHeaders = { serializedName: "Container_submitBatchExceptionHeaders", type: { name: "Composite", @@ -42722,7 +45499,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerFilterBlobsHeaders = { + exports2.ContainerFilterBlobsHeaders = { serializedName: "Container_filterBlobsHeaders", type: { name: "Composite", @@ -42759,7 +45536,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerFilterBlobsExceptionHeaders = { + exports2.ContainerFilterBlobsExceptionHeaders = { serializedName: "Container_filterBlobsExceptionHeaders", type: { name: "Composite", @@ -42775,7 +45552,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseHeaders = { + exports2.ContainerAcquireLeaseHeaders = { serializedName: "Container_acquireLeaseHeaders", type: { name: "Composite", @@ -42833,7 +45610,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseExceptionHeaders = { + exports2.ContainerAcquireLeaseExceptionHeaders = { serializedName: "Container_acquireLeaseExceptionHeaders", type: { name: "Composite", @@ -42849,7 +45626,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseHeaders = { + exports2.ContainerReleaseLeaseHeaders = { serializedName: "Container_releaseLeaseHeaders", type: { name: "Composite", @@ -42900,7 +45677,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseExceptionHeaders = { + exports2.ContainerReleaseLeaseExceptionHeaders = { serializedName: "Container_releaseLeaseExceptionHeaders", type: { name: "Composite", @@ -42916,7 +45693,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenewLeaseHeaders = { + exports2.ContainerRenewLeaseHeaders = { serializedName: "Container_renewLeaseHeaders", type: { name: "Composite", @@ -42974,7 +45751,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenewLeaseExceptionHeaders = { + exports2.ContainerRenewLeaseExceptionHeaders = { serializedName: "Container_renewLeaseExceptionHeaders", type: { name: "Composite", @@ -42990,7 +45767,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseHeaders = { + exports2.ContainerBreakLeaseHeaders = { serializedName: "Container_breakLeaseHeaders", type: { name: "Composite", @@ -43048,7 +45825,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseExceptionHeaders = { + exports2.ContainerBreakLeaseExceptionHeaders = { serializedName: "Container_breakLeaseExceptionHeaders", type: { name: "Composite", @@ -43064,7 +45841,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerChangeLeaseHeaders = { + exports2.ContainerChangeLeaseHeaders = { serializedName: "Container_changeLeaseHeaders", type: { name: "Composite", @@ -43122,7 +45899,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerChangeLeaseExceptionHeaders = { + exports2.ContainerChangeLeaseExceptionHeaders = { serializedName: "Container_changeLeaseExceptionHeaders", type: { name: "Composite", @@ -43138,7 +45915,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobFlatSegmentHeaders = { + exports2.ContainerListBlobFlatSegmentHeaders = { serializedName: "Container_listBlobFlatSegmentHeaders", type: { name: "Composite", @@ -43189,7 +45966,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobFlatSegmentExceptionHeaders = { + exports2.ContainerListBlobFlatSegmentExceptionHeaders = { serializedName: "Container_listBlobFlatSegmentExceptionHeaders", type: { name: "Composite", @@ -43205,7 +45982,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentHeaders = { + exports2.ContainerListBlobHierarchySegmentHeaders = { serializedName: "Container_listBlobHierarchySegmentHeaders", type: { name: "Composite", @@ -43256,7 +46033,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentExceptionHeaders = { + exports2.ContainerListBlobHierarchySegmentExceptionHeaders = { serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", type: { name: "Composite", @@ -43272,7 +46049,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoHeaders = { + exports2.ContainerGetAccountInfoHeaders = { serializedName: "Container_getAccountInfoHeaders", type: { name: "Composite", @@ -43344,7 +46121,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoExceptionHeaders = { + exports2.ContainerGetAccountInfoExceptionHeaders = { serializedName: "Container_getAccountInfoExceptionHeaders", type: { name: "Composite", @@ -43360,7 +46137,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDownloadHeaders = { + exports2.BlobDownloadHeaders = { serializedName: "Blob_downloadHeaders", type: { name: "Composite", @@ -43700,7 +46477,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDownloadExceptionHeaders = { + exports2.BlobDownloadExceptionHeaders = { serializedName: "Blob_downloadExceptionHeaders", type: { name: "Composite", @@ -43716,7 +46493,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetPropertiesHeaders = { + exports2.BlobGetPropertiesHeaders = { serializedName: "Blob_getPropertiesHeaders", type: { name: "Composite", @@ -44092,7 +46869,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetPropertiesExceptionHeaders = { + exports2.BlobGetPropertiesExceptionHeaders = { serializedName: "Blob_getPropertiesExceptionHeaders", type: { name: "Composite", @@ -44108,7 +46885,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteHeaders = { + exports2.BlobDeleteHeaders = { serializedName: "Blob_deleteHeaders", type: { name: "Composite", @@ -44152,7 +46929,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteExceptionHeaders = { + exports2.BlobDeleteExceptionHeaders = { serializedName: "Blob_deleteExceptionHeaders", type: { name: "Composite", @@ -44168,7 +46945,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobUndeleteHeaders = { + exports2.BlobUndeleteHeaders = { serializedName: "Blob_undeleteHeaders", type: { name: "Composite", @@ -44212,7 +46989,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobUndeleteExceptionHeaders = { + exports2.BlobUndeleteExceptionHeaders = { serializedName: "Blob_undeleteExceptionHeaders", type: { name: "Composite", @@ -44228,7 +47005,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetExpiryHeaders = { + exports2.BlobSetExpiryHeaders = { serializedName: "Blob_setExpiryHeaders", type: { name: "Composite", @@ -44279,7 +47056,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetExpiryExceptionHeaders = { + exports2.BlobSetExpiryExceptionHeaders = { serializedName: "Blob_setExpiryExceptionHeaders", type: { name: "Composite", @@ -44295,7 +47072,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetHttpHeadersHeaders = { + exports2.BlobSetHttpHeadersHeaders = { serializedName: "Blob_setHttpHeadersHeaders", type: { name: "Composite", @@ -44360,7 +47137,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetHttpHeadersExceptionHeaders = { + exports2.BlobSetHttpHeadersExceptionHeaders = { serializedName: "Blob_setHttpHeadersExceptionHeaders", type: { name: "Composite", @@ -44376,7 +47153,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetImmutabilityPolicyHeaders = { + exports2.BlobSetImmutabilityPolicyHeaders = { serializedName: "Blob_setImmutabilityPolicyHeaders", type: { name: "Composite", @@ -44428,7 +47205,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetImmutabilityPolicyExceptionHeaders = { + exports2.BlobSetImmutabilityPolicyExceptionHeaders = { serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", type: { name: "Composite", @@ -44444,7 +47221,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteImmutabilityPolicyHeaders = { + exports2.BlobDeleteImmutabilityPolicyHeaders = { serializedName: "Blob_deleteImmutabilityPolicyHeaders", type: { name: "Composite", @@ -44481,7 +47258,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteImmutabilityPolicyExceptionHeaders = { + exports2.BlobDeleteImmutabilityPolicyExceptionHeaders = { serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", type: { name: "Composite", @@ -44497,7 +47274,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetLegalHoldHeaders = { + exports2.BlobSetLegalHoldHeaders = { serializedName: "Blob_setLegalHoldHeaders", type: { name: "Composite", @@ -44541,7 +47318,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetLegalHoldExceptionHeaders = { + exports2.BlobSetLegalHoldExceptionHeaders = { serializedName: "Blob_setLegalHoldExceptionHeaders", type: { name: "Composite", @@ -44557,7 +47334,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetMetadataHeaders = { + exports2.BlobSetMetadataHeaders = { serializedName: "Blob_setMetadataHeaders", type: { name: "Composite", @@ -44643,7 +47420,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetMetadataExceptionHeaders = { + exports2.BlobSetMetadataExceptionHeaders = { serializedName: "Blob_setMetadataExceptionHeaders", type: { name: "Composite", @@ -44659,7 +47436,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobAcquireLeaseHeaders = { + exports2.BlobAcquireLeaseHeaders = { serializedName: "Blob_acquireLeaseHeaders", type: { name: "Composite", @@ -44717,7 +47494,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobAcquireLeaseExceptionHeaders = { + exports2.BlobAcquireLeaseExceptionHeaders = { serializedName: "Blob_acquireLeaseExceptionHeaders", type: { name: "Composite", @@ -44733,7 +47510,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobReleaseLeaseHeaders = { + exports2.BlobReleaseLeaseHeaders = { serializedName: "Blob_releaseLeaseHeaders", type: { name: "Composite", @@ -44784,7 +47561,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobReleaseLeaseExceptionHeaders = { + exports2.BlobReleaseLeaseExceptionHeaders = { serializedName: "Blob_releaseLeaseExceptionHeaders", type: { name: "Composite", @@ -44800,7 +47577,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobRenewLeaseHeaders = { + exports2.BlobRenewLeaseHeaders = { serializedName: "Blob_renewLeaseHeaders", type: { name: "Composite", @@ -44858,7 +47635,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobRenewLeaseExceptionHeaders = { + exports2.BlobRenewLeaseExceptionHeaders = { serializedName: "Blob_renewLeaseExceptionHeaders", type: { name: "Composite", @@ -44874,7 +47651,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobChangeLeaseHeaders = { + exports2.BlobChangeLeaseHeaders = { serializedName: "Blob_changeLeaseHeaders", type: { name: "Composite", @@ -44932,7 +47709,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobChangeLeaseExceptionHeaders = { + exports2.BlobChangeLeaseExceptionHeaders = { serializedName: "Blob_changeLeaseExceptionHeaders", type: { name: "Composite", @@ -44948,7 +47725,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobBreakLeaseHeaders = { + exports2.BlobBreakLeaseHeaders = { serializedName: "Blob_breakLeaseHeaders", type: { name: "Composite", @@ -45006,7 +47783,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobBreakLeaseExceptionHeaders = { + exports2.BlobBreakLeaseExceptionHeaders = { serializedName: "Blob_breakLeaseExceptionHeaders", type: { name: "Composite", @@ -45022,7 +47799,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCreateSnapshotHeaders = { + exports2.BlobCreateSnapshotHeaders = { serializedName: "Blob_createSnapshotHeaders", type: { name: "Composite", @@ -45101,7 +47878,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCreateSnapshotExceptionHeaders = { + exports2.BlobCreateSnapshotExceptionHeaders = { serializedName: "Blob_createSnapshotExceptionHeaders", type: { name: "Composite", @@ -45117,7 +47894,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobStartCopyFromURLHeaders = { + exports2.BlobStartCopyFromURLHeaders = { serializedName: "Blob_startCopyFromURLHeaders", type: { name: "Composite", @@ -45197,7 +47974,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobStartCopyFromURLExceptionHeaders = { + exports2.BlobStartCopyFromURLExceptionHeaders = { serializedName: "Blob_startCopyFromURLExceptionHeaders", type: { name: "Composite", @@ -45209,11 +47986,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "String" } + }, + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", + type: { + name: "String" + } + }, + copySourceStatusCode: { + serializedName: "x-ms-copy-source-status-code", + xmlName: "x-ms-copy-source-status-code", + type: { + name: "Number" + } } } } }; - var BlobCopyFromURLHeaders = { + exports2.BlobCopyFromURLHeaders = { serializedName: "Blob_copyFromURLHeaders", type: { name: "Composite", @@ -45314,7 +48105,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCopyFromURLExceptionHeaders = { + exports2.BlobCopyFromURLExceptionHeaders = { serializedName: "Blob_copyFromURLExceptionHeaders", type: { name: "Composite", @@ -45326,11 +48117,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "String" } + }, + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", + type: { + name: "String" + } + }, + copySourceStatusCode: { + serializedName: "x-ms-copy-source-status-code", + xmlName: "x-ms-copy-source-status-code", + type: { + name: "Number" + } } } } }; - var BlobAbortCopyFromURLHeaders = { + exports2.BlobAbortCopyFromURLHeaders = { serializedName: "Blob_abortCopyFromURLHeaders", type: { name: "Composite", @@ -45374,7 +48179,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobAbortCopyFromURLExceptionHeaders = { + exports2.BlobAbortCopyFromURLExceptionHeaders = { serializedName: "Blob_abortCopyFromURLExceptionHeaders", type: { name: "Composite", @@ -45390,7 +48195,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTierHeaders = { + exports2.BlobSetTierHeaders = { serializedName: "Blob_setTierHeaders", type: { name: "Composite", @@ -45427,7 +48232,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTierExceptionHeaders = { + exports2.BlobSetTierExceptionHeaders = { serializedName: "Blob_setTierExceptionHeaders", type: { name: "Composite", @@ -45443,7 +48248,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetAccountInfoHeaders = { + exports2.BlobGetAccountInfoHeaders = { serializedName: "Blob_getAccountInfoHeaders", type: { name: "Composite", @@ -45515,7 +48320,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetAccountInfoExceptionHeaders = { + exports2.BlobGetAccountInfoExceptionHeaders = { serializedName: "Blob_getAccountInfoExceptionHeaders", type: { name: "Composite", @@ -45531,7 +48336,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobQueryHeaders = { + exports2.BlobQueryHeaders = { serializedName: "Blob_queryHeaders", type: { name: "Composite", @@ -45791,7 +48596,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobQueryExceptionHeaders = { + exports2.BlobQueryExceptionHeaders = { serializedName: "Blob_queryExceptionHeaders", type: { name: "Composite", @@ -45807,7 +48612,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetTagsHeaders = { + exports2.BlobGetTagsHeaders = { serializedName: "Blob_getTagsHeaders", type: { name: "Composite", @@ -45851,7 +48656,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetTagsExceptionHeaders = { + exports2.BlobGetTagsExceptionHeaders = { serializedName: "Blob_getTagsExceptionHeaders", type: { name: "Composite", @@ -45867,7 +48672,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTagsHeaders = { + exports2.BlobSetTagsHeaders = { serializedName: "Blob_setTagsHeaders", type: { name: "Composite", @@ -45911,7 +48716,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTagsExceptionHeaders = { + exports2.BlobSetTagsExceptionHeaders = { serializedName: "Blob_setTagsExceptionHeaders", type: { name: "Composite", @@ -45927,7 +48732,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobCreateHeaders = { + exports2.PageBlobCreateHeaders = { serializedName: "PageBlob_createHeaders", type: { name: "Composite", @@ -46020,7 +48825,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobCreateExceptionHeaders = { + exports2.PageBlobCreateExceptionHeaders = { serializedName: "PageBlob_createExceptionHeaders", type: { name: "Composite", @@ -46036,7 +48841,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobUploadPagesHeaders = { + exports2.PageBlobUploadPagesHeaders = { serializedName: "PageBlob_uploadPagesHeaders", type: { name: "Composite", @@ -46136,7 +48941,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobUploadPagesExceptionHeaders = { + exports2.PageBlobUploadPagesExceptionHeaders = { serializedName: "PageBlob_uploadPagesExceptionHeaders", type: { name: "Composite", @@ -46152,7 +48957,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobClearPagesHeaders = { + exports2.PageBlobClearPagesHeaders = { serializedName: "PageBlob_clearPagesHeaders", type: { name: "Composite", @@ -46231,7 +49036,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobClearPagesExceptionHeaders = { + exports2.PageBlobClearPagesExceptionHeaders = { serializedName: "PageBlob_clearPagesExceptionHeaders", type: { name: "Composite", @@ -46247,7 +49052,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobUploadPagesFromURLHeaders = { + exports2.PageBlobUploadPagesFromURLHeaders = { serializedName: "PageBlob_uploadPagesFromURLHeaders", type: { name: "Composite", @@ -46340,7 +49145,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobUploadPagesFromURLExceptionHeaders = { + exports2.PageBlobUploadPagesFromURLExceptionHeaders = { serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", type: { name: "Composite", @@ -46352,11 +49157,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "String" } + }, + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", + type: { + name: "String" + } + }, + copySourceStatusCode: { + serializedName: "x-ms-copy-source-status-code", + xmlName: "x-ms-copy-source-status-code", + type: { + name: "Number" + } } } } }; - var PageBlobGetPageRangesHeaders = { + exports2.PageBlobGetPageRangesHeaders = { serializedName: "PageBlob_getPageRangesHeaders", type: { name: "Composite", @@ -46421,7 +49240,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobGetPageRangesExceptionHeaders = { + exports2.PageBlobGetPageRangesExceptionHeaders = { serializedName: "PageBlob_getPageRangesExceptionHeaders", type: { name: "Composite", @@ -46437,7 +49256,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobGetPageRangesDiffHeaders = { + exports2.PageBlobGetPageRangesDiffHeaders = { serializedName: "PageBlob_getPageRangesDiffHeaders", type: { name: "Composite", @@ -46502,7 +49321,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobGetPageRangesDiffExceptionHeaders = { + exports2.PageBlobGetPageRangesDiffExceptionHeaders = { serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", type: { name: "Composite", @@ -46518,7 +49337,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobResizeHeaders = { + exports2.PageBlobResizeHeaders = { serializedName: "PageBlob_resizeHeaders", type: { name: "Composite", @@ -46583,7 +49402,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobResizeExceptionHeaders = { + exports2.PageBlobResizeExceptionHeaders = { serializedName: "PageBlob_resizeExceptionHeaders", type: { name: "Composite", @@ -46599,7 +49418,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobUpdateSequenceNumberHeaders = { + exports2.PageBlobUpdateSequenceNumberHeaders = { serializedName: "PageBlob_updateSequenceNumberHeaders", type: { name: "Composite", @@ -46664,7 +49483,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobUpdateSequenceNumberExceptionHeaders = { + exports2.PageBlobUpdateSequenceNumberExceptionHeaders = { serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", type: { name: "Composite", @@ -46680,7 +49499,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobCopyIncrementalHeaders = { + exports2.PageBlobCopyIncrementalHeaders = { serializedName: "PageBlob_copyIncrementalHeaders", type: { name: "Composite", @@ -46753,7 +49572,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobCopyIncrementalExceptionHeaders = { + exports2.PageBlobCopyIncrementalExceptionHeaders = { serializedName: "PageBlob_copyIncrementalExceptionHeaders", type: { name: "Composite", @@ -46769,7 +49588,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var AppendBlobCreateHeaders = { + exports2.AppendBlobCreateHeaders = { serializedName: "AppendBlob_createHeaders", type: { name: "Composite", @@ -46862,7 +49681,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var AppendBlobCreateExceptionHeaders = { + exports2.AppendBlobCreateExceptionHeaders = { serializedName: "AppendBlob_createExceptionHeaders", type: { name: "Composite", @@ -46878,7 +49697,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var AppendBlobAppendBlockHeaders = { + exports2.AppendBlobAppendBlockHeaders = { serializedName: "AppendBlob_appendBlockHeaders", type: { name: "Composite", @@ -46985,7 +49804,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var AppendBlobAppendBlockExceptionHeaders = { + exports2.AppendBlobAppendBlockExceptionHeaders = { serializedName: "AppendBlob_appendBlockExceptionHeaders", type: { name: "Composite", @@ -47001,7 +49820,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var AppendBlobAppendBlockFromUrlHeaders = { + exports2.AppendBlobAppendBlockFromUrlHeaders = { serializedName: "AppendBlob_appendBlockFromUrlHeaders", type: { name: "Composite", @@ -47101,7 +49920,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var AppendBlobAppendBlockFromUrlExceptionHeaders = { + exports2.AppendBlobAppendBlockFromUrlExceptionHeaders = { serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", type: { name: "Composite", @@ -47113,11 +49932,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "String" } + }, + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", + type: { + name: "String" + } + }, + copySourceStatusCode: { + serializedName: "x-ms-copy-source-status-code", + xmlName: "x-ms-copy-source-status-code", + type: { + name: "Number" + } } } } }; - var AppendBlobSealHeaders = { + exports2.AppendBlobSealHeaders = { serializedName: "AppendBlob_sealHeaders", type: { name: "Composite", @@ -47175,7 +50008,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var AppendBlobSealExceptionHeaders = { + exports2.AppendBlobSealExceptionHeaders = { serializedName: "AppendBlob_sealExceptionHeaders", type: { name: "Composite", @@ -47191,7 +50024,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlockBlobUploadHeaders = { + exports2.BlockBlobUploadHeaders = { serializedName: "BlockBlob_uploadHeaders", type: { name: "Composite", @@ -47284,7 +50117,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlockBlobUploadExceptionHeaders = { + exports2.BlockBlobUploadExceptionHeaders = { serializedName: "BlockBlob_uploadExceptionHeaders", type: { name: "Composite", @@ -47300,7 +50133,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlockBlobPutBlobFromUrlHeaders = { + exports2.BlockBlobPutBlobFromUrlHeaders = { serializedName: "BlockBlob_putBlobFromUrlHeaders", type: { name: "Composite", @@ -47393,7 +50226,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlockBlobPutBlobFromUrlExceptionHeaders = { + exports2.BlockBlobPutBlobFromUrlExceptionHeaders = { serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", type: { name: "Composite", @@ -47405,11 +50238,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "String" } + }, + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", + type: { + name: "String" + } + }, + copySourceStatusCode: { + serializedName: "x-ms-copy-source-status-code", + xmlName: "x-ms-copy-source-status-code", + type: { + name: "Number" + } } } } }; - var BlockBlobStageBlockHeaders = { + exports2.BlockBlobStageBlockHeaders = { serializedName: "BlockBlob_stageBlockHeaders", type: { name: "Composite", @@ -47488,7 +50335,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlockBlobStageBlockExceptionHeaders = { + exports2.BlockBlobStageBlockExceptionHeaders = { serializedName: "BlockBlob_stageBlockExceptionHeaders", type: { name: "Composite", @@ -47504,7 +50351,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlockBlobStageBlockFromURLHeaders = { + exports2.BlockBlobStageBlockFromURLHeaders = { serializedName: "BlockBlob_stageBlockFromURLHeaders", type: { name: "Composite", @@ -47583,7 +50430,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlockBlobStageBlockFromURLExceptionHeaders = { + exports2.BlockBlobStageBlockFromURLExceptionHeaders = { serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", type: { name: "Composite", @@ -47595,11 +50442,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "String" } + }, + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", + type: { + name: "String" + } + }, + copySourceStatusCode: { + serializedName: "x-ms-copy-source-status-code", + xmlName: "x-ms-copy-source-status-code", + type: { + name: "Number" + } } } } }; - var BlockBlobCommitBlockListHeaders = { + exports2.BlockBlobCommitBlockListHeaders = { serializedName: "BlockBlob_commitBlockListHeaders", type: { name: "Composite", @@ -47699,7 +50560,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlockBlobCommitBlockListExceptionHeaders = { + exports2.BlockBlobCommitBlockListExceptionHeaders = { serializedName: "BlockBlob_commitBlockListExceptionHeaders", type: { name: "Composite", @@ -47715,7 +50576,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlockBlobGetBlockListHeaders = { + exports2.BlockBlobGetBlockListHeaders = { serializedName: "BlockBlob_getBlockListHeaders", type: { name: "Composite", @@ -47787,7 +50648,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlockBlobGetBlockListExceptionHeaders = { + exports2.BlockBlobGetBlockListExceptionHeaders = { serializedName: "BlockBlob_getBlockListExceptionHeaders", type: { name: "Composite", @@ -47803,189 +50664,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var Mappers = /* @__PURE__ */ Object.freeze({ - __proto__: null, - AccessPolicy, - AppendBlobAppendBlockExceptionHeaders, - AppendBlobAppendBlockFromUrlExceptionHeaders, - AppendBlobAppendBlockFromUrlHeaders, - AppendBlobAppendBlockHeaders, - AppendBlobCreateExceptionHeaders, - AppendBlobCreateHeaders, - AppendBlobSealExceptionHeaders, - AppendBlobSealHeaders, - ArrowConfiguration, - ArrowField, - BlobAbortCopyFromURLExceptionHeaders, - BlobAbortCopyFromURLHeaders, - BlobAcquireLeaseExceptionHeaders, - BlobAcquireLeaseHeaders, - BlobBreakLeaseExceptionHeaders, - BlobBreakLeaseHeaders, - BlobChangeLeaseExceptionHeaders, - BlobChangeLeaseHeaders, - BlobCopyFromURLExceptionHeaders, - BlobCopyFromURLHeaders, - BlobCreateSnapshotExceptionHeaders, - BlobCreateSnapshotHeaders, - BlobDeleteExceptionHeaders, - BlobDeleteHeaders, - BlobDeleteImmutabilityPolicyExceptionHeaders, - BlobDeleteImmutabilityPolicyHeaders, - BlobDownloadExceptionHeaders, - BlobDownloadHeaders, - BlobFlatListSegment, - BlobGetAccountInfoExceptionHeaders, - BlobGetAccountInfoHeaders, - BlobGetPropertiesExceptionHeaders, - BlobGetPropertiesHeaders, - BlobGetTagsExceptionHeaders, - BlobGetTagsHeaders, - BlobHierarchyListSegment, - BlobItemInternal, - BlobName, - BlobPrefix, - BlobPropertiesInternal, - BlobQueryExceptionHeaders, - BlobQueryHeaders, - BlobReleaseLeaseExceptionHeaders, - BlobReleaseLeaseHeaders, - BlobRenewLeaseExceptionHeaders, - BlobRenewLeaseHeaders, - BlobServiceProperties, - BlobServiceStatistics, - BlobSetExpiryExceptionHeaders, - BlobSetExpiryHeaders, - BlobSetHttpHeadersExceptionHeaders, - BlobSetHttpHeadersHeaders, - BlobSetImmutabilityPolicyExceptionHeaders, - BlobSetImmutabilityPolicyHeaders, - BlobSetLegalHoldExceptionHeaders, - BlobSetLegalHoldHeaders, - BlobSetMetadataExceptionHeaders, - BlobSetMetadataHeaders, - BlobSetTagsExceptionHeaders, - BlobSetTagsHeaders, - BlobSetTierExceptionHeaders, - BlobSetTierHeaders, - BlobStartCopyFromURLExceptionHeaders, - BlobStartCopyFromURLHeaders, - BlobTag, - BlobTags, - BlobUndeleteExceptionHeaders, - BlobUndeleteHeaders, - Block, - BlockBlobCommitBlockListExceptionHeaders, - BlockBlobCommitBlockListHeaders, - BlockBlobGetBlockListExceptionHeaders, - BlockBlobGetBlockListHeaders, - BlockBlobPutBlobFromUrlExceptionHeaders, - BlockBlobPutBlobFromUrlHeaders, - BlockBlobStageBlockExceptionHeaders, - BlockBlobStageBlockFromURLExceptionHeaders, - BlockBlobStageBlockFromURLHeaders, - BlockBlobStageBlockHeaders, - BlockBlobUploadExceptionHeaders, - BlockBlobUploadHeaders, - BlockList, - BlockLookupList, - ClearRange, - ContainerAcquireLeaseExceptionHeaders, - ContainerAcquireLeaseHeaders, - ContainerBreakLeaseExceptionHeaders, - ContainerBreakLeaseHeaders, - ContainerChangeLeaseExceptionHeaders, - ContainerChangeLeaseHeaders, - ContainerCreateExceptionHeaders, - ContainerCreateHeaders, - ContainerDeleteExceptionHeaders, - ContainerDeleteHeaders, - ContainerFilterBlobsExceptionHeaders, - ContainerFilterBlobsHeaders, - ContainerGetAccessPolicyExceptionHeaders, - ContainerGetAccessPolicyHeaders, - ContainerGetAccountInfoExceptionHeaders, - ContainerGetAccountInfoHeaders, - ContainerGetPropertiesExceptionHeaders, - ContainerGetPropertiesHeaders, - ContainerItem, - ContainerListBlobFlatSegmentExceptionHeaders, - ContainerListBlobFlatSegmentHeaders, - ContainerListBlobHierarchySegmentExceptionHeaders, - ContainerListBlobHierarchySegmentHeaders, - ContainerProperties, - ContainerReleaseLeaseExceptionHeaders, - ContainerReleaseLeaseHeaders, - ContainerRenameExceptionHeaders, - ContainerRenameHeaders, - ContainerRenewLeaseExceptionHeaders, - ContainerRenewLeaseHeaders, - ContainerRestoreExceptionHeaders, - ContainerRestoreHeaders, - ContainerSetAccessPolicyExceptionHeaders, - ContainerSetAccessPolicyHeaders, - ContainerSetMetadataExceptionHeaders, - ContainerSetMetadataHeaders, - ContainerSubmitBatchExceptionHeaders, - ContainerSubmitBatchHeaders, - CorsRule, - DelimitedTextConfiguration, - FilterBlobItem, - FilterBlobSegment, - GeoReplication, - JsonTextConfiguration, - KeyInfo, - ListBlobsFlatSegmentResponse, - ListBlobsHierarchySegmentResponse, - ListContainersSegmentResponse, - Logging, - Metrics, - PageBlobClearPagesExceptionHeaders, - PageBlobClearPagesHeaders, - PageBlobCopyIncrementalExceptionHeaders, - PageBlobCopyIncrementalHeaders, - PageBlobCreateExceptionHeaders, - PageBlobCreateHeaders, - PageBlobGetPageRangesDiffExceptionHeaders, - PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesExceptionHeaders, - PageBlobGetPageRangesHeaders, - PageBlobResizeExceptionHeaders, - PageBlobResizeHeaders, - PageBlobUpdateSequenceNumberExceptionHeaders, - PageBlobUpdateSequenceNumberHeaders, - PageBlobUploadPagesExceptionHeaders, - PageBlobUploadPagesFromURLExceptionHeaders, - PageBlobUploadPagesFromURLHeaders, - PageBlobUploadPagesHeaders, - PageList, - PageRange, - QueryFormat, - QueryRequest, - QuerySerialization, - RetentionPolicy, - ServiceFilterBlobsExceptionHeaders, - ServiceFilterBlobsHeaders, - ServiceGetAccountInfoExceptionHeaders, - ServiceGetAccountInfoHeaders, - ServiceGetPropertiesExceptionHeaders, - ServiceGetPropertiesHeaders, - ServiceGetStatisticsExceptionHeaders, - ServiceGetStatisticsHeaders, - ServiceGetUserDelegationKeyExceptionHeaders, - ServiceGetUserDelegationKeyHeaders, - ServiceListContainersSegmentExceptionHeaders, - ServiceListContainersSegmentHeaders, - ServiceSetPropertiesExceptionHeaders, - ServiceSetPropertiesHeaders, - ServiceSubmitBatchExceptionHeaders, - ServiceSubmitBatchHeaders, - SignedIdentifier, - StaticWebsite, - StorageError, - UserDelegationKey - }); - var contentType = { + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/models/parameters.js +var require_parameters = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/models/parameters.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.action3 = exports2.action2 = exports2.leaseId1 = exports2.action1 = exports2.proposedLeaseId = exports2.duration = exports2.action = exports2.comp10 = exports2.sourceLeaseId = exports2.sourceContainerName = exports2.comp9 = exports2.deletedContainerVersion = exports2.deletedContainerName = exports2.comp8 = exports2.containerAcl = exports2.comp7 = exports2.comp6 = exports2.ifUnmodifiedSince = exports2.ifModifiedSince = exports2.leaseId = exports2.preventEncryptionScopeOverride = exports2.defaultEncryptionScope = exports2.access = exports2.metadata = exports2.restype2 = exports2.where = exports2.comp5 = exports2.multipartContentType = exports2.contentLength = exports2.comp4 = exports2.body = exports2.restype1 = exports2.comp3 = exports2.keyInfo = exports2.include = exports2.maxPageSize = exports2.marker = exports2.prefix = exports2.comp2 = exports2.comp1 = exports2.accept1 = exports2.requestId = exports2.version = exports2.timeoutInSeconds = exports2.comp = exports2.restype = exports2.url = exports2.accept = exports2.blobServiceProperties = exports2.contentType = void 0; + exports2.fileRequestIntent = exports2.copySourceTags = exports2.copySourceAuthorization = exports2.sourceContentMD5 = exports2.xMsRequiresSync = exports2.legalHold1 = exports2.sealBlob = exports2.blobTagsString = exports2.copySource = exports2.sourceIfTags = exports2.sourceIfNoneMatch = exports2.sourceIfMatch = exports2.sourceIfUnmodifiedSince = exports2.sourceIfModifiedSince = exports2.rehydratePriority = exports2.tier = exports2.comp14 = exports2.encryptionScope = exports2.legalHold = exports2.comp13 = exports2.immutabilityPolicyMode = exports2.immutabilityPolicyExpiry = exports2.comp12 = exports2.blobContentDisposition = exports2.blobContentLanguage = exports2.blobContentEncoding = exports2.blobContentMD5 = exports2.blobContentType = exports2.blobCacheControl = exports2.expiresOn = exports2.expiryOptions = exports2.comp11 = exports2.blobDeleteType = exports2.deleteSnapshots = exports2.ifTags = exports2.ifNoneMatch = exports2.ifMatch = exports2.encryptionAlgorithm = exports2.encryptionKeySha256 = exports2.encryptionKey = exports2.rangeGetContentCRC64 = exports2.rangeGetContentMD5 = exports2.range = exports2.versionId = exports2.snapshot = exports2.delimiter = exports2.include1 = exports2.proposedLeaseId1 = exports2.action4 = exports2.breakPeriod = void 0; + exports2.listType = exports2.comp25 = exports2.blocks = exports2.blockId = exports2.comp24 = exports2.copySourceBlobProperties = exports2.blobType2 = exports2.comp23 = exports2.sourceRange1 = exports2.appendPosition = exports2.maxSize = exports2.comp22 = exports2.blobType1 = exports2.comp21 = exports2.sequenceNumberAction = exports2.prevSnapshotUrl = exports2.prevsnapshot = exports2.comp20 = exports2.range1 = exports2.sourceContentCrc64 = exports2.sourceRange = exports2.sourceUrl = exports2.pageWrite1 = exports2.ifSequenceNumberEqualTo = exports2.ifSequenceNumberLessThan = exports2.ifSequenceNumberLessThanOrEqualTo = exports2.pageWrite = exports2.comp19 = exports2.accept2 = exports2.body1 = exports2.contentType1 = exports2.blobSequenceNumber = exports2.blobContentLength = exports2.blobType = exports2.transactionalContentCrc64 = exports2.transactionalContentMD5 = exports2.tags = exports2.comp18 = exports2.comp17 = exports2.queryRequest = exports2.tier1 = exports2.comp16 = exports2.copyId = exports2.copyActionAbortConstant = exports2.comp15 = void 0; + var mappers_js_1 = require_mappers(); + exports2.contentType = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/xml", @@ -47996,11 +50687,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var blobServiceProperties = { + exports2.blobServiceProperties = { parameterPath: "blobServiceProperties", - mapper: BlobServiceProperties + mapper: mappers_js_1.BlobServiceProperties }; - var accept = { + exports2.accept = { parameterPath: "accept", mapper: { defaultValue: "application/xml", @@ -48011,7 +50702,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var url = { + exports2.url = { parameterPath: "url", mapper: { serializedName: "url", @@ -48023,7 +50714,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }, skipEncoding: true }; - var restype = { + exports2.restype = { parameterPath: "restype", mapper: { defaultValue: "service", @@ -48034,7 +50725,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp = { + exports2.comp = { parameterPath: "comp", mapper: { defaultValue: "properties", @@ -48045,7 +50736,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var timeoutInSeconds = { + exports2.timeoutInSeconds = { parameterPath: ["options", "timeoutInSeconds"], mapper: { constraints: { @@ -48058,10 +50749,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var version2 = { + exports2.version = { parameterPath: "version", mapper: { - defaultValue: "2024-11-04", + defaultValue: "2025-11-05", isConstant: true, serializedName: "x-ms-version", type: { @@ -48069,7 +50760,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var requestId = { + exports2.requestId = { parameterPath: ["options", "requestId"], mapper: { serializedName: "x-ms-client-request-id", @@ -48079,7 +50770,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var accept1 = { + exports2.accept1 = { parameterPath: "accept", mapper: { defaultValue: "application/xml", @@ -48090,7 +50781,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp1 = { + exports2.comp1 = { parameterPath: "comp", mapper: { defaultValue: "stats", @@ -48101,7 +50792,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp2 = { + exports2.comp2 = { parameterPath: "comp", mapper: { defaultValue: "list", @@ -48112,7 +50803,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var prefix = { + exports2.prefix = { parameterPath: ["options", "prefix"], mapper: { serializedName: "prefix", @@ -48122,7 +50813,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var marker = { + exports2.marker = { parameterPath: ["options", "marker"], mapper: { serializedName: "marker", @@ -48132,7 +50823,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var maxPageSize = { + exports2.maxPageSize = { parameterPath: ["options", "maxPageSize"], mapper: { constraints: { @@ -48145,7 +50836,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var include = { + exports2.include = { parameterPath: ["options", "include"], mapper: { serializedName: "include", @@ -48163,11 +50854,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }, collectionFormat: "CSV" }; - var keyInfo = { + exports2.keyInfo = { parameterPath: "keyInfo", - mapper: KeyInfo + mapper: mappers_js_1.KeyInfo }; - var comp3 = { + exports2.comp3 = { parameterPath: "comp", mapper: { defaultValue: "userdelegationkey", @@ -48178,7 +50869,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var restype1 = { + exports2.restype1 = { parameterPath: "restype", mapper: { defaultValue: "account", @@ -48189,7 +50880,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var body = { + exports2.body = { parameterPath: "body", mapper: { serializedName: "body", @@ -48200,7 +50891,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp4 = { + exports2.comp4 = { parameterPath: "comp", mapper: { defaultValue: "batch", @@ -48211,7 +50902,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var contentLength = { + exports2.contentLength = { parameterPath: "contentLength", mapper: { serializedName: "Content-Length", @@ -48222,7 +50913,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var multipartContentType = { + exports2.multipartContentType = { parameterPath: "multipartContentType", mapper: { serializedName: "Content-Type", @@ -48233,7 +50924,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp5 = { + exports2.comp5 = { parameterPath: "comp", mapper: { defaultValue: "blobs", @@ -48244,7 +50935,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var where = { + exports2.where = { parameterPath: ["options", "where"], mapper: { serializedName: "where", @@ -48254,7 +50945,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var restype2 = { + exports2.restype2 = { parameterPath: "restype", mapper: { defaultValue: "container", @@ -48265,7 +50956,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var metadata = { + exports2.metadata = { parameterPath: ["options", "metadata"], mapper: { serializedName: "x-ms-meta", @@ -48277,7 +50968,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var access = { + exports2.access = { parameterPath: ["options", "access"], mapper: { serializedName: "x-ms-blob-public-access", @@ -48288,7 +50979,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var defaultEncryptionScope = { + exports2.defaultEncryptionScope = { parameterPath: [ "options", "containerEncryptionScope", @@ -48302,7 +50993,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var preventEncryptionScopeOverride = { + exports2.preventEncryptionScopeOverride = { parameterPath: [ "options", "containerEncryptionScope", @@ -48316,7 +51007,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var leaseId = { + exports2.leaseId = { parameterPath: ["options", "leaseAccessConditions", "leaseId"], mapper: { serializedName: "x-ms-lease-id", @@ -48326,7 +51017,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ifModifiedSince = { + exports2.ifModifiedSince = { parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], mapper: { serializedName: "If-Modified-Since", @@ -48336,7 +51027,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ifUnmodifiedSince = { + exports2.ifUnmodifiedSince = { parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], mapper: { serializedName: "If-Unmodified-Since", @@ -48346,7 +51037,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp6 = { + exports2.comp6 = { parameterPath: "comp", mapper: { defaultValue: "metadata", @@ -48357,7 +51048,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp7 = { + exports2.comp7 = { parameterPath: "comp", mapper: { defaultValue: "acl", @@ -48368,7 +51059,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var containerAcl = { + exports2.containerAcl = { parameterPath: ["options", "containerAcl"], mapper: { serializedName: "containerAcl", @@ -48386,7 +51077,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp8 = { + exports2.comp8 = { parameterPath: "comp", mapper: { defaultValue: "undelete", @@ -48397,7 +51088,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var deletedContainerName = { + exports2.deletedContainerName = { parameterPath: ["options", "deletedContainerName"], mapper: { serializedName: "x-ms-deleted-container-name", @@ -48407,7 +51098,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var deletedContainerVersion = { + exports2.deletedContainerVersion = { parameterPath: ["options", "deletedContainerVersion"], mapper: { serializedName: "x-ms-deleted-container-version", @@ -48417,7 +51108,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp9 = { + exports2.comp9 = { parameterPath: "comp", mapper: { defaultValue: "rename", @@ -48428,7 +51119,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var sourceContainerName = { + exports2.sourceContainerName = { parameterPath: "sourceContainerName", mapper: { serializedName: "x-ms-source-container-name", @@ -48439,7 +51130,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var sourceLeaseId = { + exports2.sourceLeaseId = { parameterPath: ["options", "sourceLeaseId"], mapper: { serializedName: "x-ms-source-lease-id", @@ -48449,7 +51140,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp10 = { + exports2.comp10 = { parameterPath: "comp", mapper: { defaultValue: "lease", @@ -48460,7 +51151,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var action = { + exports2.action = { parameterPath: "action", mapper: { defaultValue: "acquire", @@ -48471,7 +51162,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var duration = { + exports2.duration = { parameterPath: ["options", "duration"], mapper: { serializedName: "x-ms-lease-duration", @@ -48481,7 +51172,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var proposedLeaseId = { + exports2.proposedLeaseId = { parameterPath: ["options", "proposedLeaseId"], mapper: { serializedName: "x-ms-proposed-lease-id", @@ -48491,7 +51182,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var action1 = { + exports2.action1 = { parameterPath: "action", mapper: { defaultValue: "release", @@ -48502,7 +51193,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var leaseId1 = { + exports2.leaseId1 = { parameterPath: "leaseId", mapper: { serializedName: "x-ms-lease-id", @@ -48513,7 +51204,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var action2 = { + exports2.action2 = { parameterPath: "action", mapper: { defaultValue: "renew", @@ -48524,7 +51215,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var action3 = { + exports2.action3 = { parameterPath: "action", mapper: { defaultValue: "break", @@ -48535,7 +51226,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var breakPeriod = { + exports2.breakPeriod = { parameterPath: ["options", "breakPeriod"], mapper: { serializedName: "x-ms-lease-break-period", @@ -48545,7 +51236,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var action4 = { + exports2.action4 = { parameterPath: "action", mapper: { defaultValue: "change", @@ -48556,7 +51247,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var proposedLeaseId1 = { + exports2.proposedLeaseId1 = { parameterPath: "proposedLeaseId", mapper: { serializedName: "x-ms-proposed-lease-id", @@ -48567,7 +51258,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var include1 = { + exports2.include1 = { parameterPath: ["options", "include"], mapper: { serializedName: "include", @@ -48596,7 +51287,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }, collectionFormat: "CSV" }; - var delimiter = { + exports2.delimiter = { parameterPath: "delimiter", mapper: { serializedName: "delimiter", @@ -48607,7 +51298,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var snapshot = { + exports2.snapshot = { parameterPath: ["options", "snapshot"], mapper: { serializedName: "snapshot", @@ -48617,7 +51308,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var versionId = { + exports2.versionId = { parameterPath: ["options", "versionId"], mapper: { serializedName: "versionid", @@ -48627,7 +51318,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var range = { + exports2.range = { parameterPath: ["options", "range"], mapper: { serializedName: "x-ms-range", @@ -48637,7 +51328,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var rangeGetContentMD5 = { + exports2.rangeGetContentMD5 = { parameterPath: ["options", "rangeGetContentMD5"], mapper: { serializedName: "x-ms-range-get-content-md5", @@ -48647,7 +51338,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var rangeGetContentCRC64 = { + exports2.rangeGetContentCRC64 = { parameterPath: ["options", "rangeGetContentCRC64"], mapper: { serializedName: "x-ms-range-get-content-crc64", @@ -48657,7 +51348,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var encryptionKey = { + exports2.encryptionKey = { parameterPath: ["options", "cpkInfo", "encryptionKey"], mapper: { serializedName: "x-ms-encryption-key", @@ -48667,7 +51358,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var encryptionKeySha256 = { + exports2.encryptionKeySha256 = { parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], mapper: { serializedName: "x-ms-encryption-key-sha256", @@ -48677,7 +51368,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var encryptionAlgorithm = { + exports2.encryptionAlgorithm = { parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], mapper: { serializedName: "x-ms-encryption-algorithm", @@ -48687,7 +51378,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ifMatch = { + exports2.ifMatch = { parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], mapper: { serializedName: "If-Match", @@ -48697,7 +51388,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ifNoneMatch = { + exports2.ifNoneMatch = { parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], mapper: { serializedName: "If-None-Match", @@ -48707,7 +51398,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ifTags = { + exports2.ifTags = { parameterPath: ["options", "modifiedAccessConditions", "ifTags"], mapper: { serializedName: "x-ms-if-tags", @@ -48717,7 +51408,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var deleteSnapshots = { + exports2.deleteSnapshots = { parameterPath: ["options", "deleteSnapshots"], mapper: { serializedName: "x-ms-delete-snapshots", @@ -48728,7 +51419,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var blobDeleteType = { + exports2.blobDeleteType = { parameterPath: ["options", "blobDeleteType"], mapper: { serializedName: "deletetype", @@ -48738,7 +51429,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp11 = { + exports2.comp11 = { parameterPath: "comp", mapper: { defaultValue: "expiry", @@ -48749,7 +51440,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var expiryOptions = { + exports2.expiryOptions = { parameterPath: "expiryOptions", mapper: { serializedName: "x-ms-expiry-option", @@ -48760,7 +51451,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var expiresOn = { + exports2.expiresOn = { parameterPath: ["options", "expiresOn"], mapper: { serializedName: "x-ms-expiry-time", @@ -48770,7 +51461,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var blobCacheControl = { + exports2.blobCacheControl = { parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], mapper: { serializedName: "x-ms-blob-cache-control", @@ -48780,7 +51471,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var blobContentType = { + exports2.blobContentType = { parameterPath: ["options", "blobHttpHeaders", "blobContentType"], mapper: { serializedName: "x-ms-blob-content-type", @@ -48790,7 +51481,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var blobContentMD5 = { + exports2.blobContentMD5 = { parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], mapper: { serializedName: "x-ms-blob-content-md5", @@ -48800,7 +51491,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var blobContentEncoding = { + exports2.blobContentEncoding = { parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], mapper: { serializedName: "x-ms-blob-content-encoding", @@ -48810,7 +51501,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var blobContentLanguage = { + exports2.blobContentLanguage = { parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], mapper: { serializedName: "x-ms-blob-content-language", @@ -48820,7 +51511,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var blobContentDisposition = { + exports2.blobContentDisposition = { parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], mapper: { serializedName: "x-ms-blob-content-disposition", @@ -48830,7 +51521,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp12 = { + exports2.comp12 = { parameterPath: "comp", mapper: { defaultValue: "immutabilityPolicies", @@ -48841,7 +51532,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var immutabilityPolicyExpiry = { + exports2.immutabilityPolicyExpiry = { parameterPath: ["options", "immutabilityPolicyExpiry"], mapper: { serializedName: "x-ms-immutability-policy-until-date", @@ -48851,7 +51542,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var immutabilityPolicyMode = { + exports2.immutabilityPolicyMode = { parameterPath: ["options", "immutabilityPolicyMode"], mapper: { serializedName: "x-ms-immutability-policy-mode", @@ -48862,7 +51553,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp13 = { + exports2.comp13 = { parameterPath: "comp", mapper: { defaultValue: "legalhold", @@ -48873,7 +51564,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var legalHold = { + exports2.legalHold = { parameterPath: "legalHold", mapper: { serializedName: "x-ms-legal-hold", @@ -48884,7 +51575,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var encryptionScope = { + exports2.encryptionScope = { parameterPath: ["options", "encryptionScope"], mapper: { serializedName: "x-ms-encryption-scope", @@ -48894,7 +51585,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp14 = { + exports2.comp14 = { parameterPath: "comp", mapper: { defaultValue: "snapshot", @@ -48905,7 +51596,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var tier = { + exports2.tier = { parameterPath: ["options", "tier"], mapper: { serializedName: "x-ms-access-tier", @@ -48932,7 +51623,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var rehydratePriority = { + exports2.rehydratePriority = { parameterPath: ["options", "rehydratePriority"], mapper: { serializedName: "x-ms-rehydrate-priority", @@ -48943,7 +51634,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var sourceIfModifiedSince = { + exports2.sourceIfModifiedSince = { parameterPath: [ "options", "sourceModifiedAccessConditions", @@ -48957,7 +51648,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var sourceIfUnmodifiedSince = { + exports2.sourceIfUnmodifiedSince = { parameterPath: [ "options", "sourceModifiedAccessConditions", @@ -48971,7 +51662,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var sourceIfMatch = { + exports2.sourceIfMatch = { parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], mapper: { serializedName: "x-ms-source-if-match", @@ -48981,7 +51672,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var sourceIfNoneMatch = { + exports2.sourceIfNoneMatch = { parameterPath: [ "options", "sourceModifiedAccessConditions", @@ -48995,7 +51686,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var sourceIfTags = { + exports2.sourceIfTags = { parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], mapper: { serializedName: "x-ms-source-if-tags", @@ -49005,7 +51696,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var copySource = { + exports2.copySource = { parameterPath: "copySource", mapper: { serializedName: "x-ms-copy-source", @@ -49016,7 +51707,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var blobTagsString = { + exports2.blobTagsString = { parameterPath: ["options", "blobTagsString"], mapper: { serializedName: "x-ms-tags", @@ -49026,7 +51717,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var sealBlob = { + exports2.sealBlob = { parameterPath: ["options", "sealBlob"], mapper: { serializedName: "x-ms-seal-blob", @@ -49036,7 +51727,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var legalHold1 = { + exports2.legalHold1 = { parameterPath: ["options", "legalHold"], mapper: { serializedName: "x-ms-legal-hold", @@ -49046,7 +51737,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var xMsRequiresSync = { + exports2.xMsRequiresSync = { parameterPath: "xMsRequiresSync", mapper: { defaultValue: "true", @@ -49057,7 +51748,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var sourceContentMD5 = { + exports2.sourceContentMD5 = { parameterPath: ["options", "sourceContentMD5"], mapper: { serializedName: "x-ms-source-content-md5", @@ -49067,7 +51758,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var copySourceAuthorization = { + exports2.copySourceAuthorization = { parameterPath: ["options", "copySourceAuthorization"], mapper: { serializedName: "x-ms-copy-source-authorization", @@ -49077,7 +51768,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var copySourceTags = { + exports2.copySourceTags = { parameterPath: ["options", "copySourceTags"], mapper: { serializedName: "x-ms-copy-source-tag-option", @@ -49088,7 +51779,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp15 = { + exports2.fileRequestIntent = { + parameterPath: ["options", "fileRequestIntent"], + mapper: { + serializedName: "x-ms-file-request-intent", + xmlName: "x-ms-file-request-intent", + type: { + name: "String" + } + } + }; + exports2.comp15 = { parameterPath: "comp", mapper: { defaultValue: "copy", @@ -49099,7 +51800,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var copyActionAbortConstant = { + exports2.copyActionAbortConstant = { parameterPath: "copyActionAbortConstant", mapper: { defaultValue: "abort", @@ -49110,7 +51811,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var copyId = { + exports2.copyId = { parameterPath: "copyId", mapper: { serializedName: "copyid", @@ -49121,7 +51822,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp16 = { + exports2.comp16 = { parameterPath: "comp", mapper: { defaultValue: "tier", @@ -49132,7 +51833,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var tier1 = { + exports2.tier1 = { parameterPath: "tier", mapper: { serializedName: "x-ms-access-tier", @@ -49160,11 +51861,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var queryRequest = { + exports2.queryRequest = { parameterPath: ["options", "queryRequest"], - mapper: QueryRequest + mapper: mappers_js_1.QueryRequest }; - var comp17 = { + exports2.comp17 = { parameterPath: "comp", mapper: { defaultValue: "query", @@ -49175,7 +51876,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp18 = { + exports2.comp18 = { parameterPath: "comp", mapper: { defaultValue: "tags", @@ -49186,11 +51887,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var tags = { + exports2.tags = { parameterPath: ["options", "tags"], - mapper: BlobTags + mapper: mappers_js_1.BlobTags }; - var transactionalContentMD5 = { + exports2.transactionalContentMD5 = { parameterPath: ["options", "transactionalContentMD5"], mapper: { serializedName: "Content-MD5", @@ -49200,7 +51901,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var transactionalContentCrc64 = { + exports2.transactionalContentCrc64 = { parameterPath: ["options", "transactionalContentCrc64"], mapper: { serializedName: "x-ms-content-crc64", @@ -49210,7 +51911,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var blobType = { + exports2.blobType = { parameterPath: "blobType", mapper: { defaultValue: "PageBlob", @@ -49221,7 +51922,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var blobContentLength = { + exports2.blobContentLength = { parameterPath: "blobContentLength", mapper: { serializedName: "x-ms-blob-content-length", @@ -49232,7 +51933,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var blobSequenceNumber = { + exports2.blobSequenceNumber = { parameterPath: ["options", "blobSequenceNumber"], mapper: { defaultValue: 0, @@ -49243,7 +51944,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var contentType1 = { + exports2.contentType1 = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/octet-stream", @@ -49254,7 +51955,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var body1 = { + exports2.body1 = { parameterPath: "body", mapper: { serializedName: "body", @@ -49265,7 +51966,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var accept2 = { + exports2.accept2 = { parameterPath: "accept", mapper: { defaultValue: "application/xml", @@ -49276,7 +51977,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp19 = { + exports2.comp19 = { parameterPath: "comp", mapper: { defaultValue: "page", @@ -49287,7 +51988,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var pageWrite = { + exports2.pageWrite = { parameterPath: "pageWrite", mapper: { defaultValue: "update", @@ -49298,7 +51999,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ifSequenceNumberLessThanOrEqualTo = { + exports2.ifSequenceNumberLessThanOrEqualTo = { parameterPath: [ "options", "sequenceNumberAccessConditions", @@ -49312,7 +52013,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ifSequenceNumberLessThan = { + exports2.ifSequenceNumberLessThan = { parameterPath: [ "options", "sequenceNumberAccessConditions", @@ -49326,7 +52027,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ifSequenceNumberEqualTo = { + exports2.ifSequenceNumberEqualTo = { parameterPath: [ "options", "sequenceNumberAccessConditions", @@ -49340,7 +52041,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var pageWrite1 = { + exports2.pageWrite1 = { parameterPath: "pageWrite", mapper: { defaultValue: "clear", @@ -49351,7 +52052,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var sourceUrl = { + exports2.sourceUrl = { parameterPath: "sourceUrl", mapper: { serializedName: "x-ms-copy-source", @@ -49362,7 +52063,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var sourceRange = { + exports2.sourceRange = { parameterPath: "sourceRange", mapper: { serializedName: "x-ms-source-range", @@ -49373,7 +52074,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var sourceContentCrc64 = { + exports2.sourceContentCrc64 = { parameterPath: ["options", "sourceContentCrc64"], mapper: { serializedName: "x-ms-source-content-crc64", @@ -49383,7 +52084,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var range1 = { + exports2.range1 = { parameterPath: "range", mapper: { serializedName: "x-ms-range", @@ -49394,7 +52095,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp20 = { + exports2.comp20 = { parameterPath: "comp", mapper: { defaultValue: "pagelist", @@ -49405,7 +52106,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var prevsnapshot = { + exports2.prevsnapshot = { parameterPath: ["options", "prevsnapshot"], mapper: { serializedName: "prevsnapshot", @@ -49415,7 +52116,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var prevSnapshotUrl = { + exports2.prevSnapshotUrl = { parameterPath: ["options", "prevSnapshotUrl"], mapper: { serializedName: "x-ms-previous-snapshot-url", @@ -49425,7 +52126,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var sequenceNumberAction = { + exports2.sequenceNumberAction = { parameterPath: "sequenceNumberAction", mapper: { serializedName: "x-ms-sequence-number-action", @@ -49437,7 +52138,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp21 = { + exports2.comp21 = { parameterPath: "comp", mapper: { defaultValue: "incrementalcopy", @@ -49448,7 +52149,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var blobType1 = { + exports2.blobType1 = { parameterPath: "blobType", mapper: { defaultValue: "AppendBlob", @@ -49459,7 +52160,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp22 = { + exports2.comp22 = { parameterPath: "comp", mapper: { defaultValue: "appendblock", @@ -49470,7 +52171,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var maxSize = { + exports2.maxSize = { parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], mapper: { serializedName: "x-ms-blob-condition-maxsize", @@ -49480,7 +52181,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var appendPosition = { + exports2.appendPosition = { parameterPath: [ "options", "appendPositionAccessConditions", @@ -49494,7 +52195,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var sourceRange1 = { + exports2.sourceRange1 = { parameterPath: ["options", "sourceRange"], mapper: { serializedName: "x-ms-source-range", @@ -49504,7 +52205,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp23 = { + exports2.comp23 = { parameterPath: "comp", mapper: { defaultValue: "seal", @@ -49515,7 +52216,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var blobType2 = { + exports2.blobType2 = { parameterPath: "blobType", mapper: { defaultValue: "BlockBlob", @@ -49526,7 +52227,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var copySourceBlobProperties = { + exports2.copySourceBlobProperties = { parameterPath: ["options", "copySourceBlobProperties"], mapper: { serializedName: "x-ms-copy-source-blob-properties", @@ -49536,7 +52237,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp24 = { + exports2.comp24 = { parameterPath: "comp", mapper: { defaultValue: "block", @@ -49547,7 +52248,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var blockId = { + exports2.blockId = { parameterPath: "blockId", mapper: { serializedName: "blockid", @@ -49558,11 +52259,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var blocks = { + exports2.blocks = { parameterPath: "blocks", - mapper: BlockLookupList + mapper: mappers_js_1.BlockLookupList }; - var comp25 = { + exports2.comp25 = { parameterPath: "comp", mapper: { defaultValue: "blocklist", @@ -49573,7 +52274,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var listType = { + exports2.listType = { parameterPath: "listType", mapper: { defaultValue: "committed", @@ -49586,10 +52287,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/service.js +var require_service = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/service.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ServiceImpl = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var coreClient = tslib_1.__importStar(require_commonjs8()); + var Mappers = tslib_1.__importStar(require_mappers()); + var Parameters = tslib_1.__importStar(require_parameters()); var ServiceImpl = class { static { __name(this, "ServiceImpl"); } + client; /** * Initialize a new instance of the class Service class. * @param client Reference to the service client @@ -49603,8 +52318,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobServiceProperties The StorageService properties. * @param options The options parameters. */ - setProperties(blobServiceProperties2, options) { - return this.client.sendOperationRequest({ blobServiceProperties: blobServiceProperties2, options }, setPropertiesOperationSpec); + setProperties(blobServiceProperties, options) { + return this.client.sendOperationRequest({ blobServiceProperties, options }, setPropertiesOperationSpec); } /** * gets the properties of a storage account's Blob service, including properties for Storage Analytics @@ -49612,7 +52327,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options The options parameters. */ getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$2); + return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec); } /** * Retrieves statistics related to replication for the Blob service. It is only available on the @@ -49636,15 +52351,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param keyInfo Key information * @param options The options parameters. */ - getUserDelegationKey(keyInfo2, options) { - return this.client.sendOperationRequest({ keyInfo: keyInfo2, options }, getUserDelegationKeyOperationSpec); + getUserDelegationKey(keyInfo, options) { + return this.client.sendOperationRequest({ keyInfo, options }, getUserDelegationKeyOperationSpec); } /** * Returns the sku name and account kind * @param options The options parameters. */ getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$2); + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. @@ -49654,8 +52369,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param body Initial data * @param options The options parameters. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec$1); + submitBatch(contentLength, multipartContentType, body, options) { + return this.client.sendOperationRequest({ contentLength, multipartContentType, body, options }, submitBatchOperationSpec); } /** * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a @@ -49664,10 +52379,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options The options parameters. */ filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec$1); + return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec); } }; - var xmlSerializer$5 = coreClient__namespace.createSerializer( + exports2.ServiceImpl = ServiceImpl; + var xmlSerializer = coreClient.createSerializer( Mappers, /* isXml */ true @@ -49677,173 +52393,173 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; httpMethod: "PUT", responses: { 202: { - headersMapper: ServiceSetPropertiesHeaders + headersMapper: Mappers.ServiceSetPropertiesHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ServiceSetPropertiesExceptionHeaders } }, - requestBody: blobServiceProperties, + requestBody: Parameters.blobServiceProperties, queryParameters: [ - restype, - comp, - timeoutInSeconds + Parameters.restype, + Parameters.comp, + Parameters.timeoutInSeconds ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - contentType, - accept, - version2, - requestId + Parameters.contentType, + Parameters.accept, + Parameters.version, + Parameters.requestId ], isXML: true, contentType: "application/xml; charset=utf-8", mediaType: "xml", - serializer: xmlSerializer$5 + serializer: xmlSerializer }; - var getPropertiesOperationSpec$2 = { + var getPropertiesOperationSpec = { path: "/", httpMethod: "GET", responses: { 200: { - bodyMapper: BlobServiceProperties, - headersMapper: ServiceGetPropertiesHeaders + bodyMapper: Mappers.BlobServiceProperties, + headersMapper: Mappers.ServiceGetPropertiesHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ServiceGetPropertiesExceptionHeaders } }, queryParameters: [ - restype, - comp, - timeoutInSeconds + Parameters.restype, + Parameters.comp, + Parameters.timeoutInSeconds ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1 ], isXML: true, - serializer: xmlSerializer$5 + serializer: xmlSerializer }; var getStatisticsOperationSpec = { path: "/", httpMethod: "GET", responses: { 200: { - bodyMapper: BlobServiceStatistics, - headersMapper: ServiceGetStatisticsHeaders + bodyMapper: Mappers.BlobServiceStatistics, + headersMapper: Mappers.ServiceGetStatisticsHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ServiceGetStatisticsExceptionHeaders } }, queryParameters: [ - restype, - timeoutInSeconds, - comp1 + Parameters.restype, + Parameters.timeoutInSeconds, + Parameters.comp1 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1 ], isXML: true, - serializer: xmlSerializer$5 + serializer: xmlSerializer }; var listContainersSegmentOperationSpec = { path: "/", httpMethod: "GET", responses: { 200: { - bodyMapper: ListContainersSegmentResponse, - headersMapper: ServiceListContainersSegmentHeaders + bodyMapper: Mappers.ListContainersSegmentResponse, + headersMapper: Mappers.ServiceListContainersSegmentHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ServiceListContainersSegmentExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - include + Parameters.timeoutInSeconds, + Parameters.comp2, + Parameters.prefix, + Parameters.marker, + Parameters.maxPageSize, + Parameters.include ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1 ], isXML: true, - serializer: xmlSerializer$5 + serializer: xmlSerializer }; var getUserDelegationKeyOperationSpec = { path: "/", httpMethod: "POST", responses: { 200: { - bodyMapper: UserDelegationKey, - headersMapper: ServiceGetUserDelegationKeyHeaders + bodyMapper: Mappers.UserDelegationKey, + headersMapper: Mappers.ServiceGetUserDelegationKeyHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ServiceGetUserDelegationKeyExceptionHeaders } }, - requestBody: keyInfo, + requestBody: Parameters.keyInfo, queryParameters: [ - restype, - timeoutInSeconds, - comp3 + Parameters.restype, + Parameters.timeoutInSeconds, + Parameters.comp3 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - contentType, - accept, - version2, - requestId + Parameters.contentType, + Parameters.accept, + Parameters.version, + Parameters.requestId ], isXML: true, contentType: "application/xml; charset=utf-8", mediaType: "xml", - serializer: xmlSerializer$5 + serializer: xmlSerializer }; - var getAccountInfoOperationSpec$2 = { + var getAccountInfoOperationSpec = { path: "/", httpMethod: "GET", responses: { 200: { - headersMapper: ServiceGetAccountInfoHeaders + headersMapper: Mappers.ServiceGetAccountInfoHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ServiceGetAccountInfoExceptionHeaders } }, queryParameters: [ - comp, - timeoutInSeconds, - restype1 + Parameters.comp, + Parameters.timeoutInSeconds, + Parameters.restype1 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1 ], isXML: true, - serializer: xmlSerializer$5 + serializer: xmlSerializer }; - var submitBatchOperationSpec$1 = { + var submitBatchOperationSpec = { path: "/", httpMethod: "POST", responses: { @@ -49852,61 +52568,75 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "Stream" }, serializedName: "parsedResponse" }, - headersMapper: ServiceSubmitBatchHeaders + headersMapper: Mappers.ServiceSubmitBatchHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ServiceSubmitBatchExceptionHeaders } }, - requestBody: body, - queryParameters: [timeoutInSeconds, comp4], - urlParameters: [url], + requestBody: Parameters.body, + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp4], + urlParameters: [Parameters.url], headerParameters: [ - accept, - version2, - requestId, - contentLength, - multipartContentType + Parameters.accept, + Parameters.version, + Parameters.requestId, + Parameters.contentLength, + Parameters.multipartContentType ], isXML: true, contentType: "application/xml; charset=utf-8", mediaType: "xml", - serializer: xmlSerializer$5 + serializer: xmlSerializer }; - var filterBlobsOperationSpec$1 = { + var filterBlobsOperationSpec = { path: "/", httpMethod: "GET", responses: { 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ServiceFilterBlobsHeaders + bodyMapper: Mappers.FilterBlobSegment, + headersMapper: Mappers.ServiceFilterBlobsHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ServiceFilterBlobsExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where + Parameters.timeoutInSeconds, + Parameters.marker, + Parameters.maxPageSize, + Parameters.comp5, + Parameters.where ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1 ], isXML: true, - serializer: xmlSerializer$5 + serializer: xmlSerializer }; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/container.js +var require_container = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/container.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ContainerImpl = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var coreClient = tslib_1.__importStar(require_commonjs8()); + var Mappers = tslib_1.__importStar(require_mappers()); + var Parameters = tslib_1.__importStar(require_parameters()); var ContainerImpl = class { static { __name(this, "ContainerImpl"); } + client; /** * Initialize a new instance of the class Container class. * @param client Reference to the service client @@ -49920,7 +52650,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options The options parameters. */ create(options) { - return this.client.sendOperationRequest({ options }, createOperationSpec$2); + return this.client.sendOperationRequest({ options }, createOperationSpec); } /** * returns all user-defined metadata and system properties for the specified container. The data @@ -49928,7 +52658,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options The options parameters. */ getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$1); + return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec); } /** * operation marks the specified container for deletion. The container and any blobs contained within @@ -49936,14 +52666,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options The options parameters. */ delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec$1); + return this.client.sendOperationRequest({ options }, deleteOperationSpec); } /** * operation sets one or more user-defined name-value pairs for the specified container. * @param options The options parameters. */ setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec$1); + return this.client.sendOperationRequest({ options }, setMetadataOperationSpec); } /** * gets the permissions for the specified container. The permissions indicate whether container data @@ -49973,8 +52703,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param sourceContainerName Required. Specifies the name of the container to rename. * @param options The options parameters. */ - rename(sourceContainerName2, options) { - return this.client.sendOperationRequest({ sourceContainerName: sourceContainerName2, options }, renameOperationSpec); + rename(sourceContainerName, options) { + return this.client.sendOperationRequest({ sourceContainerName, options }, renameOperationSpec); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. @@ -49984,8 +52714,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param body Initial data * @param options The options parameters. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec); + submitBatch(contentLength, multipartContentType, body, options) { + return this.client.sendOperationRequest({ contentLength, multipartContentType, body, options }, submitBatchOperationSpec); } /** * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given @@ -50001,7 +52731,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options The options parameters. */ acquireLease(options) { - return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec$1); + return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can @@ -50009,8 +52739,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param leaseId Specifies the current lease ID on the resource. * @param options The options parameters. */ - releaseLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec$1); + releaseLease(leaseId, options) { + return this.client.sendOperationRequest({ leaseId, options }, releaseLeaseOperationSpec); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can @@ -50018,8 +52748,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param leaseId Specifies the current lease ID on the resource. * @param options The options parameters. */ - renewLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec$1); + renewLease(leaseId, options) { + return this.client.sendOperationRequest({ leaseId, options }, renewLeaseOperationSpec); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can @@ -50027,7 +52757,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options The options parameters. */ breakLease(options) { - return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec$1); + return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can @@ -50038,8 +52768,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * (String) for a list of valid GUID string formats. * @param options The options parameters. */ - changeLease(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec$1); + changeLease(leaseId, proposedLeaseId, options) { + return this.client.sendOperationRequest({ leaseId, proposedLeaseId, options }, changeLeaseOperationSpec); } /** * [Update] The List Blobs operation returns a list of the blobs under the specified container @@ -50056,124 +52786,125 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * character or a string. * @param options The options parameters. */ - listBlobHierarchySegment(delimiter2, options) { - return this.client.sendOperationRequest({ delimiter: delimiter2, options }, listBlobHierarchySegmentOperationSpec); + listBlobHierarchySegment(delimiter, options) { + return this.client.sendOperationRequest({ delimiter, options }, listBlobHierarchySegmentOperationSpec); } /** * Returns the sku name and account kind * @param options The options parameters. */ getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$1); + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } }; - var xmlSerializer$4 = coreClient__namespace.createSerializer( + exports2.ContainerImpl = ContainerImpl; + var xmlSerializer = coreClient.createSerializer( Mappers, /* isXml */ true ); - var createOperationSpec$2 = { + var createOperationSpec = { path: "/{containerName}", httpMethod: "PUT", responses: { 201: { - headersMapper: ContainerCreateHeaders + headersMapper: Mappers.ContainerCreateHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerCreateExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerCreateExceptionHeaders } }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.restype2], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - metadata, - access, - defaultEncryptionScope, - preventEncryptionScopeOverride + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.metadata, + Parameters.access, + Parameters.defaultEncryptionScope, + Parameters.preventEncryptionScopeOverride ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; - var getPropertiesOperationSpec$1 = { + var getPropertiesOperationSpec = { path: "/{containerName}", httpMethod: "GET", responses: { 200: { - headersMapper: ContainerGetPropertiesHeaders + headersMapper: Mappers.ContainerGetPropertiesHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerGetPropertiesExceptionHeaders } }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.restype2], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - leaseId + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; - var deleteOperationSpec$1 = { + var deleteOperationSpec = { path: "/{containerName}", httpMethod: "DELETE", responses: { 202: { - headersMapper: ContainerDeleteHeaders + headersMapper: Mappers.ContainerDeleteHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerDeleteExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerDeleteExceptionHeaders } }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.restype2], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; - var setMetadataOperationSpec$1 = { + var setMetadataOperationSpec = { path: "/{containerName}", httpMethod: "PUT", responses: { 200: { - headersMapper: ContainerSetMetadataHeaders + headersMapper: Mappers.ContainerSetMetadataHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerSetMetadataExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerSetMetadataExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - restype2, - comp6 + Parameters.timeoutInSeconds, + Parameters.restype2, + Parameters.comp6 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.metadata, + Parameters.leaseId, + Parameters.ifModifiedSince ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; var getAccessPolicyOperationSpec = { path: "/{containerName}", @@ -50192,117 +52923,117 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; xmlIsWrapped: true, xmlElementName: "SignedIdentifier" }, - headersMapper: ContainerGetAccessPolicyHeaders + headersMapper: Mappers.ContainerGetAccessPolicyHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerGetAccessPolicyExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - restype2, - comp7 + Parameters.timeoutInSeconds, + Parameters.restype2, + Parameters.comp7 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - leaseId + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; var setAccessPolicyOperationSpec = { path: "/{containerName}", httpMethod: "PUT", responses: { 200: { - headersMapper: ContainerSetAccessPolicyHeaders + headersMapper: Mappers.ContainerSetAccessPolicyHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerSetAccessPolicyExceptionHeaders } }, - requestBody: containerAcl, + requestBody: Parameters.containerAcl, queryParameters: [ - timeoutInSeconds, - restype2, - comp7 + Parameters.timeoutInSeconds, + Parameters.restype2, + Parameters.comp7 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - contentType, - accept, - version2, - requestId, - access, - leaseId, - ifModifiedSince, - ifUnmodifiedSince + Parameters.contentType, + Parameters.accept, + Parameters.version, + Parameters.requestId, + Parameters.access, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince ], isXML: true, contentType: "application/xml; charset=utf-8", mediaType: "xml", - serializer: xmlSerializer$4 + serializer: xmlSerializer }; var restoreOperationSpec = { path: "/{containerName}", httpMethod: "PUT", responses: { 201: { - headersMapper: ContainerRestoreHeaders + headersMapper: Mappers.ContainerRestoreHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerRestoreExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerRestoreExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - restype2, - comp8 + Parameters.timeoutInSeconds, + Parameters.restype2, + Parameters.comp8 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - deletedContainerName, - deletedContainerVersion + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.deletedContainerName, + Parameters.deletedContainerVersion ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; var renameOperationSpec = { path: "/{containerName}", httpMethod: "PUT", responses: { 200: { - headersMapper: ContainerRenameHeaders + headersMapper: Mappers.ContainerRenameHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerRenameExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerRenameExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - restype2, - comp9 + Parameters.timeoutInSeconds, + Parameters.restype2, + Parameters.comp9 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - sourceContainerName, - sourceLeaseId + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.sourceContainerName, + Parameters.sourceLeaseId ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; var submitBatchOperationSpec = { path: "/{containerName}", @@ -50313,307 +53044,321 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "Stream" }, serializedName: "parsedResponse" }, - headersMapper: ContainerSubmitBatchHeaders + headersMapper: Mappers.ContainerSubmitBatchHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerSubmitBatchExceptionHeaders } }, - requestBody: body, + requestBody: Parameters.body, queryParameters: [ - timeoutInSeconds, - comp4, - restype2 + Parameters.timeoutInSeconds, + Parameters.comp4, + Parameters.restype2 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - accept, - version2, - requestId, - contentLength, - multipartContentType + Parameters.accept, + Parameters.version, + Parameters.requestId, + Parameters.contentLength, + Parameters.multipartContentType ], isXML: true, contentType: "application/xml; charset=utf-8", mediaType: "xml", - serializer: xmlSerializer$4 + serializer: xmlSerializer }; var filterBlobsOperationSpec = { path: "/{containerName}", httpMethod: "GET", responses: { 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ContainerFilterBlobsHeaders + bodyMapper: Mappers.FilterBlobSegment, + headersMapper: Mappers.ContainerFilterBlobsHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerFilterBlobsExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerFilterBlobsExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where, - restype2 + Parameters.timeoutInSeconds, + Parameters.marker, + Parameters.maxPageSize, + Parameters.comp5, + Parameters.where, + Parameters.restype2 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1 ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; - var acquireLeaseOperationSpec$1 = { + var acquireLeaseOperationSpec = { path: "/{containerName}", httpMethod: "PUT", responses: { 201: { - headersMapper: ContainerAcquireLeaseHeaders + headersMapper: Mappers.ContainerAcquireLeaseHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerAcquireLeaseExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - restype2, - comp10 + Parameters.timeoutInSeconds, + Parameters.restype2, + Parameters.comp10 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.action, + Parameters.duration, + Parameters.proposedLeaseId ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; - var releaseLeaseOperationSpec$1 = { + var releaseLeaseOperationSpec = { path: "/{containerName}", httpMethod: "PUT", responses: { 200: { - headersMapper: ContainerReleaseLeaseHeaders + headersMapper: Mappers.ContainerReleaseLeaseHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerReleaseLeaseExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - restype2, - comp10 + Parameters.timeoutInSeconds, + Parameters.restype2, + Parameters.comp10 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.action1, + Parameters.leaseId1 ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; - var renewLeaseOperationSpec$1 = { + var renewLeaseOperationSpec = { path: "/{containerName}", httpMethod: "PUT", responses: { 200: { - headersMapper: ContainerRenewLeaseHeaders + headersMapper: Mappers.ContainerRenewLeaseHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerRenewLeaseExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - restype2, - comp10 + Parameters.timeoutInSeconds, + Parameters.restype2, + Parameters.comp10 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.leaseId1, + Parameters.action2 ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; - var breakLeaseOperationSpec$1 = { + var breakLeaseOperationSpec = { path: "/{containerName}", httpMethod: "PUT", responses: { 202: { - headersMapper: ContainerBreakLeaseHeaders + headersMapper: Mappers.ContainerBreakLeaseHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerBreakLeaseExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - restype2, - comp10 + Parameters.timeoutInSeconds, + Parameters.restype2, + Parameters.comp10 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.action3, + Parameters.breakPeriod ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; - var changeLeaseOperationSpec$1 = { + var changeLeaseOperationSpec = { path: "/{containerName}", httpMethod: "PUT", responses: { 200: { - headersMapper: ContainerChangeLeaseHeaders + headersMapper: Mappers.ContainerChangeLeaseHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerChangeLeaseExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - restype2, - comp10 + Parameters.timeoutInSeconds, + Parameters.restype2, + Parameters.comp10 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.leaseId1, + Parameters.action4, + Parameters.proposedLeaseId1 ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; var listBlobFlatSegmentOperationSpec = { path: "/{containerName}", httpMethod: "GET", responses: { 200: { - bodyMapper: ListBlobsFlatSegmentResponse, - headersMapper: ContainerListBlobFlatSegmentHeaders + bodyMapper: Mappers.ListBlobsFlatSegmentResponse, + headersMapper: Mappers.ContainerListBlobFlatSegmentHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerListBlobFlatSegmentExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1 + Parameters.timeoutInSeconds, + Parameters.comp2, + Parameters.prefix, + Parameters.marker, + Parameters.maxPageSize, + Parameters.restype2, + Parameters.include1 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1 ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; var listBlobHierarchySegmentOperationSpec = { path: "/{containerName}", httpMethod: "GET", responses: { 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders + bodyMapper: Mappers.ListBlobsHierarchySegmentResponse, + headersMapper: Mappers.ContainerListBlobHierarchySegmentHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerListBlobHierarchySegmentExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1, - delimiter + Parameters.timeoutInSeconds, + Parameters.comp2, + Parameters.prefix, + Parameters.marker, + Parameters.maxPageSize, + Parameters.restype2, + Parameters.include1, + Parameters.delimiter ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1 ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; - var getAccountInfoOperationSpec$1 = { + var getAccountInfoOperationSpec = { path: "/{containerName}", httpMethod: "GET", responses: { 200: { - headersMapper: ContainerGetAccountInfoHeaders + headersMapper: Mappers.ContainerGetAccountInfoHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerGetAccountInfoExceptionHeaders } }, queryParameters: [ - comp, - timeoutInSeconds, - restype1 + Parameters.comp, + Parameters.timeoutInSeconds, + Parameters.restype1 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1 ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/blob.js +var require_blob = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/blob.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BlobImpl = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var coreClient = tslib_1.__importStar(require_commonjs8()); + var Mappers = tslib_1.__importStar(require_mappers()); + var Parameters = tslib_1.__importStar(require_parameters()); var BlobImpl = class { static { __name(this, "BlobImpl"); } + client; /** * Initialize a new instance of the class Blob class. * @param client Reference to the service client @@ -50667,8 +53412,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param expiryOptions Required. Indicates mode of the expiry time * @param options The options parameters. */ - setExpiry(expiryOptions2, options) { - return this.client.sendOperationRequest({ expiryOptions: expiryOptions2, options }, setExpiryOperationSpec); + setExpiry(expiryOptions, options) { + return this.client.sendOperationRequest({ expiryOptions, options }, setExpiryOperationSpec); } /** * The Set HTTP Headers operation sets system properties on the blob @@ -50696,8 +53441,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param legalHold Specified if a legal hold should be set on the blob. * @param options The options parameters. */ - setLegalHold(legalHold2, options) { - return this.client.sendOperationRequest({ legalHold: legalHold2, options }, setLegalHoldOperationSpec); + setLegalHold(legalHold, options) { + return this.client.sendOperationRequest({ legalHold, options }, setLegalHoldOperationSpec); } /** * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more @@ -50721,8 +53466,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param leaseId Specifies the current lease ID on the resource. * @param options The options parameters. */ - releaseLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec); + releaseLease(leaseId, options) { + return this.client.sendOperationRequest({ leaseId, options }, releaseLeaseOperationSpec); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete @@ -50730,8 +53475,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param leaseId Specifies the current lease ID on the resource. * @param options The options parameters. */ - renewLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec); + renewLease(leaseId, options) { + return this.client.sendOperationRequest({ leaseId, options }, renewLeaseOperationSpec); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete @@ -50742,8 +53487,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * (String) for a list of valid GUID string formats. * @param options The options parameters. */ - changeLease(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec); + changeLease(leaseId, proposedLeaseId, options) { + return this.client.sendOperationRequest({ leaseId, proposedLeaseId, options }, changeLeaseOperationSpec); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete @@ -50768,8 +53513,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * access signature. * @param options The options parameters. */ - startCopyFromURL(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, startCopyFromURLOperationSpec); + startCopyFromURL(copySource, options) { + return this.client.sendOperationRequest({ copySource, options }, startCopyFromURLOperationSpec); } /** * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return @@ -50780,8 +53525,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * access signature. * @param options The options parameters. */ - copyFromURL(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyFromURLOperationSpec); + copyFromURL(copySource, options) { + return this.client.sendOperationRequest({ copySource, options }, copyFromURLOperationSpec); } /** * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination @@ -50790,8 +53535,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * operation. * @param options The options parameters. */ - abortCopyFromURL(copyId2, options) { - return this.client.sendOperationRequest({ copyId: copyId2, options }, abortCopyFromURLOperationSpec); + abortCopyFromURL(copyId, options) { + return this.client.sendOperationRequest({ copyId, options }, abortCopyFromURLOperationSpec); } /** * The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium @@ -50802,8 +53547,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param tier Indicates the tier to be set on the blob. * @param options The options parameters. */ - setTier(tier2, options) { - return this.client.sendOperationRequest({ tier: tier2, options }, setTierOperationSpec); + setTier(tier, options) { + return this.client.sendOperationRequest({ tier, options }, setTierOperationSpec); } /** * Returns the sku name and account kind @@ -50835,7 +53580,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.client.sendOperationRequest({ options }, setTagsOperationSpec); } }; - var xmlSerializer$3 = coreClient__namespace.createSerializer( + exports2.BlobImpl = BlobImpl; + var xmlSerializer = coreClient.createSerializer( Mappers, /* isXml */ true @@ -50849,651 +53595,667 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "Stream" }, serializedName: "parsedResponse" }, - headersMapper: BlobDownloadHeaders + headersMapper: Mappers.BlobDownloadHeaders }, 206: { bodyMapper: { type: { name: "Stream" }, serializedName: "parsedResponse" }, - headersMapper: BlobDownloadHeaders + headersMapper: Mappers.BlobDownloadHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobDownloadExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobDownloadExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - snapshot, - versionId + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.versionId ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - rangeGetContentMD5, - rangeGetContentCRC64, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.range, + Parameters.rangeGetContentMD5, + Parameters.rangeGetContentCRC64, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var getPropertiesOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "HEAD", responses: { 200: { - headersMapper: BlobGetPropertiesHeaders + headersMapper: Mappers.BlobGetPropertiesHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobGetPropertiesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobGetPropertiesExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - snapshot, - versionId + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.versionId ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var deleteOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "DELETE", responses: { 202: { - headersMapper: BlobDeleteHeaders + headersMapper: Mappers.BlobDeleteHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobDeleteExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - blobDeleteType + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.versionId, + Parameters.blobDeleteType ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - deleteSnapshots + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.deleteSnapshots ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var undeleteOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 200: { - headersMapper: BlobUndeleteHeaders + headersMapper: Mappers.BlobUndeleteHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobUndeleteExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobUndeleteExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp8], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp8], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1 ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var setExpiryOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 200: { - headersMapper: BlobSetExpiryHeaders + headersMapper: Mappers.BlobSetExpiryHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobSetExpiryExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobSetExpiryExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp11], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp11], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - expiryOptions, - expiresOn + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.expiryOptions, + Parameters.expiresOn ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var setHttpHeadersOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 200: { - headersMapper: BlobSetHttpHeadersHeaders + headersMapper: Mappers.BlobSetHttpHeadersHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobSetHttpHeadersExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobSetHttpHeadersExceptionHeaders } }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], + queryParameters: [Parameters.comp, Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.blobCacheControl, + Parameters.blobContentType, + Parameters.blobContentMD5, + Parameters.blobContentEncoding, + Parameters.blobContentLanguage, + Parameters.blobContentDisposition ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var setImmutabilityPolicyOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 200: { - headersMapper: BlobSetImmutabilityPolicyHeaders + headersMapper: Mappers.BlobSetImmutabilityPolicyHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobSetImmutabilityPolicyExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobSetImmutabilityPolicyExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], + queryParameters: [ + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.versionId, + Parameters.comp12 + ], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - ifUnmodifiedSince, - immutabilityPolicyExpiry, - immutabilityPolicyMode + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.ifUnmodifiedSince, + Parameters.immutabilityPolicyExpiry, + Parameters.immutabilityPolicyMode ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var deleteImmutabilityPolicyOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "DELETE", responses: { 200: { - headersMapper: BlobDeleteImmutabilityPolicyHeaders + headersMapper: Mappers.BlobDeleteImmutabilityPolicyHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobDeleteImmutabilityPolicyExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], + queryParameters: [ + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.versionId, + Parameters.comp12 + ], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1 ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var setLegalHoldOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 200: { - headersMapper: BlobSetLegalHoldHeaders + headersMapper: Mappers.BlobSetLegalHoldHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobSetLegalHoldExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobSetLegalHoldExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp13], - urlParameters: [url], + queryParameters: [ + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.versionId, + Parameters.comp13 + ], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - legalHold + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.legalHold ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var setMetadataOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 200: { - headersMapper: BlobSetMetadataHeaders + headersMapper: Mappers.BlobSetMetadataHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobSetMetadataExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobSetMetadataExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp6], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp6], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.metadata, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.encryptionScope ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var acquireLeaseOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 201: { - headersMapper: BlobAcquireLeaseHeaders + headersMapper: Mappers.BlobAcquireLeaseHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobAcquireLeaseExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp10], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId, - ifMatch, - ifNoneMatch, - ifTags + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.action, + Parameters.duration, + Parameters.proposedLeaseId, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var releaseLeaseOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 200: { - headersMapper: BlobReleaseLeaseHeaders + headersMapper: Mappers.BlobReleaseLeaseHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobReleaseLeaseExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp10], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1, - ifMatch, - ifNoneMatch, - ifTags + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.action1, + Parameters.leaseId1, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var renewLeaseOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 200: { - headersMapper: BlobRenewLeaseHeaders + headersMapper: Mappers.BlobRenewLeaseHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobRenewLeaseExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobRenewLeaseExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp10], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2, - ifMatch, - ifNoneMatch, - ifTags + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.leaseId1, + Parameters.action2, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var changeLeaseOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 200: { - headersMapper: BlobChangeLeaseHeaders + headersMapper: Mappers.BlobChangeLeaseHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobChangeLeaseExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobChangeLeaseExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp10], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1, - ifMatch, - ifNoneMatch, - ifTags + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.leaseId1, + Parameters.action4, + Parameters.proposedLeaseId1, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var breakLeaseOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 202: { - headersMapper: BlobBreakLeaseHeaders + headersMapper: Mappers.BlobBreakLeaseHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobBreakLeaseExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobBreakLeaseExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp10], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod, - ifMatch, - ifNoneMatch, - ifTags + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.action3, + Parameters.breakPeriod, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var createSnapshotOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 201: { - headersMapper: BlobCreateSnapshotHeaders + headersMapper: Mappers.BlobCreateSnapshotHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobCreateSnapshotExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp14], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp14], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.metadata, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.encryptionScope ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var startCopyFromURLOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 202: { - headersMapper: BlobStartCopyFromURLHeaders + headersMapper: Mappers.BlobStartCopyFromURLHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobStartCopyFromURLExceptionHeaders } }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - tier, - rehydratePriority, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sealBlob, - legalHold1 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.metadata, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.immutabilityPolicyExpiry, + Parameters.immutabilityPolicyMode, + Parameters.tier, + Parameters.rehydratePriority, + Parameters.sourceIfModifiedSince, + Parameters.sourceIfUnmodifiedSince, + Parameters.sourceIfMatch, + Parameters.sourceIfNoneMatch, + Parameters.sourceIfTags, + Parameters.copySource, + Parameters.blobTagsString, + Parameters.sealBlob, + Parameters.legalHold1 ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var copyFromURLOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 202: { - headersMapper: BlobCopyFromURLHeaders + headersMapper: Mappers.BlobCopyFromURLHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobCopyFromURLExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobCopyFromURLExceptionHeaders } }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - copySource, - blobTagsString, - legalHold1, - xMsRequiresSync, - sourceContentMD5, - copySourceAuthorization, - copySourceTags + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.metadata, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.immutabilityPolicyExpiry, + Parameters.immutabilityPolicyMode, + Parameters.encryptionScope, + Parameters.tier, + Parameters.sourceIfModifiedSince, + Parameters.sourceIfUnmodifiedSince, + Parameters.sourceIfMatch, + Parameters.sourceIfNoneMatch, + Parameters.copySource, + Parameters.blobTagsString, + Parameters.legalHold1, + Parameters.xMsRequiresSync, + Parameters.sourceContentMD5, + Parameters.copySourceAuthorization, + Parameters.copySourceTags, + Parameters.fileRequestIntent ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var abortCopyFromURLOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 204: { - headersMapper: BlobAbortCopyFromURLHeaders + headersMapper: Mappers.BlobAbortCopyFromURLHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobAbortCopyFromURLExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - comp15, - copyId + Parameters.timeoutInSeconds, + Parameters.comp15, + Parameters.copyId ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - leaseId, - copyActionAbortConstant + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.copyActionAbortConstant ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var setTierOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 200: { - headersMapper: BlobSetTierHeaders + headersMapper: Mappers.BlobSetTierHeaders }, 202: { - headersMapper: BlobSetTierHeaders + headersMapper: Mappers.BlobSetTierHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobSetTierExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobSetTierExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp16 + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.versionId, + Parameters.comp16 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifTags, - rehydratePriority, - tier1 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifTags, + Parameters.rehydratePriority, + Parameters.tier1 ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var getAccountInfoOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "GET", responses: { 200: { - headersMapper: BlobGetAccountInfoHeaders + headersMapper: Mappers.BlobGetAccountInfoHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobGetAccountInfoExceptionHeaders } }, queryParameters: [ - comp, - timeoutInSeconds, - restype1 + Parameters.comp, + Parameters.timeoutInSeconds, + Parameters.restype1 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1 ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var queryOperationSpec = { path: "/{containerName}/{blob}", @@ -51504,115 +54266,129 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "Stream" }, serializedName: "parsedResponse" }, - headersMapper: BlobQueryHeaders + headersMapper: Mappers.BlobQueryHeaders }, 206: { bodyMapper: { type: { name: "Stream" }, serializedName: "parsedResponse" }, - headersMapper: BlobQueryHeaders + headersMapper: Mappers.BlobQueryHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobQueryExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobQueryExceptionHeaders } }, - requestBody: queryRequest, + requestBody: Parameters.queryRequest, queryParameters: [ - timeoutInSeconds, - snapshot, - comp17 + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.comp17 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - contentType, - accept, - version2, - requestId, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags + Parameters.contentType, + Parameters.accept, + Parameters.version, + Parameters.requestId, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags ], isXML: true, contentType: "application/xml; charset=utf-8", mediaType: "xml", - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var getTagsOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "GET", responses: { 200: { - bodyMapper: BlobTags, - headersMapper: BlobGetTagsHeaders + bodyMapper: Mappers.BlobTags, + headersMapper: Mappers.BlobGetTagsHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobGetTagsExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobGetTagsExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp18 + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.versionId, + Parameters.comp18 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifTags + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifTags ], isXML: true, - serializer: xmlSerializer$3 + serializer: xmlSerializer }; var setTagsOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 204: { - headersMapper: BlobSetTagsHeaders + headersMapper: Mappers.BlobSetTagsHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlobSetTagsExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobSetTagsExceptionHeaders } }, - requestBody: tags, + requestBody: Parameters.tags, queryParameters: [ - timeoutInSeconds, - versionId, - comp18 + Parameters.timeoutInSeconds, + Parameters.versionId, + Parameters.comp18 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - contentType, - accept, - version2, - requestId, - leaseId, - ifTags, - transactionalContentMD5, - transactionalContentCrc64 + Parameters.contentType, + Parameters.accept, + Parameters.version, + Parameters.requestId, + Parameters.leaseId, + Parameters.ifTags, + Parameters.transactionalContentMD5, + Parameters.transactionalContentCrc64 ], isXML: true, contentType: "application/xml; charset=utf-8", mediaType: "xml", - serializer: xmlSerializer$3 + serializer: xmlSerializer }; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/pageBlob.js +var require_pageBlob = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/pageBlob.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.PageBlobImpl = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var coreClient = tslib_1.__importStar(require_commonjs8()); + var Mappers = tslib_1.__importStar(require_mappers()); + var Parameters = tslib_1.__importStar(require_parameters()); var PageBlobImpl = class { static { __name(this, "PageBlobImpl"); } + client; /** * Initialize a new instance of the class PageBlob class. * @param client Reference to the service client @@ -51627,8 +54403,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * page blob size must be aligned to a 512-byte boundary. * @param options The options parameters. */ - create(contentLength2, blobContentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, blobContentLength: blobContentLength2, options }, createOperationSpec$1); + create(contentLength, blobContentLength, options) { + return this.client.sendOperationRequest({ contentLength, blobContentLength, options }, createOperationSpec); } /** * The Upload Pages operation writes a range of pages to a page blob @@ -51636,16 +54412,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param body Initial data * @param options The options parameters. */ - uploadPages(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadPagesOperationSpec); + uploadPages(contentLength, body, options) { + return this.client.sendOperationRequest({ contentLength, body, options }, 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) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, clearPagesOperationSpec); + clearPages(contentLength, options) { + return this.client.sendOperationRequest({ contentLength, options }, clearPagesOperationSpec); } /** * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a @@ -51658,8 +54434,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * aligned and range-end is required. * @param options The options parameters. */ - uploadPagesFromURL(sourceUrl2, sourceRange2, contentLength2, range2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, sourceRange: sourceRange2, contentLength: contentLength2, range: range2, options }, uploadPagesFromURLOperationSpec); + uploadPagesFromURL(sourceUrl, sourceRange, contentLength, range, options) { + return this.client.sendOperationRequest({ sourceUrl, sourceRange, contentLength, range, options }, uploadPagesFromURLOperationSpec); } /** * The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a @@ -51683,8 +54459,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * page blob size must be aligned to a 512-byte boundary. * @param options The options parameters. */ - resize(blobContentLength2, options) { - return this.client.sendOperationRequest({ blobContentLength: blobContentLength2, options }, resizeOperationSpec); + resize(blobContentLength, options) { + return this.client.sendOperationRequest({ blobContentLength, options }, resizeOperationSpec); } /** * Update the sequence number of the blob @@ -51693,8 +54469,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * blob's sequence number * @param options The options parameters. */ - updateSequenceNumber(sequenceNumberAction2, options) { - return this.client.sendOperationRequest({ sequenceNumberAction: sequenceNumberAction2, options }, updateSequenceNumberOperationSpec); + updateSequenceNumber(sequenceNumberAction, options) { + return this.client.sendOperationRequest({ sequenceNumberAction, options }, updateSequenceNumberOperationSpec); } /** * The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. @@ -51708,361 +54484,377 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * access signature. * @param options The options parameters. */ - copyIncremental(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyIncrementalOperationSpec); + copyIncremental(copySource, options) { + return this.client.sendOperationRequest({ copySource, options }, copyIncrementalOperationSpec); } }; - var xmlSerializer$2 = coreClient__namespace.createSerializer( + exports2.PageBlobImpl = PageBlobImpl; + var xmlSerializer = coreClient.createSerializer( Mappers, /* isXml */ true ); - var createOperationSpec$1 = { + var createOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 201: { - headersMapper: PageBlobCreateHeaders + headersMapper: Mappers.PageBlobCreateHeaders }, default: { - bodyMapper: StorageError, - headersMapper: PageBlobCreateExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobCreateExceptionHeaders } }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - blobType, - blobContentLength, - blobSequenceNumber + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.contentLength, + Parameters.metadata, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.blobCacheControl, + Parameters.blobContentType, + Parameters.blobContentMD5, + Parameters.blobContentEncoding, + Parameters.blobContentLanguage, + Parameters.blobContentDisposition, + Parameters.immutabilityPolicyExpiry, + Parameters.immutabilityPolicyMode, + Parameters.encryptionScope, + Parameters.tier, + Parameters.blobTagsString, + Parameters.legalHold1, + Parameters.blobType, + Parameters.blobContentLength, + Parameters.blobSequenceNumber ], isXML: true, - serializer: xmlSerializer$2 + serializer: xmlSerializer }; var uploadPagesOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 201: { - headersMapper: PageBlobUploadPagesHeaders + headersMapper: Mappers.PageBlobUploadPagesHeaders }, default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobUploadPagesExceptionHeaders } }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], + requestBody: Parameters.body1, + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp19], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo + Parameters.version, + Parameters.requestId, + Parameters.contentLength, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.range, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.encryptionScope, + Parameters.transactionalContentMD5, + Parameters.transactionalContentCrc64, + Parameters.contentType1, + Parameters.accept2, + Parameters.pageWrite, + Parameters.ifSequenceNumberLessThanOrEqualTo, + Parameters.ifSequenceNumberLessThan, + Parameters.ifSequenceNumberEqualTo ], isXML: true, contentType: "application/xml; charset=utf-8", mediaType: "binary", - serializer: xmlSerializer$2 + serializer: xmlSerializer }; var clearPagesOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 201: { - headersMapper: PageBlobClearPagesHeaders + headersMapper: Mappers.PageBlobClearPagesHeaders }, default: { - bodyMapper: StorageError, - headersMapper: PageBlobClearPagesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobClearPagesExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp19], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - pageWrite1 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.contentLength, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.range, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.encryptionScope, + Parameters.ifSequenceNumberLessThanOrEqualTo, + Parameters.ifSequenceNumberLessThan, + Parameters.ifSequenceNumberEqualTo, + Parameters.pageWrite1 ], isXML: true, - serializer: xmlSerializer$2 + serializer: xmlSerializer }; var uploadPagesFromURLOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 201: { - headersMapper: PageBlobUploadPagesFromURLHeaders + headersMapper: Mappers.PageBlobUploadPagesFromURLHeaders }, default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobUploadPagesFromURLExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp19], + urlParameters: [Parameters.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 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.contentLength, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.encryptionScope, + Parameters.sourceIfModifiedSince, + Parameters.sourceIfUnmodifiedSince, + Parameters.sourceIfMatch, + Parameters.sourceIfNoneMatch, + Parameters.sourceContentMD5, + Parameters.copySourceAuthorization, + Parameters.fileRequestIntent, + Parameters.pageWrite, + Parameters.ifSequenceNumberLessThanOrEqualTo, + Parameters.ifSequenceNumberLessThan, + Parameters.ifSequenceNumberEqualTo, + Parameters.sourceUrl, + Parameters.sourceRange, + Parameters.sourceContentCrc64, + Parameters.range1 ], isXML: true, - serializer: xmlSerializer$2 + serializer: xmlSerializer }; var getPageRangesOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "GET", responses: { 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesHeaders + bodyMapper: Mappers.PageList, + headersMapper: Mappers.PageBlobGetPageRangesHeaders }, default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobGetPageRangesExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20 + Parameters.timeoutInSeconds, + Parameters.marker, + Parameters.maxPageSize, + Parameters.snapshot, + Parameters.comp20 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.range, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags ], isXML: true, - serializer: xmlSerializer$2 + serializer: xmlSerializer }; var getPageRangesDiffOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "GET", responses: { 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesDiffHeaders + bodyMapper: Mappers.PageList, + headersMapper: Mappers.PageBlobGetPageRangesDiffHeaders }, default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobGetPageRangesDiffExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20, - prevsnapshot + Parameters.timeoutInSeconds, + Parameters.marker, + Parameters.maxPageSize, + Parameters.snapshot, + Parameters.comp20, + Parameters.prevsnapshot ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags, - prevSnapshotUrl + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.range, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.prevSnapshotUrl ], isXML: true, - serializer: xmlSerializer$2 + serializer: xmlSerializer }; var resizeOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 200: { - headersMapper: PageBlobResizeHeaders + headersMapper: Mappers.PageBlobResizeHeaders }, default: { - bodyMapper: StorageError, - headersMapper: PageBlobResizeExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobResizeExceptionHeaders } }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], + queryParameters: [Parameters.comp, Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - blobContentLength + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.encryptionScope, + Parameters.blobContentLength ], isXML: true, - serializer: xmlSerializer$2 + serializer: xmlSerializer }; var updateSequenceNumberOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 200: { - headersMapper: PageBlobUpdateSequenceNumberHeaders + headersMapper: Mappers.PageBlobUpdateSequenceNumberHeaders }, default: { - bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobUpdateSequenceNumberExceptionHeaders } }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], + queryParameters: [Parameters.comp, Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobSequenceNumber, - sequenceNumberAction + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.blobSequenceNumber, + Parameters.sequenceNumberAction ], isXML: true, - serializer: xmlSerializer$2 + serializer: xmlSerializer }; var copyIncrementalOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 202: { - headersMapper: PageBlobCopyIncrementalHeaders + headersMapper: Mappers.PageBlobCopyIncrementalHeaders }, default: { - bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobCopyIncrementalExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp21], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp21], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - copySource + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.copySource ], isXML: true, - serializer: xmlSerializer$2 + serializer: xmlSerializer }; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/appendBlob.js +var require_appendBlob = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/appendBlob.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AppendBlobImpl = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var coreClient = tslib_1.__importStar(require_commonjs8()); + var Mappers = tslib_1.__importStar(require_mappers()); + var Parameters = tslib_1.__importStar(require_parameters()); var AppendBlobImpl = class { static { __name(this, "AppendBlobImpl"); } + client; /** * Initialize a new instance of the class AppendBlob class. * @param client Reference to the service client @@ -52075,8 +54867,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param contentLength The length of the request. * @param options The options parameters. */ - create(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, createOperationSpec); + create(contentLength, options) { + return this.client.sendOperationRequest({ contentLength, options }, createOperationSpec); } /** * The Append Block operation commits a new block of data to the end of an existing append blob. The @@ -52086,8 +54878,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param body Initial data * @param options The options parameters. */ - appendBlock(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, appendBlockOperationSpec); + appendBlock(contentLength, body, options) { + return this.client.sendOperationRequest({ contentLength, body, options }, appendBlockOperationSpec); } /** * The Append Block operation commits a new block of data to the end of an existing append blob where @@ -52098,8 +54890,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param contentLength The length of the request. * @param options The options parameters. */ - appendBlockFromUrl(sourceUrl2, contentLength2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, contentLength: contentLength2, options }, appendBlockFromUrlOperationSpec); + appendBlockFromUrl(sourceUrl, contentLength, options) { + return this.client.sendOperationRequest({ sourceUrl, contentLength, options }, appendBlockFromUrlOperationSpec); } /** * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version @@ -52110,7 +54902,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.client.sendOperationRequest({ options }, sealOperationSpec); } }; - var xmlSerializer$1 = coreClient__namespace.createSerializer( + exports2.AppendBlobImpl = AppendBlobImpl; + var xmlSerializer = coreClient.createSerializer( Mappers, /* isXml */ true @@ -52120,164 +54913,179 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; httpMethod: "PUT", responses: { 201: { - headersMapper: AppendBlobCreateHeaders + headersMapper: Mappers.AppendBlobCreateHeaders }, default: { - bodyMapper: StorageError, - headersMapper: AppendBlobCreateExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.AppendBlobCreateExceptionHeaders } }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - blobTagsString, - legalHold1, - blobType1 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.contentLength, + Parameters.metadata, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.blobCacheControl, + Parameters.blobContentType, + Parameters.blobContentMD5, + Parameters.blobContentEncoding, + Parameters.blobContentLanguage, + Parameters.blobContentDisposition, + Parameters.immutabilityPolicyExpiry, + Parameters.immutabilityPolicyMode, + Parameters.encryptionScope, + Parameters.blobTagsString, + Parameters.legalHold1, + Parameters.blobType1 ], isXML: true, - serializer: xmlSerializer$1 + serializer: xmlSerializer }; var appendBlockOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 201: { - headersMapper: AppendBlobAppendBlockHeaders + headersMapper: Mappers.AppendBlobAppendBlockHeaders }, default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.AppendBlobAppendBlockExceptionHeaders } }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], + requestBody: Parameters.body1, + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp22], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - maxSize, - appendPosition + Parameters.version, + Parameters.requestId, + Parameters.contentLength, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.encryptionScope, + Parameters.transactionalContentMD5, + Parameters.transactionalContentCrc64, + Parameters.contentType1, + Parameters.accept2, + Parameters.maxSize, + Parameters.appendPosition ], isXML: true, contentType: "application/xml; charset=utf-8", mediaType: "binary", - serializer: xmlSerializer$1 + serializer: xmlSerializer }; var appendBlockFromUrlOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 201: { - headersMapper: AppendBlobAppendBlockFromUrlHeaders + headersMapper: Mappers.AppendBlobAppendBlockFromUrlHeaders }, default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.AppendBlobAppendBlockFromUrlExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp22], + urlParameters: [Parameters.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 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.contentLength, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.encryptionScope, + Parameters.sourceIfModifiedSince, + Parameters.sourceIfUnmodifiedSince, + Parameters.sourceIfMatch, + Parameters.sourceIfNoneMatch, + Parameters.sourceContentMD5, + Parameters.copySourceAuthorization, + Parameters.fileRequestIntent, + Parameters.transactionalContentMD5, + Parameters.sourceUrl, + Parameters.sourceContentCrc64, + Parameters.maxSize, + Parameters.appendPosition, + Parameters.sourceRange1 ], isXML: true, - serializer: xmlSerializer$1 + serializer: xmlSerializer }; var sealOperationSpec = { path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { 200: { - headersMapper: AppendBlobSealHeaders + headersMapper: Mappers.AppendBlobSealHeaders }, default: { - bodyMapper: StorageError, - headersMapper: AppendBlobSealExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.AppendBlobSealExceptionHeaders } }, - queryParameters: [timeoutInSeconds, comp23], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp23], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - appendPosition + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.appendPosition ], isXML: true, - serializer: xmlSerializer$1 + serializer: xmlSerializer }; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/blockBlob.js +var require_blockBlob = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/blockBlob.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BlockBlobImpl = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var coreClient = tslib_1.__importStar(require_commonjs8()); + var Mappers = tslib_1.__importStar(require_mappers()); + var Parameters = tslib_1.__importStar(require_parameters()); var BlockBlobImpl = class { static { __name(this, "BlockBlobImpl"); } + client; /** * Initialize a new instance of the class BlockBlob class. * @param client Reference to the service client @@ -52294,8 +55102,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param body Initial data * @param options The options parameters. */ - upload(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadOperationSpec); + upload(contentLength, body, options) { + return this.client.sendOperationRequest({ contentLength, body, options }, uploadOperationSpec); } /** * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read @@ -52310,8 +55118,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * access signature. * @param options The options parameters. */ - putBlobFromUrl(contentLength2, copySource2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, copySource: copySource2, options }, putBlobFromUrlOperationSpec); + putBlobFromUrl(contentLength, copySource, options) { + return this.client.sendOperationRequest({ contentLength, copySource, options }, putBlobFromUrlOperationSpec); } /** * The Stage Block operation creates a new block to be committed as part of a blob @@ -52322,8 +55130,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param body Initial data * @param options The options parameters. */ - stageBlock(blockId2, contentLength2, body2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, body: body2, options }, stageBlockOperationSpec); + stageBlock(blockId, contentLength, body, options) { + return this.client.sendOperationRequest({ blockId, contentLength, body, options }, stageBlockOperationSpec); } /** * The Stage Block operation creates a new block to be committed as part of a blob where the contents @@ -52335,8 +55143,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param sourceUrl Specify a URL to the copy source. * @param options The options parameters. */ - stageBlockFromURL(blockId2, contentLength2, sourceUrl2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, sourceUrl: sourceUrl2, options }, stageBlockFromURLOperationSpec); + stageBlockFromURL(blockId, contentLength, sourceUrl, options) { + return this.client.sendOperationRequest({ blockId, contentLength, sourceUrl, options }, stageBlockFromURLOperationSpec); } /** * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the @@ -52349,8 +55157,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blocks Blob Blocks. * @param options The options parameters. */ - commitBlockList(blocks2, options) { - return this.client.sendOperationRequest({ blocks: blocks2, options }, commitBlockListOperationSpec); + commitBlockList(blocks, options) { + return this.client.sendOperationRequest({ blocks, options }, commitBlockListOperationSpec); } /** * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block @@ -52359,11 +55167,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * blocks, or both lists together. * @param options The options parameters. */ - getBlockList(listType2, options) { - return this.client.sendOperationRequest({ listType: listType2, options }, getBlockListOperationSpec); + getBlockList(listType, options) { + return this.client.sendOperationRequest({ listType, options }, getBlockListOperationSpec); } }; - var xmlSerializer = coreClient__namespace.createSerializer( + exports2.BlockBlobImpl = BlockBlobImpl; + var xmlSerializer = coreClient.createSerializer( Mappers, /* isXml */ true @@ -52373,47 +55182,47 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; httpMethod: "PUT", responses: { 201: { - headersMapper: BlockBlobUploadHeaders + headersMapper: Mappers.BlockBlobUploadHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlockBlobUploadExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobUploadExceptionHeaders } }, - requestBody: body1, - queryParameters: [timeoutInSeconds], - urlParameters: [url], + requestBody: Parameters.body1, + queryParameters: [Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - contentLength, - metadata, - 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 + Parameters.version, + Parameters.requestId, + Parameters.contentLength, + Parameters.metadata, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.blobCacheControl, + Parameters.blobContentType, + Parameters.blobContentMD5, + Parameters.blobContentEncoding, + Parameters.blobContentLanguage, + Parameters.blobContentDisposition, + Parameters.immutabilityPolicyExpiry, + Parameters.immutabilityPolicyMode, + Parameters.encryptionScope, + Parameters.tier, + Parameters.blobTagsString, + Parameters.legalHold1, + Parameters.transactionalContentMD5, + Parameters.transactionalContentCrc64, + Parameters.contentType1, + Parameters.accept2, + Parameters.blobType2 ], isXML: true, contentType: "application/xml; charset=utf-8", @@ -52425,51 +55234,52 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; httpMethod: "PUT", responses: { 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders + headersMapper: Mappers.BlockBlobPutBlobFromUrlHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobPutBlobFromUrlExceptionHeaders } }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - contentLength, - metadata, - 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 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.contentLength, + Parameters.metadata, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.blobCacheControl, + Parameters.blobContentType, + Parameters.blobContentMD5, + Parameters.blobContentEncoding, + Parameters.blobContentLanguage, + Parameters.blobContentDisposition, + Parameters.encryptionScope, + Parameters.tier, + Parameters.sourceIfModifiedSince, + Parameters.sourceIfUnmodifiedSince, + Parameters.sourceIfMatch, + Parameters.sourceIfNoneMatch, + Parameters.sourceIfTags, + Parameters.copySource, + Parameters.blobTagsString, + Parameters.sourceContentMD5, + Parameters.copySourceAuthorization, + Parameters.copySourceTags, + Parameters.fileRequestIntent, + Parameters.transactionalContentMD5, + Parameters.blobType2, + Parameters.copySourceBlobProperties ], isXML: true, serializer: xmlSerializer @@ -52479,33 +55289,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; httpMethod: "PUT", responses: { 201: { - headersMapper: BlockBlobStageBlockHeaders + headersMapper: Mappers.BlockBlobStageBlockHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobStageBlockExceptionHeaders } }, - requestBody: body1, + requestBody: Parameters.body1, queryParameters: [ - timeoutInSeconds, - comp24, - blockId + Parameters.timeoutInSeconds, + Parameters.comp24, + Parameters.blockId ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2 + Parameters.version, + Parameters.requestId, + Parameters.contentLength, + Parameters.leaseId, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.encryptionScope, + Parameters.transactionalContentMD5, + Parameters.transactionalContentCrc64, + Parameters.contentType1, + Parameters.accept2 ], isXML: true, contentType: "application/xml; charset=utf-8", @@ -52517,38 +55327,39 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; httpMethod: "PUT", responses: { 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders + headersMapper: Mappers.BlockBlobStageBlockFromURLHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobStageBlockFromURLExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - comp24, - blockId + Parameters.timeoutInSeconds, + Parameters.comp24, + Parameters.blockId ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - sourceUrl, - sourceContentCrc64, - sourceRange1 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.contentLength, + Parameters.leaseId, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.encryptionScope, + Parameters.sourceIfModifiedSince, + Parameters.sourceIfUnmodifiedSince, + Parameters.sourceIfMatch, + Parameters.sourceIfNoneMatch, + Parameters.sourceContentMD5, + Parameters.copySourceAuthorization, + Parameters.fileRequestIntent, + Parameters.sourceUrl, + Parameters.sourceContentCrc64, + Parameters.sourceRange1 ], isXML: true, serializer: xmlSerializer @@ -52558,45 +55369,45 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; httpMethod: "PUT", responses: { 201: { - headersMapper: BlockBlobCommitBlockListHeaders + headersMapper: Mappers.BlockBlobCommitBlockListHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobCommitBlockListExceptionHeaders } }, - requestBody: blocks, - queryParameters: [timeoutInSeconds, comp25], - urlParameters: [url], + requestBody: Parameters.blocks, + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp25], + urlParameters: [Parameters.url], headerParameters: [ - contentType, - accept, - version2, - requestId, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64 + Parameters.contentType, + Parameters.accept, + Parameters.version, + Parameters.requestId, + Parameters.metadata, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.encryptionKey, + Parameters.encryptionKeySha256, + Parameters.encryptionAlgorithm, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.blobCacheControl, + Parameters.blobContentType, + Parameters.blobContentMD5, + Parameters.blobContentEncoding, + Parameters.blobContentLanguage, + Parameters.blobContentDisposition, + Parameters.immutabilityPolicyExpiry, + Parameters.immutabilityPolicyMode, + Parameters.encryptionScope, + Parameters.tier, + Parameters.blobTagsString, + Parameters.legalHold1, + Parameters.transactionalContentMD5, + Parameters.transactionalContentCrc64 ], isXML: true, contentType: "application/xml; charset=utf-8", @@ -52608,44 +55419,72 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; httpMethod: "GET", responses: { 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders + bodyMapper: Mappers.BlockList, + headersMapper: Mappers.BlockBlobGetBlockListHeaders }, default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobGetBlockListExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - snapshot, - comp25, - listType + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.comp25, + Parameters.listType ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version2, - requestId, - accept1, - leaseId, - ifTags + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifTags ], isXML: true, serializer: xmlSerializer }; - var StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.ExtendedServiceClient { + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/index.js +var require_operations = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operations/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + tslib_1.__exportStar(require_service(), exports2); + tslib_1.__exportStar(require_container(), exports2); + tslib_1.__exportStar(require_blob(), exports2); + tslib_1.__exportStar(require_pageBlob(), exports2); + tslib_1.__exportStar(require_appendBlob(), exports2); + tslib_1.__exportStar(require_blockBlob(), exports2); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/storageClient.js +var require_storageClient = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/storageClient.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageClient = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var coreHttpCompat = tslib_1.__importStar(require_commonjs9()); + var index_js_1 = require_operations(); + var StorageClient = class extends coreHttpCompat.ExtendedServiceClient { static { __name(this, "StorageClient"); } + url; + version; /** * Initializes a new instance of the StorageClient 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 */ - constructor(url2, options) { - var _a, _b; - if (url2 === void 0) { + constructor(url, options) { + if (url === void 0) { throw new Error("'url' cannot be null"); } if (!options) { @@ -52654,76 +55493,221 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const defaults = { requestContentType: "application/json; charset=utf-8" }; - const packageDetails = `azsdk-js-azure-storage-blob/12.25.0`; + const packageDetails = `azsdk-js-azure-storage-blob/12.29.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: { - userAgentPrefix - }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{url}" }); + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + endpoint: options.endpoint ?? options.baseUri ?? "{url}" + }; super(optionsWithDefaults); - this.url = url2; - this.version = options.version || "2024-11-04"; - this.service = new ServiceImpl(this); - this.container = new ContainerImpl(this); - this.blob = new BlobImpl(this); - this.pageBlob = new PageBlobImpl(this); - this.appendBlob = new AppendBlobImpl(this); - this.blockBlob = new BlockBlobImpl(this); + this.url = url; + this.version = options.version || "2025-11-05"; + this.service = new index_js_1.ServiceImpl(this); + this.container = new index_js_1.ContainerImpl(this); + this.blob = new index_js_1.BlobImpl(this); + this.pageBlob = new index_js_1.PageBlobImpl(this); + this.appendBlob = new index_js_1.AppendBlobImpl(this); + this.blockBlob = new index_js_1.BlockBlobImpl(this); } + service; + container; + blob; + pageBlob; + appendBlob; + blockBlob; }; - var StorageContextClient = class extends StorageClient$1 { + exports2.StorageClient = StorageClient; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/service.js +var require_service2 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/service.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/container.js +var require_container2 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/container.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/blob.js +var require_blob2 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/blob.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/pageBlob.js +var require_pageBlob2 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/pageBlob.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/appendBlob.js +var require_appendBlob2 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/appendBlob.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/blockBlob.js +var require_blockBlob2 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/blockBlob.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/index.js +var require_operationsInterfaces = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/operationsInterfaces/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + tslib_1.__exportStar(require_service2(), exports2); + tslib_1.__exportStar(require_container2(), exports2); + tslib_1.__exportStar(require_blob2(), exports2); + tslib_1.__exportStar(require_pageBlob2(), exports2); + tslib_1.__exportStar(require_appendBlob2(), exports2); + tslib_1.__exportStar(require_blockBlob2(), exports2); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generated/src/index.js +var require_src2 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generated/src/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageClient = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + tslib_1.__exportStar(require_models(), exports2); + var storageClient_js_1 = require_storageClient(); + Object.defineProperty(exports2, "StorageClient", { enumerable: true, get: function() { + return storageClient_js_1.StorageClient; + } }); + tslib_1.__exportStar(require_operationsInterfaces(), exports2); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/StorageContextClient.js +var require_StorageContextClient = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/StorageContextClient.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageContextClient = void 0; + var index_js_1 = require_src2(); + var StorageContextClient = class extends index_js_1.StorageClient { static { __name(this, "StorageContextClient"); } async sendOperationRequest(operationArguments, operationSpec) { - const operationSpecToSend = Object.assign({}, operationSpec); + const operationSpecToSend = { ...operationSpec }; if (operationSpecToSend.path === "/{containerName}" || operationSpecToSend.path === "/{containerName}/{blob}") { operationSpecToSend.path = ""; } return super.sendOperationRequest(operationArguments, operationSpecToSend); } }; + exports2.StorageContextClient = StorageContextClient; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/StorageClient.js +var require_StorageClient = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/StorageClient.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageClient = void 0; + var StorageContextClient_js_1 = require_StorageContextClient(); + var Pipeline_js_1 = require_Pipeline(); + var utils_common_js_1 = require_utils_common(); var StorageClient = class { static { __name(this, "StorageClient"); } + /** + * Encoded URL string value. + */ + url; + accountName; + /** + * Request policy pipeline. + * + * @internal + */ + pipeline; + /** + * 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. + */ + credential; + /** + * StorageClient is a reference to protocol layer operations entry, which is + * generated by AutoRest generator. + */ + storageClientContext; + /** + */ + isHttps; /** * Creates an instance of StorageClient. * @param url - url to resource * @param pipeline - request policy pipeline. */ - constructor(url2, pipeline) { - this.url = escapeURLPath(url2); - this.accountName = getAccountNameFromUrl(url2); + constructor(url, pipeline) { + this.url = (0, utils_common_js_1.escapeURLPath)(url); + this.accountName = (0, utils_common_js_1.getAccountNameFromUrl)(url); this.pipeline = pipeline; - this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline)); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = getCredentialFromPipeline(pipeline); + this.storageClientContext = new StorageContextClient_js_1.StorageContextClient(this.url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + this.isHttps = (0, utils_common_js_1.iEqual)((0, utils_common_js_1.getURLScheme)(this.url) || "", "https"); + this.credential = (0, Pipeline_js_1.getCredentialFromPipeline)(pipeline); const storageClientContext = this.storageClientContext; storageClientContext.requestContentType = void 0; } }; - var tracingClient = coreTracing.createTracingClient({ + exports2.StorageClient = StorageClient; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/tracing.js +var require_tracing = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/utils/tracing.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.tracingClient = void 0; + var core_tracing_1 = require_commonjs5(); + var constants_js_1 = require_constants10(); + exports2.tracingClient = (0, core_tracing_1.createTracingClient)({ packageName: "@azure/storage-blob", - packageVersion: SDK_VERSION, + packageVersion: constants_js_1.SDK_VERSION, namespace: "Microsoft.Storage" }); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/sas/BlobSASPermissions.js +var require_BlobSASPermissions = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/sas/BlobSASPermissions.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BlobSASPermissions = void 0; var BlobSASPermissions = class _BlobSASPermissions { static { __name(this, "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. @@ -52816,6 +55800,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } return blobSASPermissions; } + /** + * Specifies Read access granted. + */ + read = false; + /** + * Specifies Add access granted. + */ + add = false; + /** + * Specifies Create access granted. + */ + create = false; + /** + * Specifies Write access granted. + */ + write = false; + /** + * Specifies Delete access granted. + */ + delete = false; + /** + * Specifies Delete version access granted. + */ + deleteVersion = false; + /** + * Specfies Tag access granted. + */ + tag = false; + /** + * Specifies Move access granted. + */ + move = false; + /** + * Specifies Execute access granted. + */ + execute = false; + /** + * Specifies SetImmutabilityPolicy access granted. + */ + setImmutabilityPolicy = false; + /** + * Specifies that Permanent Delete is permitted. + */ + permanentDelete = false; /** * Converts the given permissions to a string. Using this method will guarantee the permissions are in an * order accepted by the service. @@ -52860,25 +55888,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return permissions.join(""); } }; + exports2.BlobSASPermissions = BlobSASPermissions; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/sas/ContainerSASPermissions.js +var require_ContainerSASPermissions = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/sas/ContainerSASPermissions.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ContainerSASPermissions = void 0; var ContainerSASPermissions = class _ContainerSASPermissions { static { __name(this, "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; - } /** * 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. @@ -52983,12 +56006,64 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } return containerSASPermissions; } + /** + * Specifies Read access granted. + */ + read = false; + /** + * Specifies Add access granted. + */ + add = false; + /** + * Specifies Create access granted. + */ + create = false; + /** + * Specifies Write access granted. + */ + write = false; + /** + * Specifies Delete access granted. + */ + delete = false; + /** + * Specifies Delete version access granted. + */ + deleteVersion = false; + /** + * Specifies List access granted. + */ + list = false; + /** + * Specfies Tag access granted. + */ + tag = false; + /** + * Specifies Move access granted. + */ + move = false; + /** + * Specifies Execute access granted. + */ + execute = false; + /** + * Specifies SetImmutabilityPolicy access granted. + */ + setImmutabilityPolicy = false; + /** + * Specifies that Permanent Delete is permitted. + */ + permanentDelete = false; + /** + * Specifies that Filter Blobs by Tags is permitted. + */ + filterByTags = false; /** * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas * */ toString() { @@ -53035,10 +56110,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return permissions.join(""); } }; + exports2.ContainerSASPermissions = ContainerSASPermissions; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/credentials/UserDelegationKeyCredential.js +var require_UserDelegationKeyCredential = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/credentials/UserDelegationKeyCredential.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.UserDelegationKeyCredential = void 0; + var node_crypto_1 = require("node:crypto"); var UserDelegationKeyCredential = class { static { __name(this, "UserDelegationKeyCredential"); } + /** + * Azure Storage account name; readonly. + */ + accountName; + /** + * Azure Storage user delegation key; readonly. + */ + userDelegationKey; + /** + * Key value in Buffer type. + */ + key; /** * Creates an instance of UserDelegationKeyCredential. * @param accountName - @@ -53055,22 +56153,160 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param stringToSign - */ computeHMACSHA256(stringToSign) { - return crypto4.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64"); + return (0, node_crypto_1.createHmac)("sha256", this.key).update(stringToSign, "utf8").digest("base64"); } }; + exports2.UserDelegationKeyCredential = UserDelegationKeyCredential; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/sas/SasIPRange.js +var require_SasIPRange = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/sas/SasIPRange.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ipRangeToString = ipRangeToString; function ipRangeToString(ipRange) { return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; } __name(ipRangeToString, "ipRangeToString"); - exports2.SASProtocol = void 0; - (function(SASProtocol) { - SASProtocol["Https"] = "https"; - SASProtocol["HttpsAndHttp"] = "https,http"; - })(exports2.SASProtocol || (exports2.SASProtocol = {})); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/sas/SASQueryParameters.js +var require_SASQueryParameters = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/sas/SASQueryParameters.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SASQueryParameters = exports2.SASProtocol = void 0; + var SasIPRange_js_1 = require_SasIPRange(); + var utils_common_js_1 = require_utils_common(); + var SASProtocol; + (function(SASProtocol2) { + SASProtocol2["Https"] = "https"; + SASProtocol2["HttpsAndHttp"] = "https,http"; + })(SASProtocol || (exports2.SASProtocol = SASProtocol = {})); var SASQueryParameters = class { static { __name(this, "SASQueryParameters"); } + /** + * The storage API version. + */ + version; + /** + * Optional. The allowed HTTP protocol(s). + */ + protocol; + /** + * Optional. The start time for this SAS token. + */ + startsOn; + /** + * Optional only when identifier is provided. The expiry time for this SAS token. + */ + expiresOn; + /** + * Optional only when identifier is provided. + * Please refer to {@link AccountSASPermissions}, {@link BlobSASPermissions}, or {@link ContainerSASPermissions} for + * more details. + */ + permissions; + /** + * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices} + * for more details. + */ + services; + /** + * Optional. The storage resource types being accessed (only for Account SAS). Please refer to + * {@link AccountSASResourceTypes} for more details. + */ + resourceTypes; + /** + * Optional. The signed identifier (only for {@link BlobSASSignatureValues}). + * + * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy + */ + identifier; + /** + * Optional. Encryption scope to use when sending requests authorized with this SAS URI. + */ + encryptionScope; + /** + * Optional. Specifies which resources are accessible via the SAS (only for {@link BlobSASSignatureValues}). + * @see https://learn.microsoft.com/rest/api/storageservices/create-service-sas#specifying-the-signed-resource-blob-service-only + */ + resource; + /** + * The signature for the SAS token. + */ + signature; + /** + * Value for cache-control header in Blob/File Service SAS. + */ + cacheControl; + /** + * Value for content-disposition header in Blob/File Service SAS. + */ + contentDisposition; + /** + * Value for content-encoding header in Blob/File Service SAS. + */ + contentEncoding; + /** + * Value for content-length header in Blob/File Service SAS. + */ + contentLanguage; + /** + * Value for content-type header in Blob/File Service SAS. + */ + contentType; + /** + * Inner value of getter ipRange. + */ + ipRangeInner; + /** + * The Azure Active Directory object ID in GUID format. + * Property of user delegation key. + */ + signedOid; + /** + * The Azure Active Directory tenant ID in GUID format. + * Property of user delegation key. + */ + signedTenantId; + /** + * The date-time the key is active. + * Property of user delegation key. + */ + signedStartsOn; + /** + * The date-time the key expires. + * Property of user delegation key. + */ + signedExpiresOn; + /** + * Abbreviation of the Azure Storage service that accepts the user delegation key. + * Property of user delegation key. + */ + signedService; + /** + * The service version that created the user delegation key. + * Property of user delegation key. + */ + signedVersion; + /** + * Authorized AAD Object ID in GUID format. The AAD Object ID of a user authorized by the owner of the User Delegation Key + * to perform the action granted by the SAS. The Azure Storage service will ensure that the owner of the user delegation key + * has the required permissions before granting access but no additional permission check for the user specified in + * this value will be performed. This is only used for User Delegation SAS. + */ + preauthorizedAgentObjectId; + /** + * A GUID value that will be logged in the storage diagnostic logs and can be used to correlate SAS generation with storage resource access. + * This is only used for User Delegation SAS. + */ + correlationId; /** * Optional. IP range allowed for this SAS. * @@ -53085,8 +56321,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } return void 0; } - constructor(version3, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { - this.version = version3; + constructor(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope) { + this.version = version; this.signature = signature; if (permissionsOrOptions !== void 0 && typeof permissionsOrOptions !== "string") { this.permissions = permissionsOrOptions.permissions; @@ -53117,19 +56353,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } else { this.services = services; this.resourceTypes = resourceTypes; - this.expiresOn = expiresOn2; + this.expiresOn = expiresOn; this.permissions = permissionsOrOptions; this.protocol = protocol; this.startsOn = startsOn; this.ipRangeInner = ipRange; - this.encryptionScope = encryptionScope2; + this.encryptionScope = encryptionScope; this.identifier = identifier; this.resource = resource; this.cacheControl = cacheControl; this.contentDisposition = contentDisposition; this.contentEncoding = contentEncoding; this.contentLanguage = contentLanguage; - this.contentType = contentType2; + this.contentType = contentType; if (userDelegationKey) { this.signedOid = userDelegationKey.signedObjectId; this.signedTenantId = userDelegationKey.signedTenantId; @@ -53196,13 +56432,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.tryAppendQueryParameter(queries, param, this.protocol); break; case "st": - this.tryAppendQueryParameter(queries, param, this.startsOn ? truncatedISO8061Date(this.startsOn, false) : void 0); + this.tryAppendQueryParameter(queries, param, this.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(this.startsOn, false) : void 0); break; case "se": - this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : void 0); + this.tryAppendQueryParameter(queries, param, this.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(this.expiresOn, false) : void 0); break; case "sip": - this.tryAppendQueryParameter(queries, param, this.ipRange ? ipRangeToString(this.ipRange) : void 0); + this.tryAppendQueryParameter(queries, param, this.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(this.ipRange) : void 0); break; case "si": this.tryAppendQueryParameter(queries, param, this.identifier); @@ -53217,10 +56453,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.tryAppendQueryParameter(queries, param, this.signedTenantId); break; case "skt": - this.tryAppendQueryParameter(queries, param, this.signedStartsOn ? truncatedISO8061Date(this.signedStartsOn, false) : void 0); + this.tryAppendQueryParameter(queries, param, this.signedStartsOn ? (0, utils_common_js_1.truncatedISO8061Date)(this.signedStartsOn, false) : void 0); break; case "ske": - this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? truncatedISO8061Date(this.signedExpiresOn, false) : void 0); + this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(this.signedExpiresOn, false) : void 0); break; case "sks": this.tryAppendQueryParameter(queries, param, this.signedService); @@ -53280,39 +56516,62 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; + exports2.SASQueryParameters = SASQueryParameters; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/sas/BlobSASSignatureValues.js +var require_BlobSASSignatureValues = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/sas/BlobSASSignatureValues.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.generateBlobSASQueryParameters = generateBlobSASQueryParameters; + exports2.generateBlobSASQueryParametersInternal = generateBlobSASQueryParametersInternal; + var BlobSASPermissions_js_1 = require_BlobSASPermissions(); + var ContainerSASPermissions_js_1 = require_ContainerSASPermissions(); + var StorageSharedKeyCredential_js_1 = require_StorageSharedKeyCredential(); + var UserDelegationKeyCredential_js_1 = require_UserDelegationKeyCredential(); + var SasIPRange_js_1 = require_SasIPRange(); + var SASQueryParameters_js_1 = require_SASQueryParameters(); + var constants_js_1 = require_constants10(); + var utils_common_js_1 = require_utils_common(); function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; } __name(generateBlobSASQueryParameters, "generateBlobSASQueryParameters"); function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version3 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; + const version = blobSASSignatureValues.version ? blobSASSignatureValues.version : constants_js_1.SERVICE_VERSION; + const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; let userDelegationKeyCredential; if (sharedKeyCredential === void 0 && accountName !== void 0) { - userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); + userDelegationKeyCredential = new UserDelegationKeyCredential_js_1.UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); } if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); } - if (version3 >= "2020-12-06") { + if (version >= "2020-12-06") { if (sharedKeyCredential !== void 0) { return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); } else { - return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); + if (version >= "2025-07-05") { + return generateBlobSASQueryParametersUDK20250705(blobSASSignatureValues, userDelegationKeyCredential); + } else { + return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); + } } } - if (version3 >= "2018-11-09") { + if (version >= "2018-11-09") { if (sharedKeyCredential !== void 0) { return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); } else { - if (version3 >= "2020-02-10") { + if (version >= "2020-02-10") { return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); } else { return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); } } } - if (version3 >= "2015-04-05") { + if (version >= "2015-04-05") { if (sharedKeyCredential !== void 0) { return generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential); } else { @@ -53334,18 +56593,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; let verifiedPermissions; if (blobSASSignatureValues.permissions) { if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + verifiedPermissions = BlobSASPermissions_js_1.BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + verifiedPermissions = ContainerSASPermissions_js_1.ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); } } const stringToSign = [ verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", + blobSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.startsOn, false) : "", + blobSASSignatureValues.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.expiresOn, false) : "", getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", + blobSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(blobSASSignatureValues.ipRange) : "", blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", blobSASSignatureValues.version, blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "", @@ -53356,7 +56615,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ].join("\n"); const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: 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), + sasQueryParameters: new SASQueryParameters_js_1.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), stringToSign }; } @@ -53380,18 +56639,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; let verifiedPermissions; if (blobSASSignatureValues.permissions) { if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + verifiedPermissions = BlobSASPermissions_js_1.BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + verifiedPermissions = ContainerSASPermissions_js_1.ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); } } const stringToSign = [ verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", + blobSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.startsOn, false) : "", + blobSASSignatureValues.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.expiresOn, false) : "", getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", + blobSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(blobSASSignatureValues.ipRange) : "", blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", blobSASSignatureValues.version, resource, @@ -53404,7 +56663,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ].join("\n"); const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: 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), + sasQueryParameters: new SASQueryParameters_js_1.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), stringToSign }; } @@ -53428,18 +56687,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; let verifiedPermissions; if (blobSASSignatureValues.permissions) { if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + verifiedPermissions = BlobSASPermissions_js_1.BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + verifiedPermissions = ContainerSASPermissions_js_1.ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); } } const stringToSign = [ verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", + blobSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.startsOn, false) : "", + blobSASSignatureValues.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.expiresOn, false) : "", getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", + blobSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(blobSASSignatureValues.ipRange) : "", blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", blobSASSignatureValues.version, resource, @@ -53453,7 +56712,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ].join("\n"); const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: 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), + sasQueryParameters: new SASQueryParameters_js_1.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), stringToSign }; } @@ -53477,23 +56736,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; let verifiedPermissions; if (blobSASSignatureValues.permissions) { if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + verifiedPermissions = BlobSASPermissions_js_1.BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + verifiedPermissions = ContainerSASPermissions_js_1.ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); } } const stringToSign = [ verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", + blobSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.startsOn, false) : "", + blobSASSignatureValues.expiresOn ? (0, utils_common_js_1.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.signedStartsOn ? (0, utils_common_js_1.truncatedISO8061Date)(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", + userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", userDelegationKeyCredential.userDelegationKey.signedService, userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", + blobSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(blobSASSignatureValues.ipRange) : "", blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", blobSASSignatureValues.version, resource, @@ -53506,7 +56765,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ].join("\n"); const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: 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), + sasQueryParameters: new SASQueryParameters_js_1.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), stringToSign }; } @@ -53530,27 +56789,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; let verifiedPermissions; if (blobSASSignatureValues.permissions) { if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + verifiedPermissions = BlobSASPermissions_js_1.BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + verifiedPermissions = ContainerSASPermissions_js_1.ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); } } const stringToSign = [ verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", + blobSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.startsOn, false) : "", + blobSASSignatureValues.expiresOn ? (0, utils_common_js_1.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.signedStartsOn ? (0, utils_common_js_1.truncatedISO8061Date)(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", + userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", userDelegationKeyCredential.userDelegationKey.signedService, userDelegationKeyCredential.userDelegationKey.signedVersion, blobSASSignatureValues.preauthorizedAgentObjectId, void 0, // agentObjectId blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", + blobSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(blobSASSignatureValues.ipRange) : "", blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", blobSASSignatureValues.version, resource, @@ -53563,7 +56822,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ].join("\n"); const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: 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), + sasQueryParameters: new SASQueryParameters_js_1.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), stringToSign }; } @@ -53587,27 +56846,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; let verifiedPermissions; if (blobSASSignatureValues.permissions) { if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + verifiedPermissions = BlobSASPermissions_js_1.BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + verifiedPermissions = ContainerSASPermissions_js_1.ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); } } const stringToSign = [ verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", + blobSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.startsOn, false) : "", + blobSASSignatureValues.expiresOn ? (0, utils_common_js_1.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.signedStartsOn ? (0, utils_common_js_1.truncatedISO8061Date)(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", + userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", userDelegationKeyCredential.userDelegationKey.signedService, userDelegationKeyCredential.userDelegationKey.signedVersion, blobSASSignatureValues.preauthorizedAgentObjectId, void 0, // agentObjectId blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", + blobSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(blobSASSignatureValues.ipRange) : "", blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", blobSASSignatureValues.version, resource, @@ -53621,11 +56880,73 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ].join("\n"); const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: 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), + sasQueryParameters: new SASQueryParameters_js_1.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), stringToSign }; } __name(generateBlobSASQueryParametersUDK20201206, "generateBlobSASQueryParametersUDK20201206"); + function generateBlobSASQueryParametersUDK20250705(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_js_1.BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + } else { + verifiedPermissions = ContainerSASPermissions_js_1.ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + } + } + const stringToSign = [ + verifiedPermissions ? verifiedPermissions : "", + blobSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.startsOn, false) : "", + blobSASSignatureValues.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(blobSASSignatureValues.expiresOn, false) : "", + getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), + userDelegationKeyCredential.userDelegationKey.signedObjectId, + userDelegationKeyCredential.userDelegationKey.signedTenantId, + userDelegationKeyCredential.userDelegationKey.signedStartsOn ? (0, utils_common_js_1.truncatedISO8061Date)(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", + userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", + userDelegationKeyCredential.userDelegationKey.signedService, + userDelegationKeyCredential.userDelegationKey.signedVersion, + blobSASSignatureValues.preauthorizedAgentObjectId, + void 0, + // agentObjectId + blobSASSignatureValues.correlationId, + void 0, + // SignedKeyDelegatedUserTenantId, will be added in a future release. + void 0, + // SignedDelegatedUserObjectId, will be added in future release. + blobSASSignatureValues.ipRange ? (0, SasIPRange_js_1.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 { + sasQueryParameters: new SASQueryParameters_js_1.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), + stringToSign + }; + } + __name(generateBlobSASQueryParametersUDK20250705, "generateBlobSASQueryParametersUDK20250705"); function getCanonicalName(accountName, containerName, blobName) { const elements = [`/blob/${accountName}/${containerName}`]; if (blobName) { @@ -53635,51 +56956,68 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } __name(getCanonicalName, "getCanonicalName"); function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) { - const version3 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version3 < "2018-11-09") { + const version = blobSASSignatureValues.version ? blobSASSignatureValues.version : constants_js_1.SERVICE_VERSION; + if (blobSASSignatureValues.snapshotTime && version < "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 && version3 < "2019-10-10") { + if (blobSASSignatureValues.versionId && version < "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 && version3 < "2020-08-04") { + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version < "2020-08-04") { throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version3 < "2019-10-10") { + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version < "2019-10-10") { throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version3 < "2019-10-10") { + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version < "2019-10-10") { throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version3 < "2019-12-12") { + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version < "2019-12-12") { throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); } - if (version3 < "2020-02-10" && blobSASSignatureValues.permissions && (blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) { + if (version < "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 (version3 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { + if (version < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); } - if (version3 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { + if (version < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); } - if (blobSASSignatureValues.encryptionScope && version3 < "2020-12-06") { + if (blobSASSignatureValues.encryptionScope && version < "2020-12-06") { throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); } - blobSASSignatureValues.version = version3; + blobSASSignatureValues.version = version; return blobSASSignatureValues; } __name(SASSignatureValuesSanityCheckAndAutofill, "SASSignatureValuesSanityCheckAndAutofill"); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/BlobLeaseClient.js +var require_BlobLeaseClient = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/BlobLeaseClient.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BlobLeaseClient = void 0; + var core_util_1 = require_commonjs4(); + var constants_js_1 = require_constants10(); + var tracing_js_1 = require_tracing(); + var utils_common_js_1 = require_utils_common(); var BlobLeaseClient = class { static { __name(this, "BlobLeaseClient"); } + _leaseId; + _url; + _containerOrBlobOperation; + _isContainer; /** * Gets the lease Id. * @@ -53701,7 +57039,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param client - The client to make the lease operation requests. * @param leaseId - Initial proposed lease id. */ - constructor(client, leaseId2) { + constructor(client, leaseId) { const clientContext = client.storageClientContext; this._url = client.url; if (client.name === void 0) { @@ -53711,34 +57049,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this._isContainer = false; this._containerOrBlobOperation = clientContext.blob; } - if (!leaseId2) { - leaseId2 = coreUtil.randomUUID(); + if (!leaseId) { + leaseId = (0, core_util_1.randomUUID)(); } - this._leaseId = leaseId2; + this._leaseId = leaseId; } /** * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/lease-container * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * @see https://learn.microsoft.com/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 _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.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 || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { + async acquireLease(duration, options = {}) { + if (this._isContainer && (options.conditions?.ifMatch && options.conditions?.ifMatch !== constants_js_1.ETagNone || options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== constants_js_1.ETagNone || options.conditions?.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."); } - return tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.acquireLease({ + return tracing_js_1.tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this._containerOrBlobOperation.acquireLease({ abortSignal: options.abortSignal, - duration: duration2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), + duration, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, proposedLeaseId: this._leaseId, tracingOptions: updatedOptions.tracingOptions })); @@ -53746,73 +57085,76 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * To change the ID of the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container + * @see https://learn.microsoft.com/rest/api/storageservices/lease-container * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * @see https://learn.microsoft.com/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 _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.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 || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { + async changeLease(proposedLeaseId, options = {}) { + if (this._isContainer && (options.conditions?.ifMatch && options.conditions?.ifMatch !== constants_js_1.ETagNone || options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== constants_js_1.ETagNone || options.conditions?.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."); } - return tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => { - var _a2; - const response = assertResponse(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId2, { + return tracing_js_1.tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => { + const response = (0, utils_common_js_1.assertResponse)(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId, { abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); - this._leaseId = proposedLeaseId2; + this._leaseId = proposedLeaseId; return response; }); } /** * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/lease-container * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob * * @param options - option to configure lease management operations. * @returns Response data for release lease operation. */ async releaseLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.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 || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { + if (this._isContainer && (options.conditions?.ifMatch && options.conditions?.ifMatch !== constants_js_1.ETagNone || options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== constants_js_1.ETagNone || options.conditions?.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."); } - return tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.releaseLease(this._leaseId, { + return tracing_js_1.tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this._containerOrBlobOperation.releaseLease(this._leaseId, { abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); } /** * To renew the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container + * @see https://learn.microsoft.com/rest/api/storageservices/lease-container * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * @see https://learn.microsoft.com/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 _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.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 || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { + if (this._isContainer && (options.conditions?.ifMatch && options.conditions?.ifMatch !== constants_js_1.ETagNone || options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== constants_js_1.ETagNone || options.conditions?.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."); } - return tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => { - var _a2; + return tracing_js_1.tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => { return this._containerOrBlobOperation.renewLease(this._leaseId, { abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions }); }); @@ -53820,35 +57162,57 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/lease-container * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * @see https://learn.microsoft.com/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 _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.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 || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { + async breakLease(breakPeriod, options = {}) { + if (this._isContainer && (options.conditions?.ifMatch && options.conditions?.ifMatch !== constants_js_1.ETagNone || options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== constants_js_1.ETagNone || options.conditions?.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."); } - return tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => { - var _a2; + return tracing_js_1.tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => { const operationOptions = { abortSignal: options.abortSignal, - breakPeriod: breakPeriod2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), + breakPeriod, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions }; - return assertResponse(await this._containerOrBlobOperation.breakLease(operationOptions)); + return (0, utils_common_js_1.assertResponse)(await this._containerOrBlobOperation.breakLease(operationOptions)); }); } }; - var RetriableReadableStream = class extends stream.Readable { + exports2.BlobLeaseClient = BlobLeaseClient; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/RetriableReadableStream.js +var require_RetriableReadableStream = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/utils/RetriableReadableStream.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.RetriableReadableStream = void 0; + var abort_controller_1 = require_commonjs11(); + var node_stream_1 = require("node:stream"); + var RetriableReadableStream = class extends node_stream_1.Readable { static { __name(this, "RetriableReadableStream"); } + start; + offset; + end; + getter; + source; + retries = 0; + maxRetryRequests; + onProgress; + options; /** * Creates an instance of RetriableReadableStream. * @@ -53861,52 +57225,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ 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.sourceErrorOrEndHandler(); - this.source.destroy(); - return; - } - this.offset += data.length; - if (this.onProgress) { - this.onProgress({ loadedBytes: this.offset - this.start }); - } - if (!this.push(data)) { - this.source.pause(); - } - }; - this.sourceAbortedHandler = () => { - const abortError = new abortController.AbortError("The operation was aborted."); - this.destroy(abortError); - }; - 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; @@ -53932,12 +57250,69 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.source.removeListener("error", this.sourceErrorOrEndHandler); this.source.removeListener("aborted", this.sourceAbortedHandler); } + sourceDataHandler = (data) => { + if (this.options.doInjectErrorOnce) { + this.options.doInjectErrorOnce = void 0; + this.source.pause(); + this.sourceErrorOrEndHandler(); + this.source.destroy(); + return; + } + this.offset += data.length; + if (this.onProgress) { + this.onProgress({ loadedBytes: this.offset - this.start }); + } + if (!this.push(data)) { + this.source.pause(); + } + }; + sourceAbortedHandler = () => { + const abortError = new abort_controller_1.AbortError("The operation was aborted."); + this.destroy(abortError); + }; + 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}`)); + } + }; _destroy(error, callback) { this.removeSourceEventHandlers(); this.source.destroy(); callback(error === null ? void 0 : error); } }; + exports2.RetriableReadableStream = RetriableReadableStream; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/BlobDownloadResponse.js +var require_BlobDownloadResponse = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/BlobDownloadResponse.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BlobDownloadResponse = void 0; + var core_util_1 = require_commonjs4(); + var RetriableReadableStream_js_1 = require_RetriableReadableStream(); var BlobDownloadResponse = class { static { __name(this, "BlobDownloadResponse"); @@ -54367,7 +57742,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @readonly */ get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + return core_util_1.isNodeLike ? this.blobDownloadStream : void 0; } /** * The HTTP response. @@ -54375,6 +57750,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get _response() { return this.originalResponse._response; } + originalResponse; + blobDownloadStream; /** * Creates an instance of BlobDownloadResponse. * @@ -54386,13 +57763,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ constructor(originalResponse, getter, offset, count, options = {}) { this.originalResponse = originalResponse; - this.blobDownloadStream = new RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); + this.blobDownloadStream = new RetriableReadableStream_js_1.RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); } }; - var AVRO_SYNC_MARKER_SIZE = 16; - var AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); - var AVRO_CODEC_KEY = "avro.codec"; - var AVRO_SCHEMA_KEY = "avro.schema"; + exports2.BlobDownloadResponse = BlobDownloadResponse; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroConstants.js +var require_AvroConstants = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroConstants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AVRO_SCHEMA_KEY = exports2.AVRO_CODEC_KEY = exports2.AVRO_INIT_BYTES = exports2.AVRO_SYNC_MARKER_SIZE = void 0; + exports2.AVRO_SYNC_MARKER_SIZE = 16; + exports2.AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); + exports2.AVRO_CODEC_KEY = "avro.codec"; + exports2.AVRO_SCHEMA_KEY = "avro.schema"; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroParser.js +var require_AvroParser = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroParser.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AvroType = exports2.AvroParser = void 0; var AvroParser = class _AvroParser { static { __name(this, "AvroParser"); @@ -54404,8 +57800,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param length - * @param options - */ - static async readFixedBytes(stream2, length, options = {}) { - const bytes = await stream2.read(length, { abortSignal: options.abortSignal }); + 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."); } @@ -54417,19 +57813,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param stream - * @param options - */ - static async readByte(stream2, options = {}) { - const buf = await _AvroParser.readFixedBytes(stream2, 1, 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(stream2, options = {}) { + static async readZigZagLong(stream, options = {}) { let zigZagEncoded = 0; let significanceInBit = 0; let byte, haveMoreByte, significanceInFloat; do { - byte = await _AvroParser.readByte(stream2, options); + byte = await _AvroParser.readByte(stream, options); haveMoreByte = byte & 128; zigZagEncoded |= (byte & 127) << significanceInBit; significanceInBit += 7; @@ -54438,7 +57834,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; zigZagEncoded = zigZagEncoded; significanceInFloat = 268435456; do { - byte = await _AvroParser.readByte(stream2, options); + byte = await _AvroParser.readByte(stream, options); zigZagEncoded += (byte & 127) * significanceInFloat; significanceInFloat *= 128; } while (byte & 128); @@ -54450,17 +57846,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } return zigZagEncoded >> 1 ^ -(zigZagEncoded & 1); } - static async readLong(stream2, options = {}) { - return _AvroParser.readZigZagLong(stream2, options); + static async readLong(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); } - static async readInt(stream2, options = {}) { - return _AvroParser.readZigZagLong(stream2, options); + static async readInt(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); } static async readNull() { return null; } - static async readBoolean(stream2, options = {}) { - const b = await _AvroParser.readByte(stream2, options); + static async readBoolean(stream, options = {}) { + const b = await _AvroParser.readByte(stream, options); if (b === 1) { return true; } else if (b === 0) { @@ -54469,59 +57865,60 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Byte was not a boolean."); } } - static async readFloat(stream2, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream2, 4, options); + 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(stream2, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream2, 8, options); + 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(stream2, options = {}) { - const size = await _AvroParser.readLong(stream2, options); + static async readBytes(stream, options = {}) { + const size = await _AvroParser.readLong(stream, options); if (size < 0) { throw new Error("Bytes size was negative."); } - return stream2.read(size, { abortSignal: options.abortSignal }); + return stream.read(size, { abortSignal: options.abortSignal }); } - static async readString(stream2, options = {}) { - const u8arr = await _AvroParser.readBytes(stream2, options); + static async readString(stream, options = {}) { + const u8arr = await _AvroParser.readBytes(stream, options); const utf8decoder = new TextDecoder(); return utf8decoder.decode(u8arr); } - static async readMapPair(stream2, readItemMethod, options = {}) { - const key = await _AvroParser.readString(stream2, options); - const value = await readItemMethod(stream2, options); + 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(stream2, readItemMethod, options = {}) { + static async readMap(stream, readItemMethod, options = {}) { const readPairMethod = /* @__PURE__ */ __name((s, opts = {}) => { return _AvroParser.readMapPair(s, readItemMethod, opts); }, "readPairMethod"); - const pairs = await _AvroParser.readArray(stream2, readPairMethod, options); + 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(stream2, readItemMethod, options = {}) { + static async readArray(stream, readItemMethod, options = {}) { const items = []; - for (let count = await _AvroParser.readLong(stream2, options); count !== 0; count = await _AvroParser.readLong(stream2, options)) { + for (let count = await _AvroParser.readLong(stream, options); count !== 0; count = await _AvroParser.readLong(stream, options)) { if (count < 0) { - await _AvroParser.readLong(stream2, options); + await _AvroParser.readLong(stream, options); count = -count; } while (count--) { - const item = await readItemMethod(stream2, options); + const item = await readItemMethod(stream, options); items.push(item); } } return items; } }; + exports2.AvroParser = AvroParser; var AvroComplex; (function(AvroComplex2) { AvroComplex2["RECORD"] = "record"; @@ -54581,7 +57978,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const type = schema.type; try { return _AvroType.fromStringSchema(type); - } catch (_a) { + } catch { } switch (type) { case AvroComplex.RECORD: @@ -54619,33 +58016,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; + exports2.AvroType = AvroType; var AvroPrimitiveType = class extends AvroType { static { __name(this, "AvroPrimitiveType"); } + _primitive; constructor(primitive) { super(); this._primitive = primitive; } // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream2, options = {}) { + read(stream, options = {}) { switch (this._primitive) { case AvroPrimitive.NULL: return AvroParser.readNull(); case AvroPrimitive.BOOLEAN: - return AvroParser.readBoolean(stream2, options); + return AvroParser.readBoolean(stream, options); case AvroPrimitive.INT: - return AvroParser.readInt(stream2, options); + return AvroParser.readInt(stream, options); case AvroPrimitive.LONG: - return AvroParser.readLong(stream2, options); + return AvroParser.readLong(stream, options); case AvroPrimitive.FLOAT: - return AvroParser.readFloat(stream2, options); + return AvroParser.readFloat(stream, options); case AvroPrimitive.DOUBLE: - return AvroParser.readDouble(stream2, options); + return AvroParser.readDouble(stream, options); case AvroPrimitive.BYTES: - return AvroParser.readBytes(stream2, options); + return AvroParser.readBytes(stream, options); case AvroPrimitive.STRING: - return AvroParser.readString(stream2, options); + return AvroParser.readString(stream, options); default: throw new Error("Unknown Avro Primitive"); } @@ -54655,13 +58054,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; static { __name(this, "AvroEnumType"); } + _symbols; constructor(symbols) { super(); this._symbols = symbols; } // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream2, options = {}) { - const value = await AvroParser.readInt(stream2, options); + async read(stream, options = {}) { + const value = await AvroParser.readInt(stream, options); return this._symbols[value]; } }; @@ -54669,52 +58069,65 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; static { __name(this, "AvroUnionType"); } + _types; constructor(types) { super(); this._types = types; } - async read(stream2, options = {}) { - const typeIndex = await AvroParser.readInt(stream2, options); - return this._types[typeIndex].read(stream2, options); + async read(stream, options = {}) { + const typeIndex = await AvroParser.readInt(stream, options); + return this._types[typeIndex].read(stream, options); } }; var AvroMapType = class extends AvroType { static { __name(this, "AvroMapType"); } + _itemType; constructor(itemType) { super(); this._itemType = itemType; } // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream2, options = {}) { + read(stream, options = {}) { const readItemMethod = /* @__PURE__ */ __name((s, opts) => { return this._itemType.read(s, opts); }, "readItemMethod"); - return AvroParser.readMap(stream2, readItemMethod, options); + return AvroParser.readMap(stream, readItemMethod, options); } }; var AvroRecordType = class extends AvroType { static { __name(this, "AvroRecordType"); } + _name; + _fields; constructor(fields, name) { super(); this._fields = fields; this._name = name; } // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream2, options = {}) { + 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(stream2, options); + record[key] = await this._fields[key].read(stream, options); } } return record; } }; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/internal-avro/utils/utils.common.js +var require_utils_common3 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/internal-avro/utils/utils.common.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.arraysEqual = arraysEqual; function arraysEqual(a, b) { if (a === b) return true; @@ -54729,16 +58142,41 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return true; } __name(arraysEqual, "arraysEqual"); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroReader.js +var require_AvroReader = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroReader.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AvroReader = void 0; + var AvroConstants_js_1 = require_AvroConstants(); + var AvroParser_js_1 = require_AvroParser(); + var utils_common_js_1 = require_utils_common3(); var AvroReader = class { static { __name(this, "AvroReader"); } + _dataStream; + _headerStream; + _syncMarker; + _metadata; + _itemType; + _itemsRemainingInBlock; + // Remembers where we started if partial data stream was provided. + _initialBlockOffset; + /// The byte offset within the Avro file (both header and data) + /// of the start of the current block. + _blockOffset; get blockOffset() { return this._blockOffset; } + _objectIndex; get objectIndex() { return this._objectIndex; } + _initialized; constructor(dataStream, headerStream, currentBlockOffset, indexWithinCurrentBlock) { this._dataStream = dataStream; this._headerStream = headerStream || dataStream; @@ -54748,31 +58186,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this._initialBlockOffset = currentBlockOffset || 0; } async initialize(options = {}) { - const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { + const header = await AvroParser_js_1.AvroParser.readFixedBytes(this._headerStream, AvroConstants_js_1.AVRO_INIT_BYTES.length, { abortSignal: options.abortSignal }); - if (!arraysEqual(header, AVRO_INIT_BYTES)) { + if (!(0, utils_common_js_1.arraysEqual)(header, AvroConstants_js_1.AVRO_INIT_BYTES)) { throw new Error("Stream is not an Avro file."); } - this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, { + this._metadata = await AvroParser_js_1.AvroParser.readMap(this._headerStream, AvroParser_js_1.AvroParser.readString, { abortSignal: options.abortSignal }); - const codec = this._metadata[AVRO_CODEC_KEY]; + const codec = this._metadata[AvroConstants_js_1.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, { + this._syncMarker = await AvroParser_js_1.AvroParser.readFixedBytes(this._headerStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, { abortSignal: options.abortSignal }); - const schema = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); - this._itemType = AvroType.fromSchema(schema); + const schema = JSON.parse(this._metadata[AvroConstants_js_1.AVRO_SCHEMA_KEY]); + this._itemType = AvroParser_js_1.AvroType.fromSchema(schema); if (this._blockOffset === 0) { this._blockOffset = this._initialBlockOffset + this._dataStream.position; } - this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, { + this._itemsRemainingInBlock = await AvroParser_js_1.AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal }); - await AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal }); + await AvroParser_js_1.AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal }); this._initialized = true; if (this._objectIndex && this._objectIndex > 0) { for (let i = 0; i < this._objectIndex; i++) { @@ -54784,55 +58222,78 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; hasNext() { return !this._initialized || this._itemsRemainingInBlock > 0; } - parseObjects() { - return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* parseObjects_1(options = {}) { - if (!this._initialized) { - yield tslib.__await(this.initialize(options)); - } - while (this.hasNext()) { - const result = yield tslib.__await(this._itemType.read(this._dataStream, { + async *parseObjects(options = {}) { + if (!this._initialized) { + await this.initialize(options); + } + while (this.hasNext()) { + const result = await this._itemType.read(this._dataStream, { + abortSignal: options.abortSignal + }); + this._itemsRemainingInBlock--; + this._objectIndex++; + if (this._itemsRemainingInBlock === 0) { + const marker = await AvroParser_js_1.AvroParser.readFixedBytes(this._dataStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, { abortSignal: options.abortSignal - })); - this._itemsRemainingInBlock--; - this._objectIndex++; - if (this._itemsRemainingInBlock === 0) { - const marker2 = yield tslib.__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 tslib.__await(AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - })); - } catch (_a) { - this._itemsRemainingInBlock = 0; - } - if (this._itemsRemainingInBlock > 0) { - yield tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })); - } + }); + this._blockOffset = this._initialBlockOffset + this._dataStream.position; + this._objectIndex = 0; + if (!(0, utils_common_js_1.arraysEqual)(this._syncMarker, marker)) { + throw new Error("Stream is not a valid Avro file."); + } + try { + this._itemsRemainingInBlock = await AvroParser_js_1.AvroParser.readLong(this._dataStream, { + abortSignal: options.abortSignal + }); + } catch { + this._itemsRemainingInBlock = 0; + } + if (this._itemsRemainingInBlock > 0) { + await AvroParser_js_1.AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal }); } - yield yield tslib.__await(result); } - }, "parseObjects_1")); + yield result; + } } }; + exports2.AvroReader = AvroReader; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroReadable.js +var require_AvroReadable = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroReadable.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AvroReadable = void 0; var AvroReadable = class { static { __name(this, "AvroReadable"); } }; - var ABORT_ERROR = new abortController.AbortError("Reading from the avro stream was aborted."); - var AvroReadableFromStream = class extends AvroReadable { + exports2.AvroReadable = AvroReadable; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroReadableFromStream.js +var require_AvroReadableFromStream = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/internal-avro/AvroReadableFromStream.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AvroReadableFromStream = void 0; + var AvroReadable_js_1 = require_AvroReadable(); + var abort_controller_1 = require_commonjs11(); + var buffer_1 = require("buffer"); + var ABORT_ERROR = new abort_controller_1.AbortError("Reading from the avro stream was aborted."); + var AvroReadableFromStream = class extends AvroReadable_js_1.AvroReadable { static { __name(this, "AvroReadableFromStream"); } + _position; + _readable; toUint8Array(data) { if (typeof data === "string") { - return Buffer.from(data); + return buffer_1.Buffer.from(data); } return data; } @@ -54845,8 +58306,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this._position; } async read(size, options = {}) { - var _a; - if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { + if (options.abortSignal?.aborted) { throw ABORT_ERROR; } if (size < 0) { @@ -54900,10 +58360,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobQuickQueryStream = class extends stream.Readable { + exports2.AvroReadableFromStream = AvroReadableFromStream; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/internal-avro/index.js +var require_internal_avro = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/internal-avro/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AvroReadableFromStream = exports2.AvroReadable = exports2.AvroReader = void 0; + var AvroReader_js_1 = require_AvroReader(); + Object.defineProperty(exports2, "AvroReader", { enumerable: true, get: function() { + return AvroReader_js_1.AvroReader; + } }); + var AvroReadable_js_1 = require_AvroReadable(); + Object.defineProperty(exports2, "AvroReadable", { enumerable: true, get: function() { + return AvroReadable_js_1.AvroReadable; + } }); + var AvroReadableFromStream_js_1 = require_AvroReadableFromStream(); + Object.defineProperty(exports2, "AvroReadableFromStream", { enumerable: true, get: function() { + return AvroReadableFromStream_js_1.AvroReadableFromStream; + } }); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/BlobQuickQueryStream.js +var require_BlobQuickQueryStream = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/utils/BlobQuickQueryStream.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BlobQuickQueryStream = void 0; + var node_stream_1 = require("node:stream"); + var index_js_1 = require_internal_avro(); + var BlobQuickQueryStream = class extends node_stream_1.Readable { static { __name(this, "BlobQuickQueryStream"); } + source; + avroReader; + avroIter; + avroPaused = true; + onProgress; + onError; /** * Creates an instance of BlobQuickQueryStream. * @@ -54912,11 +58411,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ 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.avroReader = new index_js_1.AvroReader(new index_js_1.AvroReadableFromStream(this.source)); this.avroIter = this.avroReader.parseObjects({ abortSignal: options.abortSignal }); } _read() { @@ -55004,6 +58502,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } while (!avroNext.done && !this.avroPaused); } }; + exports2.BlobQuickQueryStream = BlobQuickQueryStream; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/BlobQueryResponse.js +var require_BlobQueryResponse = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/BlobQueryResponse.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BlobQueryResponse = void 0; + var core_util_1 = require_commonjs4(); + var BlobQuickQueryStream_js_1 = require_BlobQuickQueryStream(); var BlobQueryResponse = class { static { __name(this, "BlobQueryResponse"); @@ -55344,7 +58854,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @readonly */ get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + return core_util_1.isNodeLike ? this.blobDownloadStream : void 0; } /** * The HTTP response. @@ -55352,6 +58862,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get _response() { return this.originalResponse._response; } + originalResponse; + blobDownloadStream; /** * Creates an instance of BlobQueryResponse. * @@ -55360,35 +58872,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ constructor(originalResponse, options = {}) { this.originalResponse = originalResponse; - this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); + this.blobDownloadStream = new BlobQuickQueryStream_js_1.BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); } }; - exports2.BlockBlobTier = void 0; - (function(BlockBlobTier) { - BlockBlobTier["Hot"] = "Hot"; - BlockBlobTier["Cool"] = "Cool"; - BlockBlobTier["Cold"] = "Cold"; - BlockBlobTier["Archive"] = "Archive"; - })(exports2.BlockBlobTier || (exports2.BlockBlobTier = {})); - exports2.PremiumPageBlobTier = void 0; - (function(PremiumPageBlobTier) { - PremiumPageBlobTier["P4"] = "P4"; - PremiumPageBlobTier["P6"] = "P6"; - PremiumPageBlobTier["P10"] = "P10"; - PremiumPageBlobTier["P15"] = "P15"; - PremiumPageBlobTier["P20"] = "P20"; - PremiumPageBlobTier["P30"] = "P30"; - PremiumPageBlobTier["P40"] = "P40"; - PremiumPageBlobTier["P50"] = "P50"; - PremiumPageBlobTier["P60"] = "P60"; - PremiumPageBlobTier["P70"] = "P70"; - PremiumPageBlobTier["P80"] = "P80"; - })(exports2.PremiumPageBlobTier || (exports2.PremiumPageBlobTier = {})); - function toAccessTier(tier2) { - if (tier2 === void 0) { + exports2.BlobQueryResponse = BlobQueryResponse; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/models.js +var require_models2 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/models.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StorageBlobAudience = exports2.PremiumPageBlobTier = exports2.BlockBlobTier = void 0; + exports2.toAccessTier = toAccessTier; + exports2.ensureCpkIfSpecified = ensureCpkIfSpecified; + exports2.getBlobServiceAccountAudience = getBlobServiceAccountAudience; + var constants_js_1 = require_constants10(); + var BlockBlobTier; + (function(BlockBlobTier2) { + BlockBlobTier2["Hot"] = "Hot"; + BlockBlobTier2["Cool"] = "Cool"; + BlockBlobTier2["Cold"] = "Cold"; + BlockBlobTier2["Archive"] = "Archive"; + })(BlockBlobTier || (exports2.BlockBlobTier = BlockBlobTier = {})); + var PremiumPageBlobTier; + (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 || (exports2.PremiumPageBlobTier = PremiumPageBlobTier = {})); + function toAccessTier(tier) { + if (tier === void 0) { return void 0; } - return tier2; + return tier; } __name(toAccessTier, "toAccessTier"); function ensureCpkIfSpecified(cpk, isHttps) { @@ -55396,19 +58922,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new RangeError("Customer-provided encryption key must be used over HTTPS."); } if (cpk && !cpk.encryptionAlgorithm) { - cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; + cpk.encryptionAlgorithm = constants_js_1.EncryptionAlgorithmAES25; } } __name(ensureCpkIfSpecified, "ensureCpkIfSpecified"); - exports2.StorageBlobAudience = void 0; - (function(StorageBlobAudience) { - StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default"; - StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; - })(exports2.StorageBlobAudience || (exports2.StorageBlobAudience = {})); + var StorageBlobAudience; + (function(StorageBlobAudience2) { + StorageBlobAudience2["StorageOAuthScopes"] = "https://storage.azure.com/.default"; + StorageBlobAudience2["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; + })(StorageBlobAudience || (exports2.StorageBlobAudience = StorageBlobAudience = {})); function getBlobServiceAccountAudience(storageAccountName) { return `https://${storageAccountName}.blob.core.windows.net/.default`; } __name(getBlobServiceAccountAudience, "getBlobServiceAccountAudience"); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/PageBlobRangeResponse.js +var require_PageBlobRangeResponse = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/PageBlobRangeResponse.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.rangeResponseFromModel = rangeResponseFromModel; function rangeResponseFromModel(response) { const pageRange = (response._response.parsedBody.pageRange || []).map((x) => ({ offset: x.start, @@ -55418,31 +58953,1255 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; offset: x.start, count: x.end - x.start })); - return Object.assign(Object.assign({}, response), { + return { + ...response, pageRange, clearRange, - _response: Object.assign(Object.assign({}, response._response), { parsedBody: { - pageRange, - clearRange - } }) - }); + _response: { + ...response._response, + parsedBody: { + pageRange, + clearRange + } + } + }; } __name(rangeResponseFromModel, "rangeResponseFromModel"); - var BlobBeginCopyFromUrlPoller = class extends coreLro.Poller { + } +}); + +// node_modules/@azure/core-lro/dist/commonjs/logger.js +var require_logger2 = __commonJS({ + "node_modules/@azure/core-lro/dist/commonjs/logger.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.logger = void 0; + var logger_1 = require_commonjs2(); + exports2.logger = (0, logger_1.createClientLogger)("core-lro"); + } +}); + +// node_modules/@azure/core-lro/dist/commonjs/poller/constants.js +var require_constants12 = __commonJS({ + "node_modules/@azure/core-lro/dist/commonjs/poller/constants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.terminalStates = exports2.POLL_INTERVAL_IN_MS = void 0; + exports2.POLL_INTERVAL_IN_MS = 2e3; + exports2.terminalStates = ["succeeded", "canceled", "failed"]; + } +}); + +// node_modules/@azure/core-lro/dist/commonjs/poller/operation.js +var require_operation = __commonJS({ + "node_modules/@azure/core-lro/dist/commonjs/poller/operation.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.pollOperation = exports2.initOperation = exports2.deserializeState = void 0; + var logger_js_1 = require_logger2(); + var constants_js_1 = require_constants12(); + function deserializeState(serializedState) { + try { + return JSON.parse(serializedState).state; + } catch (e) { + throw new Error(`Unable to deserialize input state: ${serializedState}`); + } + } + __name(deserializeState, "deserializeState"); + exports2.deserializeState = deserializeState; + function setStateError(inputs) { + const { state, stateProxy, isOperationError } = inputs; + return (error) => { + if (isOperationError(error)) { + stateProxy.setError(state, error); + stateProxy.setFailed(state); + } + throw error; + }; + } + __name(setStateError, "setStateError"); + function appendReadableErrorMessage(currentMessage, innerMessage) { + let message = currentMessage; + if (message.slice(-1) !== ".") { + message = message + "."; + } + return message + " " + innerMessage; + } + __name(appendReadableErrorMessage, "appendReadableErrorMessage"); + function simplifyError(err) { + let message = err.message; + let code = err.code; + let curErr = err; + while (curErr.innererror) { + curErr = curErr.innererror; + code = curErr.code; + message = appendReadableErrorMessage(message, curErr.message); + } + return { + code, + message + }; + } + __name(simplifyError, "simplifyError"); + function processOperationStatus(result) { + const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result; + switch (status) { + case "succeeded": { + stateProxy.setSucceeded(state); + break; + } + case "failed": { + const err = getError === null || getError === void 0 ? void 0 : getError(response); + let postfix = ""; + if (err) { + const { code, message } = simplifyError(err); + postfix = `. ${code}. ${message}`; + } + const errStr = `The long-running operation has failed${postfix}`; + stateProxy.setError(state, new Error(errStr)); + stateProxy.setFailed(state); + logger_js_1.logger.warning(errStr); + break; + } + case "canceled": { + stateProxy.setCanceled(state); + break; + } + } + if ((isDone === null || isDone === void 0 ? void 0 : isDone(response, state)) || isDone === void 0 && ["succeeded", "canceled"].concat(setErrorAsResult ? [] : ["failed"]).includes(status)) { + stateProxy.setResult(state, buildResult({ + response, + state, + processResult + })); + } + } + __name(processOperationStatus, "processOperationStatus"); + function buildResult(inputs) { + const { processResult, response, state } = inputs; + return processResult ? processResult(response, state) : response; + } + __name(buildResult, "buildResult"); + async function initOperation(inputs) { + const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + if (operationLocation) + withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); + const config = { + metadata, + operationLocation, + resourceLocation + }; + logger_js_1.logger.verbose(`LRO: Operation description:`, config); + const state = stateProxy.initState(config); + const status = getOperationStatus({ response, state, operationLocation }); + processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); + return state; + } + __name(initOperation, "initOperation"); + exports2.initOperation = initOperation; + async function pollOperationHelper(inputs) { + const { poll, state, stateProxy, operationLocation, getOperationStatus, getResourceLocation, isOperationError, options } = inputs; + const response = await poll(operationLocation, options).catch(setStateError({ + state, + stateProxy, + isOperationError + })); + const status = getOperationStatus(response, state); + logger_js_1.logger.verbose(`LRO: Status: + Polling from: ${state.config.operationLocation} + Operation status: ${status} + Polling status: ${constants_js_1.terminalStates.includes(status) ? "Stopped" : "Running"}`); + if (status === "succeeded") { + const resourceLocation = getResourceLocation(response, state); + if (resourceLocation !== void 0) { + return { + response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError })), + status + }; + } + } + return { response, status }; + } + __name(pollOperationHelper, "pollOperationHelper"); + async function pollOperation(inputs) { + const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult } = inputs; + const { operationLocation } = state.config; + if (operationLocation !== void 0) { + const { response, status } = await pollOperationHelper({ + poll, + getOperationStatus, + state, + stateProxy, + operationLocation, + getResourceLocation, + isOperationError, + options + }); + processOperationStatus({ + status, + response, + state, + stateProxy, + isDone, + processResult, + getError, + setErrorAsResult + }); + if (!constants_js_1.terminalStates.includes(status)) { + const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); + if (intervalInMs) + setDelay(intervalInMs); + const location = getOperationLocation === null || getOperationLocation === void 0 ? void 0 : getOperationLocation(response, state); + if (location !== void 0) { + const isUpdated = operationLocation !== location; + state.config.operationLocation = location; + withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(location, isUpdated); + } else + withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); + } + updateState === null || updateState === void 0 ? void 0 : updateState(state, response); + } + } + __name(pollOperation, "pollOperation"); + exports2.pollOperation = pollOperation; + } +}); + +// node_modules/@azure/core-lro/dist/commonjs/http/operation.js +var require_operation2 = __commonJS({ + "node_modules/@azure/core-lro/dist/commonjs/http/operation.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.pollHttpOperation = exports2.isOperationError = exports2.getResourceLocation = exports2.getOperationStatus = exports2.getOperationLocation = exports2.initHttpOperation = exports2.getStatusFromInitialResponse = exports2.getErrorFromResponse = exports2.parseRetryAfter = exports2.inferLroMode = void 0; + var operation_js_1 = require_operation(); + var logger_js_1 = require_logger2(); + function getOperationLocationPollingUrl(inputs) { + const { azureAsyncOperation, operationLocation } = inputs; + return operationLocation !== null && operationLocation !== void 0 ? operationLocation : azureAsyncOperation; + } + __name(getOperationLocationPollingUrl, "getOperationLocationPollingUrl"); + function getLocationHeader(rawResponse) { + return rawResponse.headers["location"]; + } + __name(getLocationHeader, "getLocationHeader"); + function getOperationLocationHeader(rawResponse) { + return rawResponse.headers["operation-location"]; + } + __name(getOperationLocationHeader, "getOperationLocationHeader"); + function getAzureAsyncOperationHeader(rawResponse) { + return rawResponse.headers["azure-asyncoperation"]; + } + __name(getAzureAsyncOperationHeader, "getAzureAsyncOperationHeader"); + function findResourceLocation(inputs) { + var _a; + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; + } + case "DELETE": { + return void 0; + } + case "PATCH": { + return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; + } + default: { + return getDefault(); + } + } + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return void 0; + } + case "original-uri": { + return requestPath; + } + case "location": + default: { + return location; + } + } + } + __name(getDefault, "getDefault"); + } + __name(findResourceLocation, "findResourceLocation"); + function inferLroMode(inputs) { + const { rawResponse, requestMethod, requestPath, resourceLocationConfig } = inputs; + const operationLocation = getOperationLocationHeader(rawResponse); + const azureAsyncOperation = getAzureAsyncOperationHeader(rawResponse); + const pollingUrl = getOperationLocationPollingUrl({ operationLocation, azureAsyncOperation }); + const location = getLocationHeader(rawResponse); + const normalizedRequestMethod = requestMethod === null || requestMethod === void 0 ? void 0 : requestMethod.toLocaleUpperCase(); + if (pollingUrl !== void 0) { + return { + mode: "OperationLocation", + operationLocation: pollingUrl, + resourceLocation: findResourceLocation({ + requestMethod: normalizedRequestMethod, + location, + requestPath, + resourceLocationConfig + }) + }; + } else if (location !== void 0) { + return { + mode: "ResourceLocation", + operationLocation: location + }; + } else if (normalizedRequestMethod === "PUT" && requestPath) { + return { + mode: "Body", + operationLocation: requestPath + }; + } else { + return void 0; + } + } + __name(inferLroMode, "inferLroMode"); + exports2.inferLroMode = inferLroMode; + function transformStatus(inputs) { + const { status, statusCode } = inputs; + if (typeof status !== "string" && status !== void 0) { + throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${status}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`); + } + switch (status === null || status === void 0 ? void 0 : status.toLocaleLowerCase()) { + case void 0: + return toOperationStatus(statusCode); + case "succeeded": + return "succeeded"; + case "failed": + return "failed"; + case "running": + case "accepted": + case "started": + case "canceling": + case "cancelling": + return "running"; + case "canceled": + case "cancelled": + return "canceled"; + default: { + logger_js_1.logger.verbose(`LRO: unrecognized operation status: ${status}`); + return status; + } + } + } + __name(transformStatus, "transformStatus"); + function getStatus(rawResponse) { + var _a; + const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); + } + __name(getStatus, "getStatus"); + function getProvisioningState(rawResponse) { + var _a, _b; + const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + const status = (_b = properties === null || properties === void 0 ? void 0 : properties.provisioningState) !== null && _b !== void 0 ? _b : provisioningState; + return transformStatus({ status, statusCode: rawResponse.statusCode }); + } + __name(getProvisioningState, "getProvisioningState"); + function toOperationStatus(statusCode) { + if (statusCode === 202) { + return "running"; + } else if (statusCode < 300) { + return "succeeded"; + } else { + return "failed"; + } + } + __name(toOperationStatus, "toOperationStatus"); + function parseRetryAfter({ rawResponse }) { + const retryAfter = rawResponse.headers["retry-after"]; + if (retryAfter !== void 0) { + const retryAfterInSeconds = parseInt(retryAfter); + return isNaN(retryAfterInSeconds) ? calculatePollingIntervalFromDate(new Date(retryAfter)) : retryAfterInSeconds * 1e3; + } + return void 0; + } + __name(parseRetryAfter, "parseRetryAfter"); + exports2.parseRetryAfter = parseRetryAfter; + function getErrorFromResponse(response) { + const error = accessBodyProperty(response, "error"); + if (!error) { + logger_js_1.logger.warning(`The long-running operation failed but there is no error property in the response's body`); + return; + } + if (!error.code || !error.message) { + logger_js_1.logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); + return; + } + return error; + } + __name(getErrorFromResponse, "getErrorFromResponse"); + exports2.getErrorFromResponse = getErrorFromResponse; + function calculatePollingIntervalFromDate(retryAfterDate) { + const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); + const retryAfterTime = retryAfterDate.getTime(); + if (timeNow < retryAfterTime) { + return retryAfterTime - timeNow; + } + return void 0; + } + __name(calculatePollingIntervalFromDate, "calculatePollingIntervalFromDate"); + function getStatusFromInitialResponse(inputs) { + const { response, state, operationLocation } = inputs; + function helper() { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case void 0: + return toOperationStatus(response.rawResponse.statusCode); + case "Body": + return getOperationStatus(response, state); + default: + return "running"; + } + } + __name(helper, "helper"); + const status = helper(); + return status === "running" && operationLocation === void 0 ? "succeeded" : status; + } + __name(getStatusFromInitialResponse, "getStatusFromInitialResponse"); + exports2.getStatusFromInitialResponse = getStatusFromInitialResponse; + async function initHttpOperation(inputs) { + const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; + return (0, operation_js_1.initOperation)({ + init: async () => { + const response = await lro.sendInitialRequest(); + const config = inferLroMode({ + rawResponse: response.rawResponse, + requestPath: lro.requestPath, + requestMethod: lro.requestMethod, + resourceLocationConfig + }); + return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, (config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {}); + }, + stateProxy, + processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse, + getOperationStatus: getStatusFromInitialResponse, + setErrorAsResult + }); + } + __name(initHttpOperation, "initHttpOperation"); + exports2.initHttpOperation = initHttpOperation; + function getOperationLocation({ rawResponse }, state) { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) + }); + } + case "ResourceLocation": { + return getLocationHeader(rawResponse); + } + case "Body": + default: { + return void 0; + } + } + } + __name(getOperationLocation, "getOperationLocation"); + exports2.getOperationLocation = getOperationLocation; + function getOperationStatus({ rawResponse }, state) { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getStatus(rawResponse); + } + case "ResourceLocation": { + return toOperationStatus(rawResponse.statusCode); + } + case "Body": { + return getProvisioningState(rawResponse); + } + default: + throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + } + } + __name(getOperationStatus, "getOperationStatus"); + exports2.getOperationStatus = getOperationStatus; + function accessBodyProperty({ flatResponse, rawResponse }, prop) { + var _a, _b; + return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_b = rawResponse.body) === null || _b === void 0 ? void 0 : _b[prop]; + } + __name(accessBodyProperty, "accessBodyProperty"); + function getResourceLocation(res, state) { + const loc = accessBodyProperty(res, "resourceLocation"); + if (loc && typeof loc === "string") { + state.config.resourceLocation = loc; + } + return state.config.resourceLocation; + } + __name(getResourceLocation, "getResourceLocation"); + exports2.getResourceLocation = getResourceLocation; + function isOperationError(e) { + return e.name === "RestError"; + } + __name(isOperationError, "isOperationError"); + exports2.isOperationError = isOperationError; + async function pollHttpOperation(inputs) { + const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult } = inputs; + return (0, operation_js_1.pollOperation)({ + state, + stateProxy, + setDelay, + processResult: processResult ? ({ flatResponse }, inputState) => processResult(flatResponse, inputState) : ({ flatResponse }) => flatResponse, + getError: getErrorFromResponse, + updateState, + getPollingInterval: parseRetryAfter, + getOperationLocation, + getOperationStatus, + isOperationError, + getResourceLocation, + options, + /** + * The expansion here is intentional because `lro` could be an object that + * references an inner this, so we need to preserve a reference to it. + */ + poll: async (location, inputOptions) => lro.sendPollRequest(location, inputOptions), + setErrorAsResult + }); + } + __name(pollHttpOperation, "pollHttpOperation"); + exports2.pollHttpOperation = pollHttpOperation; + } +}); + +// node_modules/@azure/core-lro/dist/commonjs/poller/poller.js +var require_poller = __commonJS({ + "node_modules/@azure/core-lro/dist/commonjs/poller/poller.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.buildCreatePoller = void 0; + var operation_js_1 = require_operation(); + var constants_js_1 = require_constants12(); + var core_util_1 = require_commonjs4(); + var createStateProxy = /* @__PURE__ */ __name(() => ({ + /** + * The state at this point is created to be of type OperationState. + * It will be updated later to be of type TState when the + * customer-provided callback, `updateState`, is called during polling. + */ + initState: (config) => ({ status: "running", config }), + setCanceled: (state) => state.status = "canceled", + setError: (state, error) => state.error = error, + setResult: (state, result) => state.result = result, + setRunning: (state) => state.status = "running", + setSucceeded: (state) => state.status = "succeeded", + setFailed: (state) => state.status = "failed", + getError: (state) => state.error, + getResult: (state) => state.result, + isCanceled: (state) => state.status === "canceled", + isFailed: (state) => state.status === "failed", + isRunning: (state) => state.status === "running", + isSucceeded: (state) => state.status === "succeeded" + }), "createStateProxy"); + function buildCreatePoller(inputs) { + const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, getError, resolveOnUnsuccessful } = inputs; + return async ({ init, poll }, options) => { + const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = constants_js_1.POLL_INTERVAL_IN_MS, restoreFrom } = options || {}; + const stateProxy = createStateProxy(); + const withOperationLocation = withOperationLocationCallback ? /* @__PURE__ */ (() => { + let called = false; + return (operationLocation, isUpdated) => { + if (isUpdated) + withOperationLocationCallback(operationLocation); + else if (!called) + withOperationLocationCallback(operationLocation); + called = true; + }; + })() : void 0; + const state = restoreFrom ? (0, operation_js_1.deserializeState)(restoreFrom) : await (0, operation_js_1.initOperation)({ + init, + stateProxy, + processResult, + getOperationStatus: getStatusFromInitialResponse, + withOperationLocation, + setErrorAsResult: !resolveOnUnsuccessful + }); + let resultPromise; + const abortController = new AbortController(); + const handlers = /* @__PURE__ */ new Map(); + const handleProgressEvents = /* @__PURE__ */ __name(async () => handlers.forEach((h) => h(state)), "handleProgressEvents"); + const cancelErrMsg = "Operation was canceled"; + let currentPollIntervalInMs = intervalInMs; + const poller = { + getOperationState: () => state, + getResult: () => state.result, + isDone: () => ["succeeded", "failed", "canceled"].includes(state.status), + isStopped: () => resultPromise === void 0, + stopPolling: () => { + abortController.abort(); + }, + toString: () => JSON.stringify({ + state + }), + onProgress: (callback) => { + const s = Symbol(); + handlers.set(s, callback); + return () => handlers.delete(s); + }, + pollUntilDone: (pollOptions) => resultPromise !== null && resultPromise !== void 0 ? resultPromise : resultPromise = (async () => { + const { abortSignal: inputAbortSignal } = pollOptions || {}; + function abortListener() { + abortController.abort(); + } + __name(abortListener, "abortListener"); + const abortSignal = abortController.signal; + if (inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.aborted) { + abortController.abort(); + } else if (!abortSignal.aborted) { + inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.addEventListener("abort", abortListener, { once: true }); + } + try { + if (!poller.isDone()) { + await poller.poll({ abortSignal }); + while (!poller.isDone()) { + await (0, core_util_1.delay)(currentPollIntervalInMs, { abortSignal }); + await poller.poll({ abortSignal }); + } + } + } finally { + inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.removeEventListener("abort", abortListener); + } + if (resolveOnUnsuccessful) { + return poller.getResult(); + } else { + switch (state.status) { + case "succeeded": + return poller.getResult(); + case "canceled": + throw new Error(cancelErrMsg); + case "failed": + throw state.error; + case "notStarted": + case "running": + throw new Error(`Polling completed without succeeding or failing`); + } + } + })().finally(() => { + resultPromise = void 0; + }), + async poll(pollOptions) { + if (resolveOnUnsuccessful) { + if (poller.isDone()) + return; + } else { + switch (state.status) { + case "succeeded": + return; + case "canceled": + throw new Error(cancelErrMsg); + case "failed": + throw state.error; + } + } + await (0, operation_js_1.pollOperation)({ + poll, + state, + stateProxy, + getOperationLocation, + isOperationError, + withOperationLocation, + getPollingInterval, + getOperationStatus: getStatusFromPollResponse, + getResourceLocation, + processResult, + getError, + updateState, + options: pollOptions, + setDelay: (pollIntervalInMs) => { + currentPollIntervalInMs = pollIntervalInMs; + }, + setErrorAsResult: !resolveOnUnsuccessful + }); + await handleProgressEvents(); + if (!resolveOnUnsuccessful) { + switch (state.status) { + case "canceled": + throw new Error(cancelErrMsg); + case "failed": + throw state.error; + } + } + } + }; + return poller; + }; + } + __name(buildCreatePoller, "buildCreatePoller"); + exports2.buildCreatePoller = buildCreatePoller; + } +}); + +// node_modules/@azure/core-lro/dist/commonjs/http/poller.js +var require_poller2 = __commonJS({ + "node_modules/@azure/core-lro/dist/commonjs/http/poller.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createHttpPoller = void 0; + var operation_js_1 = require_operation2(); + var poller_js_1 = require_poller(); + async function createHttpPoller(lro, options) { + const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false } = options || {}; + return (0, poller_js_1.buildCreatePoller)({ + getStatusFromInitialResponse: operation_js_1.getStatusFromInitialResponse, + getStatusFromPollResponse: operation_js_1.getOperationStatus, + isOperationError: operation_js_1.isOperationError, + getOperationLocation: operation_js_1.getOperationLocation, + getResourceLocation: operation_js_1.getResourceLocation, + getPollingInterval: operation_js_1.parseRetryAfter, + getError: operation_js_1.getErrorFromResponse, + resolveOnUnsuccessful + })({ + init: async () => { + const response = await lro.sendInitialRequest(); + const config = (0, operation_js_1.inferLroMode)({ + rawResponse: response.rawResponse, + requestPath: lro.requestPath, + requestMethod: lro.requestMethod, + resourceLocationConfig + }); + return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, (config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {}); + }, + poll: lro.sendPollRequest + }, { + intervalInMs, + withOperationLocation, + restoreFrom, + updateState, + processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse + }); + } + __name(createHttpPoller, "createHttpPoller"); + exports2.createHttpPoller = createHttpPoller; + } +}); + +// node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/operation.js +var require_operation3 = __commonJS({ + "node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/operation.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.GenericPollOperation = void 0; + var operation_js_1 = require_operation2(); + var logger_js_1 = require_logger2(); + var createStateProxy = /* @__PURE__ */ __name(() => ({ + initState: (config) => ({ config, isStarted: true }), + setCanceled: (state) => state.isCancelled = true, + setError: (state, error) => state.error = error, + setResult: (state, result) => state.result = result, + setRunning: (state) => state.isStarted = true, + setSucceeded: (state) => state.isCompleted = true, + setFailed: () => { + }, + getError: (state) => state.error, + getResult: (state) => state.result, + isCanceled: (state) => !!state.isCancelled, + isFailed: (state) => !!state.error, + isRunning: (state) => !!state.isStarted, + isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error) + }), "createStateProxy"); + var GenericPollOperation = class { + static { + __name(this, "GenericPollOperation"); + } + constructor(state, lro, setErrorAsResult, lroResourceLocationConfig, processResult, updateState, isDone) { + this.state = state; + this.lro = lro; + this.setErrorAsResult = setErrorAsResult; + this.lroResourceLocationConfig = lroResourceLocationConfig; + this.processResult = processResult; + this.updateState = updateState; + this.isDone = isDone; + } + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; + } + async update(options) { + var _a; + const stateProxy = createStateProxy(); + if (!this.state.isStarted) { + this.state = Object.assign(Object.assign({}, this.state), await (0, operation_js_1.initHttpOperation)({ + lro: this.lro, + stateProxy, + resourceLocationConfig: this.lroResourceLocationConfig, + processResult: this.processResult, + setErrorAsResult: this.setErrorAsResult + })); + } + const updateState = this.updateState; + const isDone = this.isDone; + if (!this.state.isCompleted && this.state.error === void 0) { + await (0, operation_js_1.pollHttpOperation)({ + lro: this.lro, + state: this.state, + stateProxy, + processResult: this.processResult, + updateState: updateState ? (state, { rawResponse }) => updateState(state, rawResponse) : void 0, + isDone: isDone ? ({ flatResponse }, state) => isDone(flatResponse, state) : void 0, + options, + setDelay: (intervalInMs) => { + this.pollerConfig.intervalInMs = intervalInMs; + }, + setErrorAsResult: this.setErrorAsResult + }); + } + (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); + return this; + } + async cancel() { + logger_js_1.logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; + } + /** + * Serializes the Poller operation. + */ + toString() { + return JSON.stringify({ + state: this.state + }); + } + }; + exports2.GenericPollOperation = GenericPollOperation; + } +}); + +// node_modules/@azure/core-lro/dist/commonjs/legacy/poller.js +var require_poller3 = __commonJS({ + "node_modules/@azure/core-lro/dist/commonjs/legacy/poller.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Poller = exports2.PollerCancelledError = exports2.PollerStoppedError = void 0; + var PollerStoppedError = class _PollerStoppedError extends Error { + static { + __name(this, "PollerStoppedError"); + } + constructor(message) { + super(message); + this.name = "PollerStoppedError"; + Object.setPrototypeOf(this, _PollerStoppedError.prototype); + } + }; + exports2.PollerStoppedError = PollerStoppedError; + var PollerCancelledError = class _PollerCancelledError extends Error { + static { + __name(this, "PollerCancelledError"); + } + constructor(message) { + super(message); + this.name = "PollerCancelledError"; + Object.setPrototypeOf(this, _PollerCancelledError.prototype); + } + }; + exports2.PollerCancelledError = PollerCancelledError; + var Poller = class { + static { + __name(this, "Poller"); + } + /** + * 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`. + */ + constructor(operation) { + this.resolveOnUnsuccessful = false; + this.stopped = true; + this.pollProgressCallbacks = []; + this.operation = operation; + this.promise = new Promise((resolve, reject) => { + this.resolve = resolve; + this.reject = reject; + }); + this.promise.catch(() => { + }); + } + /** + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. + */ + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } + } + /** + * 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. + * + * @param options - Optional properties passed to the operation's update method. + */ + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this) + }); + } + 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. + * + * @param state - The current operation state. + */ + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } + } + /** + * 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. + * + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * + * @param options - Optional properties passed to the operation's update method. + */ + poll(options = {}) { + if (!this.pollOncePromise) { + this.pollOncePromise = this.pollOnce(options); + const clearPollOncePromise = /* @__PURE__ */ __name(() => { + this.pollOncePromise = void 0; + }, "clearPollOncePromise"); + 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()); + } + } + /** + * Returns a promise that will resolve once the underlying operation is completed. + */ + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + this.processUpdatedState(); + return this.promise; + } + /** + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. + * + * It returns a method that can be used to stop receiving updates on the given callback function. + */ + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; + } + /** + * Returns true if the poller has finished polling. + */ + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); + } + /** + * Stops the poller from continuing to poll. + */ + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } + } + /** + * Returns true if the poller is stopped. + */ + isStopped() { + return this.stopped; + } + /** + * 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. + * + * @param options - Optional properties passed to the operation's update method. + */ + 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; + } + /** + * 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; + * } + * + * // 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; + } + /** + * 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(); + } + }; + exports2.Poller = Poller; + } +}); + +// node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/lroEngine.js +var require_lroEngine = __commonJS({ + "node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/lroEngine.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.LroEngine = void 0; + var operation_js_1 = require_operation3(); + var constants_js_1 = require_constants12(); + var poller_js_1 = require_poller3(); + var operation_js_2 = require_operation(); + var LroEngine = class extends poller_js_1.Poller { + static { + __name(this, "LroEngine"); + } + constructor(lro, options) { + const { intervalInMs = constants_js_1.POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState } = options || {}; + const state = resumeFrom ? (0, operation_js_2.deserializeState)(resumeFrom) : {}; + const operation = new operation_js_1.GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); + super(operation); + this.resolveOnUnsuccessful = resolveOnUnsuccessful; + this.config = { intervalInMs }; + operation.setPollerConfig(this.config); + } + /** + * The method used by the poller to wait before attempting to update its operation. + */ + delay() { + return new Promise((resolve) => setTimeout(() => resolve(), this.config.intervalInMs)); + } + }; + exports2.LroEngine = LroEngine; + } +}); + +// node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/index.js +var require_lroEngine2 = __commonJS({ + "node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.LroEngine = void 0; + var lroEngine_js_1 = require_lroEngine(); + Object.defineProperty(exports2, "LroEngine", { enumerable: true, get: function() { + return lroEngine_js_1.LroEngine; + } }); + } +}); + +// node_modules/@azure/core-lro/dist/commonjs/legacy/pollOperation.js +var require_pollOperation = __commonJS({ + "node_modules/@azure/core-lro/dist/commonjs/legacy/pollOperation.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/@azure/core-lro/dist/commonjs/index.js +var require_commonjs14 = __commonJS({ + "node_modules/@azure/core-lro/dist/commonjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createHttpPoller = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var poller_js_1 = require_poller2(); + Object.defineProperty(exports2, "createHttpPoller", { enumerable: true, get: function() { + return poller_js_1.createHttpPoller; + } }); + tslib_1.__exportStar(require_lroEngine2(), exports2); + tslib_1.__exportStar(require_poller3(), exports2); + tslib_1.__exportStar(require_pollOperation(), exports2); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/pollers/BlobStartCopyFromUrlPoller.js +var require_BlobStartCopyFromUrlPoller = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/pollers/BlobStartCopyFromUrlPoller.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BlobBeginCopyFromUrlPoller = void 0; + var core_util_1 = require_commonjs4(); + var core_lro_1 = require_commonjs14(); + var BlobBeginCopyFromUrlPoller = class extends core_lro_1.Poller { static { __name(this, "BlobBeginCopyFromUrlPoller"); } + intervalInMs; constructor(options) { - const { blobClient, copySource: copySource2, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; + const { blobClient, copySource, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; let state; if (resumeFrom) { state = JSON.parse(resumeFrom).state; } - const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { + const operation = makeBlobBeginCopyFromURLPollOperation({ + ...state, blobClient, - copySource: copySource2, + copySource, startCopyFromURLOptions - })); + }); super(operation); if (typeof onProgress === "function") { this.onProgress(onProgress); @@ -55450,20 +60209,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.intervalInMs = intervalInMs; } delay() { - return coreUtil.delay(this.intervalInMs); + return (0, core_util_1.delay)(this.intervalInMs); } }; + exports2.BlobBeginCopyFromUrlPoller = BlobBeginCopyFromUrlPoller; var cancel = /* @__PURE__ */ __name(async function cancel2(options = {}) { const state = this.state; - const { copyId: copyId2 } = state; + const { copyId } = state; if (state.isCompleted) { return makeBlobBeginCopyFromURLPollOperation(state); } - if (!copyId2) { + if (!copyId) { state.isCancelled = true; return makeBlobBeginCopyFromURLPollOperation(state); } - await state.blobClient.abortCopyFromURL(copyId2, { + await state.blobClient.abortCopyFromURL(copyId, { abortSignal: options.abortSignal }); state.isCancelled = true; @@ -55471,10 +60231,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }, "cancel"); var update = /* @__PURE__ */ __name(async function update2(options = {}) { const state = this.state; - const { blobClient, copySource: copySource2, startCopyFromURLOptions } = state; + const { blobClient, copySource, startCopyFromURLOptions } = state; if (!state.isStarted) { state.isStarted = true; - const result = await blobClient.startCopyFromURL(copySource2, startCopyFromURLOptions); + const result = await blobClient.startCopyFromURL(copySource, startCopyFromURLOptions); state.copyId = result.copyId; if (result.copyStatus === "success") { state.result = result; @@ -55514,13 +60274,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }, "toString"); function makeBlobBeginCopyFromURLPollOperation(state) { return { - state: Object.assign({}, state), + state: { ...state }, cancel, toString, update }; } __name(makeBlobBeginCopyFromURLPollOperation, "makeBlobBeginCopyFromURLPollOperation"); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/Range.js +var require_Range = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/Range.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.rangeToString = rangeToString; function rangeToString(iRange) { if (iRange.offset < 0) { throw new RangeError(`Range.offset cannot be smaller than 0.`); @@ -55531,6 +60300,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return iRange.count ? `bytes=${iRange.offset}-${iRange.offset + iRange.count - 1}` : `bytes=${iRange.offset}-`; } __name(rangeToString, "rangeToString"); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/Batch.js +var require_Batch = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/utils/Batch.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Batch = void 0; + var events_1 = require("events"); var BatchStates; (function(BatchStates2) { BatchStates2[BatchStates2["Good"] = 0] = "Good"; @@ -55540,21 +60319,45 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; static { __name(this, "Batch"); } + /** + * Concurrency. Must be lager than 0. + */ + concurrency; + /** + * Number of active operations under execution. + */ + actives = 0; + /** + * Number of completed operations under execution. + */ + completed = 0; + /** + * Offset of next operation to be executed. + */ + offset = 0; + /** + * Operation array to be executed. + */ + operations = []; + /** + * States of Batch. When an error happens, state will turn into error. + * Batch will stop execute left operations. + */ + state = BatchStates.Good; + /** + * A private emitter used to pass events inside this class. + */ + emitter; /** * 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 events.EventEmitter(); + this.emitter = new events_1.EventEmitter(); } /** * Add a operation into queue. @@ -55624,342 +60427,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BuffersStream = class extends stream.Readable { - static { - __name(this, "BuffersStream"); - } - /** - * 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."); - } - } - /** - * 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 i = 0; - while (i < 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 - i) { - const end = this.byteOffsetInCurrentBuffer + size - i; - outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end)); - this.pushedBytesLength += size - i; - this.byteOffsetInCurrentBuffer = end; - i = 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; - i += remaining; - } - } - if (outBuffers.length > 1) { - this.push(Buffer.concat(outBuffers)); - } else if (outBuffers.length === 1) { - this.push(outBuffers[0]); - } - } - }; - var maxBufferLength = buffer.constants.MAX_LENGTH; - var PooledBuffer = class { - static { - __name(this, "PooledBuffer"); - } - /** - * The size of the data contained in the pooled buffers. - */ - get size() { - return this._size; - } - constructor(capacity, buffers, totalLength) { - this.buffers = []; - this.capacity = capacity; - this._size = 0; - const bufferNum = Math.ceil(capacity / maxBufferLength); - for (let i = 0; i < bufferNum; i++) { - let len = i === bufferNum - 1 ? capacity % maxBufferLength : maxBufferLength; - if (len === 0) { - len = maxBufferLength; - } - this.buffers.push(Buffer.allocUnsafe(len)); - } - if (buffers) { - this.fill(buffers, totalLength); - } - } - /** - * 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 i = 0, j = 0, targetOffset = 0, sourceOffset = 0, totalCopiedNum = 0; - while (totalCopiedNum < this._size) { - const source = buffers[i]; - const target = this.buffers[j]; - const copiedNum = source.copy(target, targetOffset, sourceOffset); - totalCopiedNum += copiedNum; - sourceOffset += copiedNum; - targetOffset += copiedNum; - if (sourceOffset === source.length) { - i++; - sourceOffset = 0; - } - if (targetOffset === target.length) { - j++; - targetOffset = 0; - } - } - buffers.splice(0, i); - 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); - } - }; - var BufferScheduler = class { - static { - __name(this, "BufferScheduler"); - } - /** - * 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 events.EventEmitter(); - 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}`); - } - 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((resolve, 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 buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer2.getReadableStream(), buffer2.size, this.offset).then(resolve).catch(reject); - } else if (this.unresolvedLength >= this.bufferSize) { - return; - } else { - resolve(); - } - } - }); - }); - } - /** - * Insert a new data into unresolved array. - * - * @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. - * - */ - shiftBufferFromUnresolvedDataArray(buffer2) { - if (!buffer2) { - buffer2 = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); - } else { - buffer2.fill(this.unresolvedDataArray, this.unresolvedLength); - } - this.unresolvedLength -= buffer2.size; - return buffer2; - } - /** - * 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 buffer2; - if (this.incoming.length > 0) { - buffer2 = this.incoming.shift(); - this.shiftBufferFromUnresolvedDataArray(buffer2); - } else { - if (this.numBuffers < this.maxBuffers) { - buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.numBuffers++; - } else { - return false; - } - } - this.outgoing.push(buffer2); - this.triggerOutgoingHandlers(); - } - return true; - } - /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. - */ - async triggerOutgoingHandlers() { - let buffer2; - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return; - } - buffer2 = this.outgoing.shift(); - if (buffer2) { - this.triggerOutgoingHandler(buffer2); - } - } while (buffer2); - } - /** - * Trigger a outgoing handler for a buffer shifted from outgoing. - * - * @param buffer - - */ - async triggerOutgoingHandler(buffer2) { - const bufferLength = buffer2.size; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - try { - await this.outgoingHandler(() => buffer2.getReadableStream(), bufferLength, this.offset - bufferLength); - } catch (err) { - this.emitter.emit("error", err); - return; - } - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer2); - this.emitter.emit("checkEnd"); - } - /** - * Return buffer used by outgoing handler into incoming. - * - * @param buffer - - */ - reuseBuffer(buffer2) { - this.incoming.push(buffer2); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); - } - } - }; - async function streamToBuffer(stream2, buffer2, offset, end, encoding) { + exports2.Batch = Batch; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/utils.js +var require_utils4 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/utils/utils.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.fsCreateReadStream = exports2.fsStat = void 0; + exports2.streamToBuffer = streamToBuffer; + exports2.streamToBuffer2 = streamToBuffer2; + exports2.streamToBuffer3 = streamToBuffer3; + exports2.readStreamToLocalFile = readStreamToLocalFile; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var node_fs_1 = tslib_1.__importDefault(require("node:fs")); + var node_util_1 = tslib_1.__importDefault(require("node:util")); + var constants_js_1 = require_constants10(); + async function streamToBuffer(stream, buffer, offset, end, encoding) { let pos = 0; const count = end - offset; return new Promise((resolve, reject) => { - const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); - stream2.on("readable", () => { + const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), constants_js_1.REQUEST_TIMEOUT); + stream.on("readable", () => { if (pos >= count) { clearTimeout(timeout); resolve(); return; } - let chunk = stream2.read(); + let chunk = stream.read(); if (!chunk) { return; } @@ -55967,29 +60464,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; chunk = Buffer.from(chunk, encoding); } const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer2.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); + buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); pos += chunkLength; }); - stream2.on("end", () => { + stream.on("end", () => { clearTimeout(timeout); if (pos < count) { reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); } resolve(); }); - stream2.on("error", (msg) => { + stream.on("error", (msg) => { clearTimeout(timeout); reject(msg); }); }); } __name(streamToBuffer, "streamToBuffer"); - async function streamToBuffer2(stream2, buffer2, encoding) { + async function streamToBuffer2(stream, buffer, encoding) { let pos = 0; - const bufferSize = buffer2.length; + const bufferSize = buffer.length; return new Promise((resolve, reject) => { - stream2.on("readable", () => { - let chunk = stream2.read(); + stream.on("readable", () => { + let chunk = stream.read(); if (!chunk) { return; } @@ -56000,19 +60497,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`)); return; } - buffer2.fill(chunk, pos, pos + chunk.length); + buffer.fill(chunk, pos, pos + chunk.length); pos += chunk.length; }); - stream2.on("end", () => { + stream.on("end", () => { resolve(pos); }); - stream2.on("error", reject); + stream.on("error", reject); }); } __name(streamToBuffer2, "streamToBuffer2"); + async function streamToBuffer3(readableStream, encoding) { + return new Promise((resolve, reject) => { + const chunks = []; + readableStream.on("data", (data) => { + chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data); + }); + readableStream.on("end", () => { + resolve(Buffer.concat(chunks)); + }); + readableStream.on("error", reject); + }); + } + __name(streamToBuffer3, "streamToBuffer3"); async function readStreamToLocalFile(rs, file) { return new Promise((resolve, reject) => { - const ws = fs__namespace.createWriteStream(file); + const ws = node_fs_1.default.createWriteStream(file); rs.on("error", (err) => { reject(err); }); @@ -56024,12 +60534,51 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } __name(readStreamToLocalFile, "readStreamToLocalFile"); - var fsStat = util__namespace.promisify(fs__namespace.stat); - var fsCreateReadStream = fs__namespace.createReadStream; - var BlobClient = class _BlobClient extends StorageClient { + exports2.fsStat = node_util_1.default.promisify(node_fs_1.default.stat); + exports2.fsCreateReadStream = node_fs_1.default.createReadStream; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/Clients.js +var require_Clients = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/Clients.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.PageBlobClient = exports2.BlockBlobClient = exports2.AppendBlobClient = exports2.BlobClient = void 0; + var core_rest_pipeline_1 = require_commonjs6(); + var core_auth_1 = require_commonjs7(); + var core_util_1 = require_commonjs4(); + var core_util_2 = require_commonjs4(); + var BlobDownloadResponse_js_1 = require_BlobDownloadResponse(); + var BlobQueryResponse_js_1 = require_BlobQueryResponse(); + var AnonymousCredential_js_1 = require_AnonymousCredential(); + var StorageSharedKeyCredential_js_1 = require_StorageSharedKeyCredential(); + var models_js_1 = require_models2(); + var PageBlobRangeResponse_js_1 = require_PageBlobRangeResponse(); + var Pipeline_js_1 = require_Pipeline(); + var BlobStartCopyFromUrlPoller_js_1 = require_BlobStartCopyFromUrlPoller(); + var Range_js_1 = require_Range(); + var StorageClient_js_1 = require_StorageClient(); + var Batch_js_1 = require_Batch(); + var storage_common_1 = require_commonjs13(); + var constants_js_1 = require_constants10(); + var tracing_js_1 = require_tracing(); + var utils_common_js_1 = require_utils_common(); + var utils_js_1 = require_utils4(); + var BlobSASSignatureValues_js_1 = require_BlobSASSignatureValues(); + var BlobLeaseClient_js_1 = require_BlobLeaseClient(); + var BlobClient = class _BlobClient extends StorageClient_js_1.StorageClient { static { __name(this, "BlobClient"); } + /** + * blobContext provided by protocol layer. + */ + blobContext; + _name; + _containerName; + _versionId; + _snapshot; /** * The name of the blob. */ @@ -56045,49 +60594,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { options = options || {}; let pipeline; - let url2; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + let url; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; + url = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { const containerName = credentialOrPipelineOrContainerName; const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (0, Pipeline_js_1.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); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.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); + super(url, pipeline); ({ blobName: this._name, containerName: this._containerName } = this.getBlobAndContainerNamesFromUrl()); this.blobContext = this.storageClientContext.blob; - this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT); - this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID); + this._snapshot = (0, utils_common_js_1.getURLParameter)(this.url, constants_js_1.URLConstants.Parameters.SNAPSHOT); + this._versionId = (0, utils_common_js_1.getURLParameter)(this.url, constants_js_1.URLConstants.Parameters.VERSIONID); } /** * Creates a new BlobClient object identical to the source but with the specified snapshot timestamp. @@ -56096,8 +60645,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlobClient 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); + withSnapshot(snapshot) { + return new _BlobClient((0, utils_common_js_1.setURLParameter)(this.url, constants_js_1.URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? void 0 : snapshot), this.pipeline); } /** * Creates a new BlobClient object pointing to a version of this blob. @@ -56106,8 +60655,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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); + withVersion(versionId) { + return new _BlobClient((0, utils_common_js_1.setURLParameter)(this.url, constants_js_1.URLConstants.Parameters.VERSIONID, versionId.length === 0 ? void 0 : versionId), this.pipeline); } /** * Creates a AppendBlobClient object. @@ -56137,7 +60686,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * 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 + * @see https://learn.microsoft.com/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 @@ -56146,76 +60695,106 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * 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()); + * ```ts snippet:ReadmeSampleDownloadBlob_Node + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * 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); - * }); + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); + * + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobClient = containerClient.getBlobClient(blobName); + * + * // Get blob content from position 0 to the end + * // In Node.js, get downloaded data by accessing downloadBlockBlobResponse.readableStreamBody + * const downloadBlockBlobResponse = await blobClient.download(); + * if (downloadBlockBlobResponse.readableStreamBody) { + * const downloaded = await streamToString(downloadBlockBlobResponse.readableStreamBody); + * console.log(`Downloaded blob content: ${downloaded}`); + * } + * + * async function streamToString(stream: NodeJS.ReadableStream): Promise { + * const result = await new Promise>((resolve, reject) => { + * const chunks: Buffer[] = []; + * stream.on("data", (data) => { + * chunks.push(Buffer.isBuffer(data) ? data : Buffer.from(data)); + * }); + * stream.on("end", () => { + * resolve(Buffer.concat(chunks)); + * }); + * stream.on("error", reject); + * }); + * return result.toString(); * } * ``` * * 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 + * ```ts snippet:ReadmeSampleDownloadBlob_Browser + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; + * + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), * ); * - * 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); - * }); + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobClient = containerClient.getBlobClient(blobName); + * + * // Get blob content from position 0 to the end + * // In browsers, get downloaded data by accessing downloadBlockBlobResponse.blobBody + * const downloadBlockBlobResponse = await blobClient.download(); + * const blobBody = await downloadBlockBlobResponse.blobBody; + * if (blobBody) { + * const downloaded = await blobBody.text(); + * console.log(`Downloaded blob content: ${downloaded}`); * } * ``` */ async download(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.download({ + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + return tracing_js_1.tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => { + const res = (0, utils_common_js_1.assertResponse)(await this.blobContext.download({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { - onDownloadProgress: coreUtil.isNode ? void 0 : options.onProgress + onDownloadProgress: core_util_1.isNodeLike ? void 0 : options.onProgress // for Node.js, progress is reported by RetriableReadableStream }, - range: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), + range: offset === 0 && !count ? void 0 : (0, Range_js_1.rangeToString)({ offset, count }), rangeGetContentMD5: options.rangeGetContentMD5, rangeGetContentCRC64: options.rangeGetContentCrc64, snapshot: options.snapshot, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - const wrappedRes = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); - if (!coreUtil.isNode) { + const wrappedRes = { + ...res, + _response: res._response, + // _response is made non-enumerable + objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, + objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(res.objectReplicationRules) + }; + if (!core_util_1.isNodeLike) { return wrappedRes; } if (options.maxRetryRequests === void 0 || options.maxRetryRequests < 0) { - options.maxRetryRequests = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; + options.maxRetryRequests = constants_js_1.DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; } if (res.contentLength === void 0) { throw new RangeError(`File download response doesn't contain valid content length header`); @@ -56223,8 +60802,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!res.etag) { throw new RangeError(`File download response doesn't contain valid etag header`); } - return new BlobDownloadResponse(wrappedRes, async (start) => { - var _a2; + return new BlobDownloadResponse_js_1.BlobDownloadResponse(wrappedRes, async (start) => { const updatedDownloadOptions = { leaseAccessConditions: options.conditions, modifiedAccessConditions: { @@ -56232,9 +60810,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ifModifiedSince: options.conditions.ifModifiedSince, ifNoneMatch: options.conditions.ifNoneMatch, ifUnmodifiedSince: options.conditions.ifUnmodifiedSince, - ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions + ifTags: options.conditions?.tagConditions }, - range: rangeToString({ + range: (0, Range_js_1.rangeToString)({ count: offset + res.contentLength - start, offset: start }), @@ -56243,7 +60821,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }; - return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody; + return (await this.blobContext.download({ + abortSignal: options.abortSignal, + ...updatedDownloadOptions + })).readableStreamBody; }, offset, res.contentLength, { maxRetryRequests: options.maxRetryRequests, onProgress: options.onProgress @@ -56260,9 +60841,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - options to Exists operation. */ async exists(options = {}) { - return tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); await this.getProperties({ abortSignal: options.abortSignal, customerProvidedKey: options.customerProvidedKey, @@ -56273,7 +60854,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } catch (e) { if (e.statusCode === 404) { return false; - } else if (e.statusCode === 409 && (e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) { + } else if (e.statusCode === 409 && (e.details.errorCode === constants_js_1.BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === constants_js_1.BlobDoesNotUseCustomerSpecifiedEncryption)) { return true; } throw e; @@ -56283,7 +60864,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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 + * @see https://learn.microsoft.com/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 @@ -56294,17 +60875,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getProperties(options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.getProperties({ + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + return tracing_js_1.tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => { + const res = (0, utils_common_js_1.assertResponse)(await this.blobContext.getProperties({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); + return { + ...res, + _response: res._response, + // _response is made non-enumerable + objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, + objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(res.objectReplicationRules) + }; }); } /** @@ -56312,19 +60901,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob * * @param options - Optional options to Blob Delete operation. */ async delete(options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.delete({ + return tracing_js_1.tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.delete({ abortSignal: options.abortSignal, deleteSnapshots: options.deleteSnapshots, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -56334,19 +60925,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob * * @param options - Optional options to Blob Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.delete(updatedOptions)); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + const res = (0, utils_common_js_1.assertResponse)(await this.delete(updatedOptions)); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -56356,13 +60955,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/undelete-blob * * @param options - Optional options to Blob Undelete operation. */ async undelete(options = {}) { - return tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.undelete({ + return tracing_js_1.tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.undelete({ abortSignal: options.abortSignal, tracingOptions: updatedOptions.tracingOptions })); @@ -56373,7 +60972,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties * * @param blobHTTPHeaders - If no value provided, or no value provided for * the specified blob HTTP headers, these blob HTTP @@ -56385,14 +60984,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async setHTTPHeaders(blobHTTPHeaders, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setHttpHeaders({ + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + return tracing_js_1.tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.setHttpHeaders({ abortSignal: options.abortSignal, blobHttpHeaders: blobHTTPHeaders, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, // cpkInfo: options.customerProvidedKey, // CPK is not included in Swagger, should change this back when this issue is fixed in Swagger. tracingOptions: updatedOptions.tracingOptions })); @@ -56403,22 +61004,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-metadata * * @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. */ - async setMetadata(metadata2, options = {}) { + async setMetadata(metadata, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setMetadata({ + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + return tracing_js_1.tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.setMetadata({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - metadata: metadata2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + metadata, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -56434,15 +61037,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param tags - * @param options - */ - async setTags(tags2, options = {}) { - return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTags({ + async setTags(tags, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.setTags({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions, - tags: toBlobTags(tags2) + tags: (0, utils_common_js_1.toBlobTags)(tags) })); }); } @@ -56452,15 +61057,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async getTags(options = {}) { - return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.blobContext.getTags({ + return tracing_js_1.tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => { + const response = (0, utils_common_js_1.assertResponse)(await this.blobContext.getTags({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); + const wrappedResponse = { + ...response, + _response: response._response, + // _response is made non-enumerable + tags: (0, utils_common_js_1.toTags)({ blobTagSet: response.blobTagSet }) || {} + }; return wrappedResponse; }); } @@ -56471,24 +61083,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the blob. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a read-only snapshot of a blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-blob + * @see https://learn.microsoft.com/rest/api/storageservices/snapshot-blob * * @param options - Optional options to the Blob Create Snapshot operation. */ async createSnapshot(options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.createSnapshot({ + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + return tracing_js_1.tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.createSnapshot({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -56509,57 +61123,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob * - * Example using automatic polling: + * ```ts snippet:ClientsBeginCopyFromURL + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using manual polling: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobClient = containerClient.getBlobClient(blobName); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * while (!poller.isDone()) { - * await poller.poll(); + * // Example using automatic polling + * const automaticCopyPoller = await blobClient.beginCopyFromURL("url"); + * const automaticResult = await automaticCopyPoller.pollUntilDone(); + * + * // Example using manual polling + * const manualCopyPoller = await blobClient.beginCopyFromURL("url"); + * while (!manualCopyPoller.isDone()) { + * await manualCopyPoller.poll(); * } - * const result = copyPoller.getResult(); - * ``` + * const manualResult = manualCopyPoller.getResult(); * - * Example using progress updates: - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { + * // Example using progress updates + * const progressUpdatesCopyPoller = await blobClient.beginCopyFromURL("url", { * onProgress(state) { * console.log(`Progress: ${state.copyProgress}`); - * } + * }, * }); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const progressUpdatesResult = await progressUpdatesCopyPoller.pollUntilDone(); * - * Example using a changing polling interval (default 15 seconds): - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * intervalInMs: 1000 // poll blob every 1 second for copy progress + * // Example using a changing polling interval (default 15 seconds) + * const pollingIntervalCopyPoller = await blobClient.beginCopyFromURL("url", { + * intervalInMs: 1000, // poll blob every 1 second for copy progress * }); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const pollingIntervalResult = await pollingIntervalCopyPoller.pollUntilDone(); * - * Example using copy cancellation: - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); + * // Example using copy cancellation: + * const cancelCopyPoller = await blobClient.beginCopyFromURL("url"); * // cancel operation after starting it. * try { - * await copyPoller.cancelOperation(); + * await cancelCopyPoller.cancelOperation(); * // calls to get the result now throw PollerCancelledError - * await copyPoller.getResult(); - * } catch (err) { - * if (err.name === 'PollerCancelledError') { - * console.log('The copy was cancelled.'); + * cancelCopyPoller.getResult(); + * } catch (err: any) { + * if (err.name === "PollerCancelledError") { + * console.log("The copy was cancelled."); * } * } * ``` @@ -56567,15 +61182,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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 = {}) { + async beginCopyFromURL(copySource, options = {}) { const client = { abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), getProperties: (...args) => this.getProperties(...args), startCopyFromURL: (...args) => this.startCopyFromURL(...args) }; - const poller = new BlobBeginCopyFromUrlPoller({ + const poller = new BlobStartCopyFromUrlPoller_js_1.BlobBeginCopyFromUrlPoller({ blobClient: client, - copySource: copySource2, + copySource, intervalInMs: options.intervalInMs, onProgress: options.onProgress, resumeFrom: options.resumeFrom, @@ -56587,14 +61202,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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 + * @see https://learn.microsoft.com/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 abortCopyFromURL(copyId2, options = {}) { - return tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.abortCopyFromURL(copyId2, { + async abortCopyFromURL(copyId, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.abortCopyFromURL(copyId, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, tracingOptions: updatedOptions.tracingOptions @@ -56604,36 +61219,39 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob-from-url * * @param copySource - The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication * @param options - */ - async syncCopyFromURL(copySource2, options = {}) { + async syncCopyFromURL(copySource, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f, _g; - return assertResponse(await this.blobContext.copyFromURL(copySource2, { + return tracing_js_1.tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.copyFromURL(copySource, { abortSignal: options.abortSignal, metadata: options.metadata, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + 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: (_f = options.immutabilityPolicy) === null || _f === void 0 ? void 0 : _f.expiriesOn, - immutabilityPolicyMode: (_g = options.immutabilityPolicy) === null || _g === void 0 ? void 0 : _g.policyMode, + copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, encryptionScope: options.encryptionScope, copySourceTags: options.copySourceTags, + fileRequestIntent: options.sourceShareTokenIntent, tracingOptions: updatedOptions.tracingOptions })); }); @@ -56644,31 +61262,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-tier * * @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. */ - async setAccessTier(tier2, options = {}) { - return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTier(toAccessTier(tier2), { + async setAccessTier(tier, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.setTier((0, models_js_1.toAccessTier)(tier), { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, rehydratePriority: options.rehydratePriority, tracingOptions: updatedOptions.tracingOptions })); }); } async downloadToBuffer(param1, param2, param3, param4 = {}) { - var _a; - let buffer2; + let buffer; let offset = 0; let count = 0; let options = param4; if (param1 instanceof Buffer) { - buffer2 = param1; + buffer = param1; offset = param2 || 0; count = typeof param3 === "number" ? param3 : 0; } else { @@ -56676,12 +61295,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; count = typeof param2 === "number" ? param2 : 0; options = param3 || {}; } - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; + let blockSize = options.blockSize ?? 0; if (blockSize < 0) { throw new RangeError("blockSize option must be >= 0"); } if (blockSize === 0) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + blockSize = constants_js_1.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; } if (offset < 0) { throw new RangeError("offset option must be >= 0"); @@ -56692,26 +61311,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { if (!count) { - const response = await this.getProperties(Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + const response = await this.getProperties({ + ...options, + tracingOptions: updatedOptions.tracingOptions + }); count = response.contentLength - offset; if (count < 0) { throw new RangeError(`offset ${offset} shouldn't be larger than blob size ${response.contentLength}`); } } - if (!buffer2) { + if (!buffer) { try { - buffer2 = Buffer.alloc(count); + 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 (buffer2.length < count) { + 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); + const batch = new Batch_js_1.Batch(options.concurrency); for (let off = offset; off < offset + count; off = off + blockSize) { batch.addOperation(async () => { let chunkEnd = offset + count; @@ -56725,8 +61347,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; customerProvidedKey: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions }); - const stream2 = response.readableStreamBody; - await streamToBuffer(stream2, buffer2, off - offset, chunkEnd - offset); + const stream = response.readableStreamBody; + await (0, utils_js_1.streamToBuffer)(stream, buffer, off - offset, chunkEnd - offset); transferProgress += chunkEnd - off; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress }); @@ -56734,7 +61356,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } await batch.do(); - return buffer2; + return buffer; }); } /** @@ -56754,10 +61376,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * at the specified path. */ async downloadToFile(filePath, offset = 0, count, options = {}) { - return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => { - const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + return tracing_js_1.tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => { + const response = await this.download(offset, count, { + ...options, + tracingOptions: updatedOptions.tracingOptions + }); if (response.readableStreamBody) { - await readStreamToLocalFile(response.readableStreamBody, filePath); + await (0, utils_js_1.readStreamToLocalFile)(response.readableStreamBody, filePath); } response.blobDownloadStream = void 0; return response; @@ -56772,7 +61397,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?"); containerName = pathComponents[1]; blobName = pathComponents[3]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { const pathComponents = parsedUrl.pathname.match("/([^/]*)/([^/]*)(/(.*))?"); containerName = pathComponents[2]; blobName = pathComponents[4]; @@ -56800,21 +61425,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/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 startCopyFromURL(copySource2, options = {}) { - return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c; + async startCopyFromURL(copySource, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return assertResponse(await this.blobContext.startCopyFromURL(copySource2, { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.startCopyFromURL(copySource, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, @@ -56822,12 +61449,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, rehydratePriority: options.rehydratePriority, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), sealBlob: options.sealBlob, tracingOptions: updatedOptions.tracingOptions })); @@ -56839,18 +61466,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/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((resolve) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + if (!(this.credential instanceof StorageSharedKeyCredential_js_1.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(); - resolve(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, this.credential).toString(); + resolve((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -56859,17 +61492,67 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Generates string to sign for 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 + * @see https://learn.microsoft.com/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. */ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ generateSasStringToSign(options) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) { throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); } - return generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).stringToSign; + return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, this.credential).stringToSign; + } + /** + * + * Generates a Blob Service Shared Access Signature (SAS) URI based on + * the client properties and parameters passed in. The SAS is signed by the input user delegation key. + * + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas + * + * @param options - Optional parameters. + * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()` + * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. + */ + generateUserDelegationSasUrl(options, userDelegationKey) { + return new Promise((resolve) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + }); + } + /** + * Only available for BlobClient constructed with a shared key credential. + * + * Generates string to sign for a Blob Service Shared Access Signature (SAS) URI based on + * the client properties and parameters passed in. The SAS is signed by the input user delegation key. + * + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas + * + * @param options - Optional parameters. + * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()` + * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. + */ + generateUserDelegationSasStringToSign(options, userDelegationKey) { + return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, userDelegationKey, this.accountName).stringToSign; } /** * Delete the immutablility policy on the blob. @@ -56877,8 +61560,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to delete immutability policy on the blob. */ async deleteImmutabilityPolicy(options = {}) { - return tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.deleteImmutabilityPolicy({ + return tracing_js_1.tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.deleteImmutabilityPolicy({ tracingOptions: updatedOptions.tracingOptions })); }); @@ -56889,8 +61572,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set immutability policy on the blob. */ async setImmutabilityPolicy(immutabilityPolicy, options = {}) { - return tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setImmutabilityPolicy({ + return tracing_js_1.tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.setImmutabilityPolicy({ immutabilityPolicyExpiry: immutabilityPolicy.expiriesOn, immutabilityPolicyMode: immutabilityPolicy.policyMode, tracingOptions: updatedOptions.tracingOptions @@ -56903,8 +61586,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set legal hold on the blob. */ async setLegalHold(legalHoldEnabled, options = {}) { - return tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setLegalHold(legalHoldEnabled, { + return tracing_js_1.tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.setLegalHold(legalHoldEnabled, { tracingOptions: updatedOptions.tracingOptions })); }); @@ -56914,63 +61597,68 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/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 = {}) { - return tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.getAccountInfo({ + return tracing_js_1.tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.getAccountInfo({ abortSignal: options.abortSignal, tracingOptions: updatedOptions.tracingOptions })); }); } }; + exports2.BlobClient = BlobClient; var AppendBlobClient = class _AppendBlobClient extends BlobClient { static { __name(this, "AppendBlobClient"); } + /** + * appendBlobsContext provided by protocol layer. + */ + appendBlobContext; constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { let pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { const containerName = credentialOrPipelineOrContainerName; const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (0, Pipeline_js_1.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); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.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); + super(url, pipeline); this.appendBlobContext = this.storageClientContext.appendBlob; } /** @@ -56981,40 +61669,55 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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); + withSnapshot(snapshot) { + return new _AppendBlobClient((0, utils_common_js_1.setURLParameter)(this.url, constants_js_1.URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? void 0 : snapshot), this.pipeline); } /** * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - Options to the Append Block Create operation. * * * Example usage: * - * ```js - * const appendBlobClient = containerClient.getAppendBlobClient(""); + * ```ts snippet:ClientsCreateAppendBlob + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; + * + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); + * + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * + * const appendBlobClient = containerClient.getAppendBlobClient(blobName); * await appendBlobClient.create(); * ``` */ async create(options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.appendBlobContext.create(0, { + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + return tracing_js_1.tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.appendBlobContext.create(0, { abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.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, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - blobTagsString: toBlobTagsString(options.tags), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -57022,20 +61725,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - */ async createIfNotExists(options = {}) { - const conditions = { ifNoneMatch: ETagAny }; - return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + const conditions = { ifNoneMatch: constants_js_1.ETagAny }; + return tracing_js_1.tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + const res = (0, utils_common_js_1.assertResponse)(await this.create({ + ...updatedOptions, + conditions + })); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -57048,20 +61762,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async seal(options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.seal({ + return tracing_js_1.tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.appendBlobContext.seal({ abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); } /** * Commits a new block of data to the end of the existing append blob. - * @see https://docs.microsoft.com/rest/api/storageservices/append-block + * @see https://learn.microsoft.com/rest/api/storageservices/append-block * * @param body - Data to be appended. * @param contentLength - Length of the body in bytes. @@ -57070,29 +61786,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```ts snippet:ClientsAppendBlock + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; + * + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); + * + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * * const content = "Hello World!"; * * // Create a new append blob and append data to the blob. - * const newAppendBlobClient = containerClient.getAppendBlobClient(""); + * const newAppendBlobClient = containerClient.getAppendBlobClient(blobName); * await newAppendBlobClient.create(); * await newAppendBlobClient.appendBlock(content, content.length); * * // Append data to an existing append blob. - * const existingAppendBlobClient = containerClient.getAppendBlobClient(""); + * const existingAppendBlobClient = containerClient.getAppendBlobClient(blobName); * await existingAppendBlobClient.appendBlock(content, content.length); * ``` */ - async appendBlock(body2, contentLength2, options = {}) { + async appendBlock(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.appendBlock(contentLength2, body2, { + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + return tracing_js_1.tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.appendBlobContext.appendBlock(contentLength, body, { abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, @@ -57107,7 +61838,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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 + * @see https://learn.microsoft.com/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 @@ -57121,77 +61852,92 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + return tracing_js_1.tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { abortSignal: options.abortSignal, - sourceRange: rangeToString({ offset: sourceOffset, count }), + sourceRange: (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }), sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, appendPositionAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions }, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + sourceModifiedAccessConditions: { + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince + }, + copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, + fileRequestIntent: options.sourceShareTokenIntent, tracingOptions: updatedOptions.tracingOptions })); }); } }; + exports2.AppendBlobClient = AppendBlobClient; var BlockBlobClient = class _BlockBlobClient extends BlobClient { static { __name(this, "BlockBlobClient"); } + /** + * blobContext provided by protocol layer. + * + * Note. Ideally BlobClient should set BlobClient.blobContext to protected. However, API + * extractor has issue blocking that. Here we redecelare _blobContext in BlockBlobClient. + */ + _blobContext; + /** + * blockBlobContext provided by protocol layer. + */ + blockBlobContext; constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { let pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; + url = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { const containerName = credentialOrPipelineOrContainerName; const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (0, Pipeline_js_1.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); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.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); + super(url, pipeline); this.blockBlobContext = this.storageClientContext.blockBlob; this._blobContext = this.storageClientContext.blob; } @@ -57203,8 +61949,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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); + withSnapshot(snapshot) { + return new _BlockBlobClient((0, utils_common_js_1.setURLParameter)(this.url, constants_js_1.URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? void 0 : snapshot), this.pipeline); } /** * ONLY AVAILABLE IN NODE.JS RUNTIME. @@ -57213,15 +61959,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * 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); + * ```ts snippet:ClientsQuery + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * async function streamToBuffer(readableStream) { + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); + * + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blockBlobClient = containerClient.getBlockBlobClient(blobName); + * + * // Query and convert a blob to a string + * const queryBlockBlobResponse = await blockBlobClient.query("select from BlobStorage"); + * if (queryBlockBlobResponse.readableStreamBody) { + * const downloadedBuffer = await streamToBuffer(queryBlockBlobResponse.readableStreamBody); + * const downloaded = downloadedBuffer.toString(); + * console.log(`Query blob content: ${downloaded}`); + * } + * + * async function streamToBuffer(readableStream: NodeJS.ReadableStream): Promise { * return new Promise((resolve, reject) => { - * const chunks = []; + * const chunks: Buffer[] = []; * readableStream.on("data", (data) => { * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); * }); @@ -57237,26 +62000,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async query(query, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - if (!coreUtil.isNode) { + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + if (!core_util_1.isNodeLike) { throw new Error("This operation currently is only supported in Node.js."); } - return tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this._blobContext.query({ + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => { + const response = (0, utils_common_js_1.assertResponse)(await this._blobContext.query({ abortSignal: options.abortSignal, queryRequest: { queryType: "SQL", expression: query, - inputSerialization: toQuerySerialization(options.inputTextConfiguration), - outputSerialization: toQuerySerialization(options.outputTextConfiguration) + inputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.inputTextConfiguration), + outputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.outputTextConfiguration) }, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return new BlobQueryResponse(response, { + return new BlobQueryResponse_js_1.BlobQueryResponse(response, { abortSignal: options.abortSignal, onProgress: options.onProgress, onError: options.onError @@ -57274,7 +62039,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link uploadStream} or {@link uploadBrowserData} for better performance * with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.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. @@ -57285,32 +62050,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```ts snippet:ClientsUpload + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; + * + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); + * + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blockBlobClient = containerClient.getBlockBlobClient(blobName); + * * const content = "Hello world!"; * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); * ``` */ - async upload(body2, contentLength2, options = {}) { + async upload(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.upload(contentLength2, body2, { + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blockBlobContext.upload(contentLength, body, { abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.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, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -57335,22 +62116,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async syncUploadFromURL(sourceURL, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f; - return assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince, - sourceIfTags: (_f = options.sourceConditions) === null || _f === void 0 ? void 0 : _f.tagConditions - }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags, tracingOptions: updatedOptions.tracingOptions }))); + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, { + ...options, + blobHttpHeaders: options.blobHTTPHeaders, + leaseAccessConditions: options.conditions, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + sourceModifiedAccessConditions: { + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince, + sourceIfTags: options.sourceConditions?.tagConditions + }, + cpkInfo: options.customerProvidedKey, + copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), + copySourceTags: options.copySourceTags, + fileRequestIntent: options.sourceShareTokenIntent, + tracingOptions: updatedOptions.tracingOptions + })); }); } /** * 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 + * @see https://learn.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. @@ -57358,10 +62154,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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 = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlock(blockId2, contentLength2, body2, { + async stageBlock(blockId, body, contentLength, options = {}) { + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blockBlobContext.stageBlock(blockId, contentLength, body, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, requestOptions: { @@ -57379,7 +62175,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/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 @@ -57396,18 +62192,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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 = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlockFromURL(blockId2, 0, sourceURL, { + async stageBlockFromURL(blockId, sourceURL, offset = 0, count, options = {}) { + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blockBlobContext.stageBlockFromURL(blockId, 0, sourceURL, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, - sourceRange: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), + sourceRange: offset === 0 && !count ? void 0 : (0, Range_js_1.rangeToString)({ offset, count }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), + fileRequestIntent: options.sourceShareTokenIntent, tracingOptions: updatedOptions.tracingOptions })); }); @@ -57418,30 +62215,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.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. */ - async commitBlockList(blocks2, options = {}) { + async commitBlockList(blocks, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks2 }, { + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.blockBlobContext.commitBlockList({ latest: blocks }, { abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.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, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -57449,20 +62248,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/get-block-list * * @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. */ - async getBlockList(listType2, options = {}) { - return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blockBlobContext.getBlockList(listType2, { + async getBlockList(listType, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => { + const res = (0, utils_common_js_1.assertResponse)(await this.blockBlobContext.getBlockList(listType, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); if (!res.committedBlocks) { @@ -57491,18 +62292,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async uploadData(data, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { - if (coreUtil.isNode) { - let buffer2; + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { + if (core_util_1.isNodeLike) { + let buffer; if (data instanceof Buffer) { - buffer2 = data; + buffer = data; } else if (data instanceof ArrayBuffer) { - buffer2 = Buffer.from(data); + buffer = Buffer.from(data); } else { data = data; - buffer2 = Buffer.from(data.buffer, data.byteOffset, data.byteLength); + buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength); } - return this.uploadSeekableInternal((offset, size) => buffer2.slice(offset, offset + size), buffer2.byteLength, updatedOptions); + 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); @@ -57529,7 +62330,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadBrowserData(browserData, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadBrowserData", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadBrowserData", options, async (updatedOptions) => { const browserBlob = new Blob([browserData]); return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions); }); @@ -57550,23 +62351,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadSeekableInternal(bodyFactory, size, options = {}) { - var _a, _b; - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; - if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { - throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); + let blockSize = options.blockSize ?? 0; + if (blockSize < 0 || blockSize > constants_js_1.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { + throw new RangeError(`blockSize option must be >= 0 and <= ${constants_js_1.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); } - const maxSingleShotSize = (_b = options.maxSingleShotSize) !== null && _b !== void 0 ? _b : BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; - if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { - throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}`); + const maxSingleShotSize = options.maxSingleShotSize ?? constants_js_1.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; + if (maxSingleShotSize < 0 || maxSingleShotSize > constants_js_1.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { + throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${constants_js_1.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}`); } if (blockSize === 0) { - if (size > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { + if (size > constants_js_1.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * constants_js_1.BLOCK_BLOB_MAX_BLOCKS) { throw new RangeError(`${size} is too larger to upload to a block blob.`); } if (size > maxSingleShotSize) { - blockSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS); - if (blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + blockSize = Math.ceil(size / constants_js_1.BLOCK_BLOB_MAX_BLOCKS); + if (blockSize < constants_js_1.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { + blockSize = constants_js_1.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; } } } @@ -57576,32 +62376,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { if (size <= maxSingleShotSize) { - return assertResponse(await this.upload(bodyFactory(0, size), size, updatedOptions)); + return (0, utils_common_js_1.assertResponse)(await this.upload(bodyFactory(0, size), size, updatedOptions)); } const numBlocks = Math.floor((size - 1) / 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}`); + if (numBlocks > constants_js_1.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 <= ${constants_js_1.BLOCK_BLOB_MAX_BLOCKS}`); } const blockList = []; - const blockIDPrefix = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; - const batch = new Batch(options.concurrency); + const batch = new Batch_js_1.Batch(options.concurrency); for (let i = 0; i < numBlocks; i++) { batch.addOperation(async () => { - const blockID = generateBlockID(blockIDPrefix, i); + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, i); const start = blockSize * i; const end = i === numBlocks - 1 ? size : start + blockSize; - const contentLength2 = end - start; + const contentLength = end - start; blockList.push(blockID); - await this.stageBlock(blockID, bodyFactory(start, contentLength2), contentLength2, { + await this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, { abortSignal: options.abortSignal, conditions: options.conditions, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions }); - transferProgress += contentLength2; + transferProgress += contentLength; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress @@ -57627,15 +62427,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadFile(filePath, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => { - const size = (await fsStat(filePath)).size; + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => { + const size = (await (0, utils_js_1.fsStat)(filePath)).size; return this.uploadSeekableInternal((offset, count) => { - return () => fsCreateReadStream(filePath, { + return () => (0, utils_js_1.fsCreateReadStream)(filePath, { autoClose: true, end: count ? offset + count - 1 : Infinity, start: offset }); - }, size, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + }, size, { + ...options, + tracingOptions: updatedOptions.tracingOptions + }); }); } /** @@ -57654,27 +62457,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to Upload Stream to Block Blob operation. * @returns Response data for the Blob Upload operation. */ - async uploadStream(stream2, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { + async uploadStream(stream, bufferSize = constants_js_1.DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { if (!options.blobHTTPHeaders) { options.blobHTTPHeaders = {}; } if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { let blockNum = 0; - const blockIDPrefix = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; const blockList = []; - const scheduler = new BufferScheduler( - stream2, + const scheduler = new storage_common_1.BufferScheduler( + stream, bufferSize, maxConcurrency, - async (body2, length) => { - const blockID = generateBlockID(blockIDPrefix, blockNum); + async (body, length) => { + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, blockNum); blockList.push(blockID); blockNum++; - await this.stageBlock(blockID, body2, length, { + await this.stageBlock(blockID, body, length, { customerProvidedKey: options.customerProvidedKey, conditions: options.conditions, encryptionScope: options.encryptionScope, @@ -57692,53 +62495,61 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; Math.ceil(maxConcurrency / 4 * 3) ); await scheduler.do(); - return assertResponse(await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }))); + return (0, utils_common_js_1.assertResponse)(await this.commitBlockList(blockList, { + ...options, + tracingOptions: updatedOptions.tracingOptions + })); }); } }; + exports2.BlockBlobClient = BlockBlobClient; var PageBlobClient = class _PageBlobClient extends BlobClient { static { __name(this, "PageBlobClient"); } + /** + * pageBlobsContext provided by protocol layer. + */ + pageBlobContext; constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { let pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { const containerName = credentialOrPipelineOrContainerName; const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (0, Pipeline_js_1.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); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.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); + super(url, pipeline); this.pageBlobContext = this.storageClientContext.pageBlob; } /** @@ -57749,13 +62560,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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); + withSnapshot(snapshot) { + return new _PageBlobClient((0, utils_common_js_1.setURLParameter)(this.url, constants_js_1.URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? void 0 : snapshot), 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 + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param size - size of the page blob. * @param options - Options to the Page Blob Create operation. @@ -57763,23 +62574,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async create(size, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.pageBlobContext.create(0, size, { + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + return tracing_js_1.tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.create(0, size, { abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, blobSequenceNumber: options.blobSequenceNumber, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.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, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -57788,21 +62601,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param size - size of the page blob. * @param options - */ async createIfNotExists(size, options = {}) { - return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const conditions = { ifNoneMatch: ETagAny }; - const res = assertResponse(await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + const conditions = { ifNoneMatch: constants_js_1.ETagAny }; + const res = (0, utils_common_js_1.assertResponse)(await this.create(size, { + ...options, + conditions, + tracingOptions: updatedOptions.tracingOptions + })); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -57810,7 +62635,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/put-page * * @param body - Data to upload * @param offset - Offset of destination page blob @@ -57818,19 +62643,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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 = {}) { + async uploadPages(body, offset, count, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.uploadPages(count, body2, { + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + return tracing_js_1.tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.uploadPages(count, body, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, @@ -57843,7 +62670,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/put-page-from-url * * @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 @@ -57854,32 +62681,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), { + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); + return tracing_js_1.tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.uploadPagesFromURL(sourceURL, (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }), 0, (0, Range_js_1.rangeToString)({ offset: destOffset, count }), { abortSignal: options.abortSignal, sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, sequenceNumberAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + 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), + copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), + fileRequestIntent: options.sourceShareTokenIntent, tracingOptions: updatedOptions.tracingOptions })); }); } /** * Frees the specified pages from the page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page + * @see https://learn.microsoft.com/rest/api/storageservices/put-page * * @param offset - Starting byte position of the pages to clear. * @param count - Number of bytes to clear. @@ -57888,13 +62718,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async clearPages(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.clearPages(0, { + return tracing_js_1.tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.clearPages(0, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, @@ -57904,7 +62736,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges * * @param offset - Starting byte position of the page ranges. * @param count - Number of bytes to get. @@ -57913,16 +62745,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRanges(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRanges({ + return tracing_js_1.tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => { + const response = (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.getPageRanges({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** @@ -57930,22 +62764,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges * * @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 listPageRangesSegment(offset = 0, count, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRanges({ + async listPageRangesSegment(offset = 0, count, marker, options = {}) { + return tracing_js_1.tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.getPageRanges({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), - marker: marker2, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); @@ -57965,17 +62801,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to List Page Ranges operation. */ - listPageRangeItemSegments() { - return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* listPageRangeItemSegments_1(offset = 0, count, marker2, options = {}) { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }, "listPageRangeItemSegments_1")); + async *listPageRangeItemSegments(offset = 0, count, marker, options = {}) { + let getPageRangeItemSegmentsResponse; + if (!!marker || marker === void 0) { + do { + getPageRangeItemSegmentsResponse = await this.listPageRangesSegment(offset, count, marker, options); + marker = getPageRangeItemSegmentsResponse.continuationToken; + yield await getPageRangeItemSegmentsResponse; + } while (marker); + } } /** * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects @@ -57984,96 +62818,79 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param count - Number of bytes to get. * @param options - Options to List Page Ranges operation. */ - listPageRangeItems() { - return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* listPageRangeItems_1(offset = 0, count, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) - yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) - throw e_1.error; - } - } - }, "listPageRangeItems_1")); + async *listPageRangeItems(offset = 0, count, options = {}) { + let marker; + for await (const getPageRangesSegment of this.listPageRangeItemSegments(offset, count, marker, options)) { + yield* (0, utils_common_js_1.ExtractPageRangeInfoItems)(getPageRangesSegment); + } } /** * 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 + * @see https://learn.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: + * ```ts snippet:ClientsListPageBlobs + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); + * + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const pageBlobClient = containerClient.getPageBlobClient(blobName); + * + * // Example using `for await` syntax * 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 `iter.next()` syntax + * i = 1; + * const iter = pageBlobClient.listPageRanges(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Page range ${i++}: ${value.start} - ${value.end}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: + * // Example using `byPage()` syntax + * i = 1; + * for await (const page of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { + * for (const pageRange of page.pageRange || []) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * } + * } * - * ```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) { + * // Example using paging with a marker + * i = 1; + * let iterator = pageBlobClient.listPageRanges().byPage({ maxPageSize: 2 }); + * let response = (await iterator.next()).value; + * // Prints 2 page ranges + * if (response.pageRange) { + * for (const pageRange of response.pageRange) { + * 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; + * // Prints 10 page ranges + * if (response.pageRange) { + * for (const pageRange of response.pageRange) { * 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; - * - * // 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. @@ -58099,13 +62916,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + return this.listPageRangeItemSegments(offset, count, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...options + }); } }; } /** * 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 + * @see https://learn.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. @@ -58115,17 +62935,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => { - var _a; - const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + return tracing_js_1.tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => { + const result = (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.getPageRangesDiff({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, prevsnapshot: prevSnapshot, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(result); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(result); }); } /** @@ -58134,7 +62956,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges * * @param offset - Starting byte position of the page ranges. * @param count - Number of bytes to get. @@ -58142,20 +62964,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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 listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRangesDiff({ - 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: (_a = options === null || options === void 0 ? void 0 : options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + async listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options = {}) { + return tracing_js_1.tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.getPageRangesDiff({ + abortSignal: options?.abortSignal, + leaseAccessConditions: options?.conditions, + modifiedAccessConditions: { + ...options?.conditions, + ifTags: options?.conditions?.tagConditions + }, prevsnapshot: prevSnapshotOrUrl, - range: rangeToString({ + range: (0, Range_js_1.rangeToString)({ offset, count }), - marker: marker2, - maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize, + marker, + maxPageSize: options?.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); }); @@ -58176,17 +63000,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to the Page Blob Get Page Ranges Diff operation. */ - listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options) { - return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* listPageRangeDiffItemSegments_1() { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }, "listPageRangeDiffItemSegments_1")); + async *listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options) { + let getPageRangeItemSegmentsResponse; + if (!!marker || marker === void 0) { + do { + getPageRangeItemSegmentsResponse = await this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options); + marker = getPageRangeItemSegmentsResponse.continuationToken; + yield await getPageRangeItemSegmentsResponse; + } while (marker); + } } /** * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects @@ -58196,96 +63018,88 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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. */ - listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { - return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* listPageRangeDiffItems_1() { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) - yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) - throw e_2.error; - } - } - }, "listPageRangeDiffItems_1")); + async *listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { + let marker; + for await (const getPageRangesSegment of this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options)) { + yield* (0, utils_common_js_1.ExtractPageRangeInfoItems)(getPageRangesSegment); + } } /** * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges * * .byPage() returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob. * - * Example using `for await` syntax: + * ```ts snippet:ClientsListPageBlobsDiff + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); + * + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const pageBlobClient = containerClient.getPageBlobClient(blobName); + * + * const offset = 0; + * const count = 1024; + * const previousSnapshot = ""; + * // Example using `for await` syntax * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRangesDiff()) { + * for await (const pageRange of pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot)) { * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```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(); + * // Example using `iter.next()` syntax + * i = 1; + * const iter = pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Page range ${i++}: ${value.start} - ${value.end}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: + * // Example using `byPage()` syntax + * i = 1; + * for await (const page of pageBlobClient + * .listPageRangesDiff(offset, count, previousSnapshot) + * .byPage({ maxPageSize: 20 })) { + * for (const pageRange of page.pageRange || []) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * } + * } * - * ```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) { + * // Example using paging with a marker + * i = 1; + * let iterator = pageBlobClient + * .listPageRangesDiff(offset, count, previousSnapshot) + * .byPage({ maxPageSize: 2 }); + * let response = (await iterator.next()).value; + * // Prints 2 page ranges + * if (response.pageRange) { + * for (const pageRange of response.pageRange) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * } + * } + * // Gets next marker + * let marker = response.continuationToken; + * // Passing next marker as continuationToken + * iterator = pageBlobClient + * .listPageRangesDiff(offset, count, previousSnapshot) + * .byPage({ continuationToken: marker, maxPageSize: 10 }); + * response = (await iterator.next()).value; + * // Prints 10 page ranges + * if (response.pageRange) { + * for (const pageRange of response.pageRange) { * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); * } * } * ``` * - * Example using paging with a marker: - * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRangesDiff().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.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. @@ -58294,7 +63108,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ listPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options)); + const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, { + ...options + }); return { /** * The next method, part of the iteration protocol @@ -58312,13 +63128,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...options + }); } }; } /** * 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 + * @see https://learn.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. @@ -58326,24 +63145,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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 = {}) { + async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + return tracing_js_1.tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => { + const response = (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.getPageRangesDiff({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevSnapshotUrl: prevSnapshotUrl2, - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + prevSnapshotUrl, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties * * @param size - Target size * @param options - Options to the Page Blob Resize operation. @@ -58351,12 +63172,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async resize(size, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.resize(size, { + return tracing_js_1.tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.resize(size, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions })); @@ -58364,22 +63187,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Sets a page blob's sequence number. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties * * @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 updateSequenceNumber(sequenceNumberAction2, sequenceNumber, options = {}) { + async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction2, { + return tracing_js_1.tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction, { abortSignal: options.abortSignal, blobSequenceNumber: sequenceNumber, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -58389,36 +63214,65 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/incremental-copy-blob + * @see https://learn.microsoft.com/azure/virtual-machines/windows/incremental-snapshots * * @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 startCopyIncremental(copySource2, options = {}) { - return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.copyIncremental(copySource2, { + async startCopyIncremental(copySource, options = {}) { + return tracing_js_1.tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.pageBlobContext.copyIncremental(copySource, { abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); } }; + exports2.PageBlobClient = PageBlobClient; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/BatchUtils.js +var require_BatchUtils = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/BatchUtils.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getBodyAsText = getBodyAsText; + exports2.utf8ByteLength = utf8ByteLength; + var utils_js_1 = require_utils4(); + var constants_js_1 = require_constants10(); async function getBodyAsText(batchResponse) { - let buffer2 = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES); - const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer2); - buffer2 = buffer2.slice(0, responseLength); - return buffer2.toString(); + let buffer = Buffer.alloc(constants_js_1.BATCH_MAX_PAYLOAD_IN_BYTES); + const responseLength = await (0, utils_js_1.streamToBuffer2)(batchResponse.readableStreamBody, buffer); + buffer = buffer.slice(0, responseLength); + return buffer.toString(); } __name(getBodyAsText, "getBodyAsText"); function utf8ByteLength(str) { return Buffer.byteLength(str); } __name(utf8ByteLength, "utf8ByteLength"); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/BatchResponseParser.js +var require_BatchResponseParser = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/BatchResponseParser.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BatchResponseParser = void 0; + var core_rest_pipeline_1 = require_commonjs6(); + var core_http_compat_1 = require_commonjs9(); + var constants_js_1 = require_constants10(); + var BatchUtils_js_1 = require_BatchUtils(); + var log_js_1 = require_log5(); var HTTP_HEADER_DELIMITER = ": "; var SPACE_DELIMITER = " "; var NOT_FOUND = -1; @@ -58426,6 +63280,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; static { __name(this, "BatchResponseParser"); } + batchResponse; + responseBatchBoundary; + perResponsePrefix; + batchResponseEnding; + subRequests; constructor(batchResponse, subRequests) { if (!batchResponse || !batchResponse.contentType) { throw new RangeError("batchResponse is malformed or doesn't contain valid content-type."); @@ -58436,15 +63295,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.batchResponse = batchResponse; this.subRequests = subRequests; this.responseBatchBoundary = this.batchResponse.contentType.split("=")[1]; - this.perResponsePrefix = `--${this.responseBatchBoundary}${HTTP_LINE_ENDING}`; + this.perResponsePrefix = `--${this.responseBatchBoundary}${constants_js_1.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 + // For example of response, please refer to https://learn.microsoft.com/rest/api/storageservices/blob-batch#response async parseBatchResponse() { - if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) { + if (this.batchResponse._response.status !== constants_js_1.HTTPURLConnection.HTTP_ACCEPTED) { throw new Error(`Invalid state: batch request failed with status: '${this.batchResponse._response.status}'.`); } - const responseBodyAsText = await getBodyAsText(this.batchResponse); + const responseBodyAsText = await (0, BatchUtils_js_1.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) { @@ -58456,18 +63315,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; for (let index = 0; index < subResponseCount; index++) { const subResponse = subResponses[index]; const deserializedSubResponse = {}; - deserializedSubResponse.headers = coreHttpCompat.toHttpHeadersLike(coreRestPipeline.createHttpHeaders()); - const responseLines = subResponse.split(`${HTTP_LINE_ENDING}`); + deserializedSubResponse.headers = (0, core_http_compat_1.toHttpHeadersLike)((0, core_rest_pipeline_1.createHttpHeaders)()); + const responseLines = subResponse.split(`${constants_js_1.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)) { + if (responseLine.startsWith(constants_js_1.HeaderConstants.CONTENT_ID)) { contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); } - if (responseLine.startsWith(HTTP_VERSION_1_1)) { + if (responseLine.startsWith(constants_js_1.HTTP_VERSION_1_1)) { subRespHeaderStartFound = true; const tokens = responseLine.split(SPACE_DELIMITER); deserializedSubResponse.status = parseInt(tokens[1]); @@ -58487,7 +63346,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } const tokens = responseLine.split(HTTP_HEADER_DELIMITER); deserializedSubResponse.headers.set(tokens[0], tokens[1]); - if (tokens[0] === HeaderConstants.X_MS_ERROR_CODE) { + if (tokens[0] === constants_js_1.HeaderConstants.X_MS_ERROR_CODE) { deserializedSubResponse.errorCode = tokens[1]; subRespFailed = true; } @@ -58502,7 +63361,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; deserializedSubResponse._request = this.subRequests.get(contentId); deserializedSubResponses[contentId] = deserializedSubResponse; } else { - logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); + log_js_1.logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); } if (subRespFailed) { subResponsesFailedCount++; @@ -58517,6 +63376,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; } }; + exports2.BatchResponseParser = BatchResponseParser; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/Mutex.js +var require_Mutex = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/utils/Mutex.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Mutex = void 0; var MutexLockStatus; (function(MutexLockStatus2) { MutexLockStatus2[MutexLockStatus2["LOCKED"] = 0] = "LOCKED"; @@ -58559,6 +63428,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; resolve(); }); } + static keys = {}; + static listeners = {}; static onUnlockEvent(key, handler) { if (this.listeners[key] === void 0) { this.listeners[key] = [handler]; @@ -58575,14 +63446,39 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - Mutex.keys = {}; - Mutex.listeners = {}; + exports2.Mutex = Mutex; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/BlobBatch.js +var require_BlobBatch = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/BlobBatch.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BlobBatch = void 0; + var core_util_1 = require_commonjs4(); + var core_auth_1 = require_commonjs7(); + var core_rest_pipeline_1 = require_commonjs6(); + var core_util_2 = require_commonjs4(); + var AnonymousCredential_js_1 = require_AnonymousCredential(); + var Clients_js_1 = require_Clients(); + var Mutex_js_1 = require_Mutex(); + var Pipeline_js_1 = require_Pipeline(); + var utils_common_js_1 = require_utils_common(); + var core_xml_1 = require_commonjs10(); + var constants_js_1 = require_constants10(); + var StorageSharedKeyCredential_js_1 = require_StorageSharedKeyCredential(); + var tracing_js_1 = require_tracing(); + var core_client_1 = require_commonjs8(); + var StorageSharedKeyCredentialPolicyV2_js_1 = require_StorageSharedKeyCredentialPolicyV22(); var BlobBatch = class { static { __name(this, "BlobBatch"); } + batchRequest; + batch = "batch"; + batchType; constructor() { - this.batch = "batch"; this.batchRequest = new InnerBatchRequest(); } /** @@ -58606,13 +63502,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.batchRequest.getSubRequests(); } async addSubRequestInternal(subRequest, assembleSubRequestFunc) { - await Mutex.lock(this.batch); + await Mutex_js_1.Mutex.lock(this.batch); try { this.batchRequest.preAddSubRequest(subRequest); await assembleSubRequestFunc(); this.batchRequest.postAddSubRequest(subRequest); } finally { - await Mutex.unlock(this.batch); + await Mutex_js_1.Mutex.unlock(this.batch); } } setBatchType(batchType) { @@ -58624,13 +63520,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { - let url2; + let url; let credential; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrOptions instanceof StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrOptions))) { - url2 = urlOrBlobClient; + if (typeof urlOrBlobClient === "string" && (core_util_2.isNodeLike && credentialOrOptions instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrOptions))) { + url = urlOrBlobClient; credential = credentialOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = urlOrBlobClient.url; credential = urlOrBlobClient.credential; options = credentialOrOptions; } else { @@ -58639,28 +63535,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("delete"); await this.addSubRequestInternal({ - url: url2, + url, credential }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).delete(updatedOptions); + await new Clients_js_1.BlobClient(url, this.batchRequest.createPipeline(credential)).delete(updatedOptions); }); }); } async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { - let url2; + let url; let credential; - let tier2; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrTier instanceof StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrTier))) { - url2 = urlOrBlobClient; + let tier; + if (typeof urlOrBlobClient === "string" && (core_util_2.isNodeLike && credentialOrTier instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrTier))) { + url = urlOrBlobClient; credential = credentialOrTier; - tier2 = tierOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; + tier = tierOrOptions; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = urlOrBlobClient.url; credential = urlOrBlobClient.credential; - tier2 = credentialOrTier; + tier = credentialOrTier; options = tierOrOptions; } else { throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); @@ -58668,27 +63564,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("setAccessTier"); await this.addSubRequestInternal({ - url: url2, + url, credential }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).setAccessTier(tier2, updatedOptions); + await new Clients_js_1.BlobClient(url, this.batchRequest.createPipeline(credential)).setAccessTier(tier, updatedOptions); }); }); } }; + exports2.BlobBatch = BlobBatch; var InnerBatchRequest = class { static { __name(this, "InnerBatchRequest"); } + operationCount; + body; + subRequests; + boundary; + subRequestPrefix; + multipartContentType; + batchRequestEnding; constructor() { this.operationCount = 0; this.body = ""; - const tempGuid = coreUtil.randomUUID(); + const tempGuid = (0, core_util_1.randomUUID)(); 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.subRequestPrefix = `--${this.boundary}${constants_js_1.HTTP_LINE_ENDING}${constants_js_1.HeaderConstants.CONTENT_TYPE}: application/http${constants_js_1.HTTP_LINE_ENDING}${constants_js_1.HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`; this.multipartContentType = `multipart/mixed; boundary=${this.boundary}`; this.batchRequestEnding = `--${this.boundary}--`; this.subRequests = /* @__PURE__ */ new Map(); @@ -58701,9 +63605,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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 corePipeline = coreRestPipeline.createEmptyPipeline(); - corePipeline.addPolicy(coreClient.serializationPolicy({ - stringifyXML: coreXml.stringifyXML, + const corePipeline = (0, core_rest_pipeline_1.createEmptyPipeline)(); + corePipeline.addPolicy((0, core_client_1.serializationPolicy)({ + stringifyXML: core_xml_1.stringifyXML, serializerOptions: { xml: { xmlCharKey: "#" @@ -58712,19 +63616,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }), { phase: "Serialize" }); corePipeline.addPolicy(batchHeaderFilterPolicy()); corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" }); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ + if ((0, core_auth_1.isTokenCredential)(credential)) { + corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ credential, - scopes: StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } + scopes: constants_js_1.StorageOAuthScopes, + challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge } }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ + } else if (credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { + corePipeline.addPolicy((0, StorageSharedKeyCredentialPolicyV2_js_1.storageSharedKeyCredentialPolicy)({ accountName: credential.accountName, accountKey: credential.accountKey }), { phase: "Sign" }); } - const pipeline = new Pipeline([]); + const pipeline = new Pipeline_js_1.Pipeline([]); pipeline._credential = credential; pipeline._corePipeline = corePipeline; return pipeline; @@ -58733,23 +63637,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.body += [ this.subRequestPrefix, // sub request constant prefix - `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, + `${constants_js_1.HeaderConstants.CONTENT_ID}: ${this.operationCount}`, // sub request's content ID "", // empty line after sub request's content ID - `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` + `${request.method.toString()} ${(0, utils_common_js_1.getURLPathAndQuery)(request.url)} ${constants_js_1.HTTP_VERSION_1_1}${constants_js_1.HTTP_LINE_ENDING}` // sub request start line with method - ].join(HTTP_LINE_ENDING); + ].join(constants_js_1.HTTP_LINE_ENDING); for (const [name, value] of request.headers) { - this.body += `${name}: ${value}${HTTP_LINE_ENDING}`; + this.body += `${name}: ${value}${constants_js_1.HTTP_LINE_ENDING}`; } - this.body += HTTP_LINE_ENDING; + this.body += constants_js_1.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`); + if (this.operationCount >= constants_js_1.BATCH_MAX_REQUEST) { + throw new RangeError(`Cannot exceed ${constants_js_1.BATCH_MAX_REQUEST} sub requests in a single batch`); } - const path2 = getURLPath(subRequest.url); + const path2 = (0, utils_common_js_1.getURLPath)(subRequest.url); if (!path2 || path2 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } @@ -58760,7 +63664,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } // Return the http request body with assembling the ending line to the sub request body. getHttpRequestBody() { - return `${this.body}${this.batchRequestEnding}${HTTP_LINE_ENDING}`; + return `${this.body}${this.batchRequestEnding}${constants_js_1.HTTP_LINE_ENDING}`; } getMultipartContentType() { return this.multipartContentType; @@ -58777,7 +63681,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return { request, status: 200, - headers: coreRestPipeline.createHttpHeaders() + headers: (0, core_rest_pipeline_1.createHttpHeaders)() }; } }; @@ -58789,7 +63693,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async sendRequest(request, next) { let xMsHeaderName = ""; for (const [name] of request.headers) { - if (iEqual(name, HeaderConstants.X_MS_VERSION)) { + if ((0, utils_common_js_1.iEqual)(name, constants_js_1.HeaderConstants.X_MS_VERSION)) { xMsHeaderName = name; } } @@ -58801,21 +63705,39 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; } __name(batchHeaderFilterPolicy, "batchHeaderFilterPolicy"); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/BlobBatchClient.js +var require_BlobBatchClient = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/BlobBatchClient.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BlobBatchClient = void 0; + var BatchResponseParser_js_1 = require_BatchResponseParser(); + var BatchUtils_js_1 = require_BatchUtils(); + var BlobBatch_js_1 = require_BlobBatch(); + var tracing_js_1 = require_tracing(); + var AnonymousCredential_js_1 = require_AnonymousCredential(); + var StorageContextClient_js_1 = require_StorageContextClient(); + var Pipeline_js_1 = require_Pipeline(); + var utils_common_js_1 = require_utils_common(); var BlobBatchClient = class { static { __name(this, "BlobBatchClient"); } - constructor(url2, credentialOrPipeline, options) { + serviceOrContainerContext; + constructor(url, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; } else if (!credentialOrPipeline) { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else { - pipeline = newPipeline(credentialOrPipeline, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } - const storageClientContext = new StorageContextClient(url2, getCoreClientOptions(pipeline)); - const path2 = getURLPath(url2); + const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + const path2 = (0, utils_common_js_1.getURLPath)(url); if (path2 && path2 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { @@ -58827,10 +63749,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * A BlobBatch represents an aggregated set of operations on blobs. */ createBatch() { - return new BlobBatch(); + return new BlobBatch_js_1.BlobBatch(); } async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.deleteBlob(urlOrBlobClient, credentialOrOptions, options); @@ -58841,7 +63763,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.submitBatch(batch); } async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options); @@ -58859,11 +63781,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.deleteBlob(urlInString0, credential0); - * await batchRequest.deleteBlob(urlInString1, credential1, { - * deleteSnapshots: "include" + * ```ts snippet:BlobBatchClientSubmitBatch + * import { DefaultAzureCredential } from "@azure/identity"; + * import { BlobServiceClient, BlobBatch } from "@azure/storage-blob"; + * + * const account = ""; + * const credential = new DefaultAzureCredential(); + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * credential, + * ); + * + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobBatchClient = containerClient.getBlobBatchClient(); + * + * const batchRequest = new BlobBatch(); + * await batchRequest.deleteBlob("", credential); + * await batchRequest.deleteBlob("", credential, { + * deleteSnapshots: "include", * }); * const batchResp = await blobBatchClient.submitBatch(batchRequest); * console.log(batchResp.subResponsesSucceededCount); @@ -58871,17 +63807,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using a lease: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.setBlobAccessTier(blockBlobClient0, "Cool"); - * await batchRequest.setBlobAccessTier(blockBlobClient1, "Cool", { - * conditions: { leaseId: leaseId } + * ```ts snippet:BlobBatchClientSubmitBatchWithLease + * import { DefaultAzureCredential } from "@azure/identity"; + * import { BlobServiceClient, BlobBatch } from "@azure/storage-blob"; + * + * const account = ""; + * const credential = new DefaultAzureCredential(); + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * credential, + * ); + * + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobBatchClient = containerClient.getBlobBatchClient(); + * const blobClient = containerClient.getBlobClient(""); + * + * const batchRequest = new BlobBatch(); + * await batchRequest.setBlobAccessTier(blobClient, "Cool"); + * await batchRequest.setBlobAccessTier(blobClient, "Cool", { + * conditions: { leaseId: "" }, * }); * const batchResp = await blobBatchClient.submitBatch(batchRequest); * console.log(batchResp.subResponsesSucceededCount); * ``` * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @param batchRequest - A set of Delete or SetTier operations. * @param options - @@ -58890,10 +63841,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!batchRequest || batchRequest.getSubRequests().size === 0) { throw new RangeError("Batch request should contain one or more sub requests."); } - return tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { const batchRequestBody = batchRequest.getHttpRequestBody(); - const rawBatchResponse = assertResponse(await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign({}, updatedOptions))); - const batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); + const rawBatchResponse = (0, utils_common_js_1.assertResponse)(await this.serviceOrContainerContext.submitBatch((0, BatchUtils_js_1.utf8ByteLength)(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, { + ...updatedOptions + })); + const batchResponseParser = new BatchResponseParser_js_1.BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); const responseSummary = await batchResponseParser.parseBatchResponse(); const res = { _response: rawBatchResponse._response, @@ -58910,10 +63863,38 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } }; - var ContainerClient = class extends StorageClient { + exports2.BlobBatchClient = BlobBatchClient; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/ContainerClient.js +var require_ContainerClient = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/ContainerClient.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ContainerClient = void 0; + var core_rest_pipeline_1 = require_commonjs6(); + var core_util_1 = require_commonjs4(); + var core_auth_1 = require_commonjs7(); + var AnonymousCredential_js_1 = require_AnonymousCredential(); + var StorageSharedKeyCredential_js_1 = require_StorageSharedKeyCredential(); + var Pipeline_js_1 = require_Pipeline(); + var StorageClient_js_1 = require_StorageClient(); + var tracing_js_1 = require_tracing(); + var utils_common_js_1 = require_utils_common(); + var BlobSASSignatureValues_js_1 = require_BlobSASSignatureValues(); + var BlobLeaseClient_js_1 = require_BlobLeaseClient(); + var Clients_js_1 = require_Clients(); + var BlobBatchClient_js_1 = require_BlobBatchClient(); + var ContainerClient = class extends StorageClient_js_1.StorageClient { static { __name(this, "ContainerClient"); } + /** + * containerContext provided by protocol layer. + */ + containerContext; + _containerName; /** * The name of the container. */ @@ -58922,48 +63903,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { let pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { const containerName = credentialOrPipelineOrContainerName; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (0, Pipeline_js_1.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); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.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 parameter"); } - super(url2, pipeline); + super(url, pipeline); this._containerName = this.getContainerNameFromUrl(); this.containerContext = this.storageClientContext.container; } /** * 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 + * @see https://learn.microsoft.com/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. @@ -58971,34 +63952,52 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); + * ```ts snippet:ContainerClientCreate + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; + * + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); + * + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); * const createContainerResponse = await containerClient.create(); * console.log("Container was created successfully", createContainerResponse.requestId); * ``` */ async create(options = {}) { - return tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.create(updatedOptions)); + return tracing_js_1.tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.containerContext.create(updatedOptions)); }); } /** * 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 + * @see https://learn.microsoft.com/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 = {}) { - return tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { try { const res = await this.create(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } else { throw e; } @@ -59015,7 +64014,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async exists(options = {}) { - return tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { try { await this.getProperties({ abortSignal: options.abortSignal, @@ -59037,7 +64036,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobClient object for the given blob name. */ getBlobClient(blobName) { - return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + return new Clients_js_1.BlobClient((0, utils_common_js_1.appendToURLPath)(this.url, (0, utils_common_js_1.EscapePath)(blobName)), this.pipeline); } /** * Creates an {@link AppendBlobClient} @@ -59045,7 +64044,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - An append blob name */ getAppendBlobClient(blobName) { - return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + return new Clients_js_1.AppendBlobClient((0, utils_common_js_1.appendToURLPath)(this.url, (0, utils_common_js_1.EscapePath)(blobName)), this.pipeline); } /** * Creates a {@link BlockBlobClient} @@ -59055,15 +64054,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const content = "Hello world!"; + * ```ts snippet:ClientsUpload + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * const blockBlobClient = containerClient.getBlockBlobClient(""); + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); + * + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blockBlobClient = containerClient.getBlockBlobClient(blobName); + * + * const content = "Hello world!"; * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); * ``` */ getBlockBlobClient(blobName) { - return new BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + return new Clients_js_1.BlockBlobClient((0, utils_common_js_1.appendToURLPath)(this.url, (0, utils_common_js_1.EscapePath)(blobName)), this.pipeline); } /** * Creates a {@link PageBlobClient} @@ -59071,12 +64082,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - A page blob name */ getPageBlobClient(blobName) { - return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + return new Clients_js_1.PageBlobClient((0, utils_common_js_1.appendToURLPath)(this.url, (0, utils_common_js_1.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 + * @see https://learn.microsoft.com/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 @@ -59089,14 +64100,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), { tracingOptions: updatedOptions.tracingOptions }))); + return tracing_js_1.tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.containerContext.getProperties({ + abortSignal: options.abortSignal, + ...options.conditions, + tracingOptions: updatedOptions.tracingOptions + })); }); } /** * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ @@ -59104,8 +64119,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.delete({ + return tracing_js_1.tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.containerContext.delete({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, @@ -59116,19 +64131,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { try { const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -59140,24 +64162,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/set-container-metadata * * @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 setMetadata(metadata2, options = {}) { + async setMetadata(metadata, 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"); } - return tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.setMetadata({ + return tracing_js_1.tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.containerContext.setMetadata({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, - metadata: metadata2, + metadata, modifiedAccessConditions: options.conditions, tracingOptions: updatedOptions.tracingOptions })); @@ -59170,7 +64192,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/get-container-acl * * @param options - Options to Container Get Access Policy operation. */ @@ -59178,8 +64200,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.getAccessPolicy({ + return tracing_js_1.tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => { + const response = (0, utils_common_js_1.assertResponse)(await this.containerContext.getAccessPolicy({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, tracingOptions: updatedOptions.tracingOptions @@ -59228,29 +64250,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/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 setAccessPolicy(access2, containerAcl2, options = {}) { + async setAccessPolicy(access, containerAcl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { const acl = []; - for (const identifier of containerAcl2 || []) { + for (const identifier of containerAcl || []) { acl.push({ accessPolicy: { - expiresOn: identifier.accessPolicy.expiresOn ? truncatedISO8061Date(identifier.accessPolicy.expiresOn) : "", + expiresOn: identifier.accessPolicy.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.expiresOn) : "", permissions: identifier.accessPolicy.permissions, - startsOn: identifier.accessPolicy.startsOn ? truncatedISO8061Date(identifier.accessPolicy.startsOn) : "" + startsOn: identifier.accessPolicy.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.startsOn) : "" }, id: identifier.id }); } - return assertResponse(await this.containerContext.setAccessPolicy({ + return (0, utils_common_js_1.assertResponse)(await this.containerContext.setAccessPolicy({ abortSignal: options.abortSignal, - access: access2, + access, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, @@ -59265,7 +64287,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the container. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a new block blob, or updates the content of an existing block blob. @@ -59279,7 +64301,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better * performance with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.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 @@ -59289,10 +64311,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure the Block Blob Upload operation. * @returns Block Blob upload response data and the corresponding BlockBlobClient instance. */ - async uploadBlockBlob(blobName, body2, contentLength2, options = {}) { - return tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => { + async uploadBlockBlob(blobName, body, contentLength, options = {}) { + return tracing_js_1.tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => { const blockBlobClient = this.getBlockBlobClient(blobName); - const response = await blockBlobClient.upload(body2, contentLength2, updatedOptions); + const response = await blockBlobClient.upload(body, contentLength, updatedOptions); return { blockBlobClient, response @@ -59304,14 +64326,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob * * @param blobName - * @param options - Options to Blob Delete operation. * @returns Block blob deletion response data. */ async deleteBlob(blobName, options = {}) { - return tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { let blobClient = this.getBlobClient(blobName); if (options.versionId) { blobClient = blobClient.withVersion(options.versionId); @@ -59324,18 +64346,38 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/list-blobs * * @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 listBlobFlatSegment(marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - 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((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }) }) }); + async listBlobFlatSegment(marker, options = {}) { + return tracing_js_1.tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => { + const response = (0, utils_common_js_1.assertResponse)(await this.containerContext.listBlobFlatSegment({ + marker, + ...options, + tracingOptions: updatedOptions.tracingOptions + })); + const wrappedResponse = { + ...response, + _response: { + ...response._response, + parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListBlobFlat)(response._response.parsedBody) + }, + // _response is made non-enumerable + segment: { + ...response.segment, + blobItems: response.segment.blobItems.map((blobItemInternal) => { + const blobItem = { + ...blobItemInternal, + name: (0, utils_common_js_1.BlobNameToString)(blobItemInternal.name), + tags: (0, utils_common_js_1.toTags)(blobItemInternal.blobTags), + objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(blobItemInternal.objectReplicationMetadata) + }; + return blobItem; + }) + } + }; return wrappedResponse; }); } @@ -59344,23 +64386,46 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/list-blobs * * @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. */ - async listBlobHierarchySegment(delimiter2, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.containerContext.listBlobHierarchySegment(delimiter2, Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - 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((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }) }) }); + async listBlobHierarchySegment(delimiter, marker, options = {}) { + return tracing_js_1.tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => { + const response = (0, utils_common_js_1.assertResponse)(await this.containerContext.listBlobHierarchySegment(delimiter, { + marker, + ...options, + tracingOptions: updatedOptions.tracingOptions + })); + const wrappedResponse = { + ...response, + _response: { + ...response._response, + parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListBlobHierarchy)(response._response.parsedBody) + }, + // _response is made non-enumerable + segment: { + ...response.segment, + blobItems: response.segment.blobItems.map((blobItemInternal) => { + const blobItem = { + ...blobItemInternal, + name: (0, utils_common_js_1.BlobNameToString)(blobItemInternal.name), + tags: (0, utils_common_js_1.toTags)(blobItemInternal.blobTags), + objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(blobItemInternal.objectReplicationMetadata) + }; + return blobItem; + }), + blobPrefixes: response.segment.blobPrefixes?.map((blobPrefixInternal) => { + const blobPrefix = { + ...blobPrefixInternal, + name: (0, utils_common_js_1.BlobNameToString)(blobPrefixInternal.name) + }; + return blobPrefix; + }) + } + }; return wrappedResponse; }); } @@ -59376,46 +64441,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* listSegments_1(marker2, options = {}) { - let listBlobsFlatSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker2, options)); - marker2 = listBlobsFlatSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse)); - } while (marker2); - } - }, "listSegments_1")); + async *listSegments(marker, options = {}) { + let listBlobsFlatSegmentResponse; + if (!!marker || marker === void 0) { + do { + listBlobsFlatSegmentResponse = await this.listBlobFlatSegment(marker, options); + marker = listBlobsFlatSegmentResponse.continuationToken; + yield await listBlobsFlatSegmentResponse; + } while (marker); + } } /** * Returns an AsyncIterableIterator of {@link BlobItem} objects * * @param options - Options to list blobs operation. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* listItems_1(options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsFlatSegmentResponse = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) - yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) - throw e_1.error; - } - } - }, "listItems_1")); + async *listItems(options = {}) { + let marker; + for await (const listBlobsFlatSegmentResponse of this.listSegments(marker, options)) { + yield* listBlobsFlatSegmentResponse.segment.blobItems; + } } /** * Returns an async iterable iterator to list all the blobs @@ -59423,64 +64468,63 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * Example using `for await` syntax: + * ```ts snippet:ReadmeSampleListBlobs_Multiple + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the containerClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("");` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); + * + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * + * // Example using `for await` syntax * let i = 1; - * for await (const blob of containerClient.listBlobsFlat()) { + * const blobs = containerClient.listBlobsFlat(); + * for await (const blob of blobs) { * 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 `iter.next()` syntax + * i = 1; + * const iter = containerClient.listBlobsFlat(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: + * // Example using `byPage()` syntax + * i = 1; + * for await (const page of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { + * for (const blob of page.segment.blobItems) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { + * // Example using paging with a marker + * i = 1; + * let iterator = containerClient.listBlobsFlat().byPage({ maxPageSize: 2 }); + * let response = (await iterator.next()).value; + * // Prints 2 blob names + * if (response.segment.blobItems) { * 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}`); + * if (response.segment.blobItems) { + * for (const blob of response.segment.blobItems) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * ``` * @@ -59488,41 +64532,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns An asyncIterableIterator that supports paging. */ listBlobsFlat(options = {}) { - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(updatedOptions); return { /** @@ -59541,7 +64588,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -59558,17 +64608,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listHierarchySegments(delimiter_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* listHierarchySegments_1(delimiter2, marker2, options = {}) { - let listBlobsHierarchySegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter2, marker2, options)); - marker2 = listBlobsHierarchySegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse)); - } while (marker2); - } - }, "listHierarchySegments_1")); + async *listHierarchySegments(delimiter, marker, options = {}) { + let listBlobsHierarchySegmentResponse; + if (!!marker || marker === void 0) { + do { + listBlobsHierarchySegmentResponse = await this.listBlobHierarchySegment(delimiter, marker, options); + marker = listBlobsHierarchySegmentResponse.continuationToken; + yield await listBlobsHierarchySegmentResponse; + } while (marker); + } } /** * Returns an AsyncIterableIterator for {@link BlobPrefix} and {@link BlobItem} objects. @@ -59576,37 +64624,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param delimiter - The character or string used to define the virtual hierarchy * @param options - Options to list blobs operation. */ - listItemsByHierarchy(delimiter_1) { - return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* listItemsByHierarchy_1(delimiter2, options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listHierarchySegments(delimiter2, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsHierarchySegmentResponse = _c; - const segment = listBlobsHierarchySegmentResponse.segment; - if (segment.blobPrefixes) { - for (const prefix2 of segment.blobPrefixes) { - yield yield tslib.__await(Object.assign({ kind: "prefix" }, prefix2)); - } - } - for (const blob of segment.blobItems) { - yield yield tslib.__await(Object.assign({ kind: "blob" }, blob)); - } - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) - yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) - throw e_2.error; + async *listItemsByHierarchy(delimiter, options = {}) { + let marker; + for await (const listBlobsHierarchySegmentResponse of this.listHierarchySegments(delimiter, marker, options)) { + const segment = listBlobsHierarchySegmentResponse.segment; + if (segment.blobPrefixes) { + for (const prefix of segment.blobPrefixes) { + yield { + kind: "prefix", + ...prefix + }; } } - }, "listItemsByHierarchy_1")); + for (const blob of segment.blobItems) { + yield { kind: "blob", ...blob }; + } + } } /** * Returns an async iterable iterator to list all the blobs by hierarchy. @@ -59614,118 +64647,138 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages. * - * Example using `for await` syntax: + * ```ts snippet:ReadmeSampleListBlobsByHierarchy + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * for await (const item of containerClient.listBlobsByHierarchy("/")) { - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); - * } else { - * console.log(`\tBlobItem: name - ${item.name}`); - * } - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * 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"); + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); * + * // Example using `for await` syntax * let i = 1; - * for await (const response of containerClient - * .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" }) - * .byPage({ maxPageSize: 2 })) { - * console.log(`Page ${i++}`); - * const segment = response.segment; + * const blobs = containerClient.listBlobsByHierarchy("/"); + * for await (const blob of blobs) { + * if (blob.kind === "prefix") { + * console.log(`\tBlobPrefix: ${blob.name}`); + * } else { + * console.log(`\tBlobItem: name - ${blob.name}`); + * } + * } * + * // Example using `iter.next()` syntax + * i = 1; + * const iter = containerClient.listBlobsByHierarchy("/"); + * let { value, done } = await iter.next(); + * while (!done) { + * if (value.kind === "prefix") { + * console.log(`\tBlobPrefix: ${value.name}`); + * } else { + * console.log(`\tBlobItem: name - ${value.name}`); + * } + * ({ value, done } = await iter.next()); + * } + * + * // Example using `byPage()` syntax + * i = 1; + * for await (const page of containerClient.listBlobsByHierarchy("/").byPage({ maxPageSize: 20 })) { + * const segment = page.segment; * if (segment.blobPrefixes) { * for (const prefix of segment.blobPrefixes) { * console.log(`\tBlobPrefix: ${prefix.name}`); * } * } + * for (const blob of page.segment.blobItems) { + * console.log(`\tBlobItem: name - ${blob.name}`); + * } + * } * + * // Example using paging with a marker + * i = 1; + * let iterator = containerClient.listBlobsByHierarchy("/").byPage({ maxPageSize: 2 }); + * let response = (await iterator.next()).value; + * // Prints 2 blob names + * if (response.blobPrefixes) { + * for (const prefix of response.blobPrefixes) { + * console.log(`\tBlobPrefix: ${prefix.name}`); + * } + * } + * if (response.segment.blobItems) { * for (const blob of response.segment.blobItems) { * console.log(`\tBlobItem: name - ${blob.name}`); * } * } + * // Gets next marker + * let marker = response.continuationToken; + * // Passing next marker as continuationToken + * iterator = containerClient + * .listBlobsByHierarchy("/") + * .byPage({ continuationToken: marker, maxPageSize: 10 }); + * response = (await iterator.next()).value; + * // Prints 10 blob names + * if (response.blobPrefixes) { + * for (const prefix of response.blobPrefixes) { + * console.log(`\tBlobPrefix: ${prefix.name}`); + * } + * } + * if (response.segment.blobItems) { + * for (const blob of response.segment.blobItems) { + * console.log(`Blob ${i++}: ${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 === "") { + listBlobsByHierarchy(delimiter, options = {}) { + if (delimiter === "") { throw new RangeError("delimiter should contain one or more characters"); } - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.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); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; + const iter = this.listItemsByHierarchy(delimiter, updatedOptions); return { /** * The next method, part of the iteration protocol @@ -59743,7 +64796,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listHierarchySegments(delimiter2, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listHierarchySegments(delimiter, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -59764,23 +64820,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.filterBlobs({ + async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) { + return tracing_js_1.tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => { + const response = (0, utils_common_js_1.assertResponse)(await this.containerContext.filterBlobs({ abortSignal: options.abortSignal, where: tagFilterSqlExpression, - marker: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + const wrappedResponse = { + ...response, + _response: response._response, + // _response is made non-enumerable + blobs: response.blobs.map((blob) => { + let tagValue = ""; + if (blob.tags?.blobTagSet.length === 1) { + tagValue = blob.tags.blobTagSet[0].value; + } + return { ...blob, tags: (0, utils_common_js_1.toTags)(blob.tags), tagValue }; + }) + }; return wrappedResponse; }); } @@ -59800,18 +64860,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }, "findBlobsByTagsSegments_1")); + async *findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) { + let response; + if (!!marker || marker === void 0) { + do { + response = await this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options); + response.blobs = response.blobs || []; + marker = response.continuationToken; + yield response; + } while (marker); + } } /** * Returns an AsyncIterableIterator for blobs. @@ -59822,29 +64880,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_3, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_3_1) { - e_3 = { error: e_3_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) - yield tslib.__await(_b.call(_e)); - } finally { - if (e_3) - throw e_3.error; - } - } - }, "findBlobsByTagsItems_1")); + async *findBlobsByTagsItems(tagFilterSqlExpression, options = {}) { + let marker; + for await (const segment of this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)) { + yield* segment.blobs; + } } /** * Returns an async iterable iterator to find all blobs with specified tag @@ -59854,53 +64894,54 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using `for await` syntax: * - * ```js + * ```ts snippet:ReadmeSampleFindBlobsByTags + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; + * + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); + * + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * + * // Example using `for await` syntax * let i = 1; * for await (const blob of containerClient.findBlobsByTags("tagkey='tagvalue'")) { * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let i = 1; + * // Example using `iter.next()` syntax + * i = 1; * 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(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * 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}`); - * } + * // Example using `byPage()` syntax + * i = 1; + * for await (const page of containerClient + * .findBlobsByTags("tagkey='tagvalue'") + * .byPage({ maxPageSize: 20 })) { + * for (const blob of page.blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); * } * } - * ``` * - * Example using paging with a marker: - * - * ```js - * let i = 1; + * // Example using paging with a marker + * i = 1; * let iterator = containerClient.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 @@ -59908,11 +64949,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * .findBlobsByTags("tagkey='tagvalue'") * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * - * // Prints blob names + * // Prints 10 blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -59924,7 +64964,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -59943,7 +64985,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -59952,14 +64997,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/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 = {}) { - return tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getAccountInfo({ + return tracing_js_1.tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => { + return (0, utils_common_js_1.assertResponse)(await this.containerContext.getAccountInfo({ abortSignal: options.abortSignal, tracingOptions: updatedOptions.tracingOptions })); @@ -59971,7 +65016,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const parsedUrl = new URL(this.url); if (parsedUrl.hostname.split(".")[1] === "blob") { containerName = parsedUrl.pathname.split("/")[1]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { containerName = parsedUrl.pathname.split("/")[2]; } else { containerName = parsedUrl.pathname.split("/")[1]; @@ -59991,18 +65036,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/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((resolve) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + if (!(this.credential instanceof StorageSharedKeyCredential_js_1.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(); - resolve(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, this.credential).toString(); + resolve((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -60011,48 +65059,81 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Generates string to sign for 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 + * @see https://learn.microsoft.com/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. */ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ generateSasStringToSign(options) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) { throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); } - return generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName }, options), this.credential).stringToSign; + return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({ + containerName: this._containerName, + ...options + }, this.credential).stringToSign; + } + /** + * 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 input user delegation key. + * + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas + * + * @param options - Optional parameters. + * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()` + * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. + */ + generateUserDelegationSasUrl(options, userDelegationKey) { + return new Promise((resolve) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + }); + } + /** + * Generates string to sign for a Blob Container Service Shared Access Signature (SAS) URI + * based on the client properties and parameters passed in. The SAS is signed by the input user delegation key. + * + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas + * + * @param options - Optional parameters. + * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()` + * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. + */ + generateUserDelegationSasStringToSign(options, userDelegationKey) { + return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).stringToSign; } /** * Creates a BlobBatchClient object to conduct batch operations. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this container. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline); } }; + exports2.ContainerClient = ContainerClient; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/sas/AccountSASPermissions.js +var require_AccountSASPermissions = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/sas/AccountSASPermissions.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AccountSASPermissions = void 0; var AccountSASPermissions = class _AccountSASPermissions { static { __name(this, "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. * @@ -60156,6 +65237,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } return accountSASPermissions; } + /** + * Permission to read resources and list queues and tables granted. + */ + read = false; + /** + * Permission to write resources granted. + */ + write = false; + /** + * Permission to delete blobs and files granted. + */ + delete = false; + /** + * Permission to delete versions granted. + */ + deleteVersion = false; + /** + * Permission to list blob containers, blobs, shares, directories, and files granted. + */ + list = false; + /** + * Permission to add messages, table entities, and append to blobs granted. + */ + add = false; + /** + * Permission to create blobs and files granted. + */ + create = false; + /** + * Permissions to update messages and table entities granted. + */ + update = false; + /** + * Permission to get and delete messages granted. + */ + process = false; + /** + * Specfies Tag access granted. + */ + tag = false; + /** + * Permission to filter blobs. + */ + filter = false; + /** + * Permission to set immutability policy. + */ + setImmutabilityPolicy = false; + /** + * Specifies that Permanent Delete is permitted. + */ + permanentDelete = false; /** * Produces the SAS permissions string for an Azure Storage account. * Call this method to set AccountSASSignatureValues Permissions field. @@ -60163,7 +65296,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -60210,15 +65343,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return permissions.join(""); } }; + exports2.AccountSASPermissions = AccountSASPermissions; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/sas/AccountSASResourceTypes.js +var require_AccountSASResourceTypes = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/sas/AccountSASResourceTypes.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AccountSASResourceTypes = void 0; var AccountSASResourceTypes = class _AccountSASResourceTypes { static { __name(this, "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. @@ -60244,10 +65382,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } return accountSASResourceTypes; } + /** + * Permission to access service level APIs granted. + */ + service = false; + /** + * Permission to access container level APIs (Blob Containers, Tables, Queues, File Shares) granted. + */ + container = false; + /** + * Permission to access object level APIs (Blobs, Table Entities, Queue Messages, Files) granted. + */ + object = false; /** * Converts the given resource types to a string. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -60264,16 +65414,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return resourceTypes.join(""); } }; + exports2.AccountSASResourceTypes = AccountSASResourceTypes; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/sas/AccountSASServices.js +var require_AccountSASServices = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/sas/AccountSASServices.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AccountSASServices = void 0; var AccountSASServices = class _AccountSASServices { static { __name(this, "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. @@ -60302,6 +65456,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } return accountSASServices; } + /** + * Permission to access blob resources granted. + */ + blob = false; + /** + * Permission to access file resources granted. + */ + file = false; + /** + * Permission to access queue resources granted. + */ + queue = false; + /** + * Permission to access table resources granted. + */ + table = false; /** * Converts the given services to a string. * @@ -60323,45 +65493,63 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return services.join(""); } }; + exports2.AccountSASServices = AccountSASServices; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/sas/AccountSASSignatureValues.js +var require_AccountSASSignatureValues = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/sas/AccountSASSignatureValues.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.generateAccountSASQueryParameters = generateAccountSASQueryParameters; + exports2.generateAccountSASQueryParametersInternal = generateAccountSASQueryParametersInternal; + var AccountSASPermissions_js_1 = require_AccountSASPermissions(); + var AccountSASResourceTypes_js_1 = require_AccountSASResourceTypes(); + var AccountSASServices_js_1 = require_AccountSASServices(); + var SasIPRange_js_1 = require_SasIPRange(); + var SASQueryParameters_js_1 = require_SASQueryParameters(); + var constants_js_1 = require_constants10(); + var utils_common_js_1 = require_utils_common(); function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyCredential) { return generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential).sasQueryParameters; } __name(generateAccountSASQueryParameters, "generateAccountSASQueryParameters"); function generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential) { - const version3 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version3 < "2020-08-04") { + const version = accountSASSignatureValues.version ? accountSASSignatureValues.version : constants_js_1.SERVICE_VERSION; + if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version < "2020-08-04") { throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.deleteVersion && version3 < "2019-10-10") { + if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.deleteVersion && version < "2019-10-10") { throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.permanentDelete && version3 < "2019-10-10") { + if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.permanentDelete && version < "2019-10-10") { throw RangeError("'version' must be >= '2019-10-10' when provided 'y' permission."); } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.tag && version3 < "2019-12-12") { + if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.tag && version < "2019-12-12") { throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.filter && version3 < "2019-12-12") { + if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.filter && version < "2019-12-12") { throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission."); } - if (accountSASSignatureValues.encryptionScope && version3 < "2020-12-06") { + if (accountSASSignatureValues.encryptionScope && version < "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(); + const parsedPermissions = AccountSASPermissions_js_1.AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); + const parsedServices = AccountSASServices_js_1.AccountSASServices.parse(accountSASSignatureValues.services).toString(); + const parsedResourceTypes = AccountSASResourceTypes_js_1.AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); let stringToSign; - if (version3 >= "2020-12-06") { + if (version >= "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.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(accountSASSignatureValues.startsOn, false) : "", + (0, utils_common_js_1.truncatedISO8061Date)(accountSASSignatureValues.expiresOn, false), + accountSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(accountSASSignatureValues.ipRange) : "", accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", - version3, + version, accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", "" // Account SAS requires an additional newline character @@ -60372,26 +65560,54 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + accountSASSignatureValues.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(accountSASSignatureValues.startsOn, false) : "", + (0, utils_common_js_1.truncatedISO8061Date)(accountSASSignatureValues.expiresOn, false), + accountSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(accountSASSignatureValues.ipRange) : "", accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", - version3, + version, "" // Account SAS requires an additional newline character ].join("\n"); } const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: new SASQueryParameters(version3, 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), + sasQueryParameters: new SASQueryParameters_js_1.SASQueryParameters(version, 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), stringToSign }; } __name(generateAccountSASQueryParametersInternal, "generateAccountSASQueryParametersInternal"); - var BlobServiceClient = class _BlobServiceClient extends StorageClient { + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/BlobServiceClient.js +var require_BlobServiceClient = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/BlobServiceClient.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BlobServiceClient = void 0; + var core_auth_1 = require_commonjs7(); + var core_rest_pipeline_1 = require_commonjs6(); + var core_util_1 = require_commonjs4(); + var Pipeline_js_1 = require_Pipeline(); + var ContainerClient_js_1 = require_ContainerClient(); + var utils_common_js_1 = require_utils_common(); + var StorageSharedKeyCredential_js_1 = require_StorageSharedKeyCredential(); + var AnonymousCredential_js_1 = require_AnonymousCredential(); + var utils_common_js_2 = require_utils_common(); + var tracing_js_1 = require_tracing(); + var BlobBatchClient_js_1 = require_BlobBatchClient(); + var StorageClient_js_1 = require_StorageClient(); + var AccountSASPermissions_js_1 = require_AccountSASPermissions(); + var AccountSASSignatureValues_js_1 = require_AccountSASSignatureValues(); + var AccountSASServices_js_1 = require_AccountSASServices(); + var BlobServiceClient = class _BlobServiceClient extends StorageClient_js_1.StorageClient { static { __name(this, "BlobServiceClient"); } + /** + * serviceContext provided by protocol layer. + */ + serviceContext; /** * * Creates an instance of BlobServiceClient from connection string. @@ -60406,35 +65622,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ static fromConnectionString(connectionString, options) { options = options || {}; - const extractedCreds = extractConnectionStringParts(connectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(connectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - const pipeline = newPipeline(sharedKeyCredential, options); + const pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); return new _BlobServiceClient(extractedCreds.url, pipeline); } else { throw new Error("Account connection string is only supported in Node.js environment"); } } else if (extractedCreds.kind === "SASConnString") { - const pipeline = newPipeline(new AnonymousCredential(), options); + const pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.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"); } } - constructor(url2, credentialOrPipeline, options) { + constructor(url, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; - } else if (coreUtil.isNode && credentialOrPipeline instanceof StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipeline)) { - pipeline = newPipeline(credentialOrPipeline, options); + } else if (core_util_1.isNodeLike && credentialOrPipeline instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipeline)) { + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } else { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } - super(url2, pipeline); + super(url, pipeline); this.serviceContext = this.storageClientContext.service; } /** @@ -60445,22 +65661,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```ts snippet:BlobServiceClientGetContainerClient + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; + * + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); + * * const containerClient = blobServiceClient.getContainerClient(""); * ``` */ getContainerClient(containerName) { - return new ContainerClient(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); + return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline); } /** - * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * Create a Blob container. @see https://learn.microsoft.com/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. */ async createContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); const containerCreateResponse = await containerClient.create(updatedOptions); return { @@ -60477,7 +65702,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Container deletion response. */ async deleteContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); return containerClient.delete(updatedOptions); }); @@ -60491,47 +65716,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure Container Restore operation. * @returns Container deletion response. */ - async undeleteContainer(deletedContainerName2, deletedContainerVersion2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName2); + async undeleteContainer(deletedContainerName, deletedContainerVersion, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => { + const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName); const containerContext = containerClient["storageClientContext"].container; - const containerUndeleteResponse = assertResponse(await containerContext.restore({ - deletedContainerName: deletedContainerName2, - deletedContainerVersion: deletedContainerVersion2, + const containerUndeleteResponse = (0, utils_common_js_2.assertResponse)(await containerContext.restore({ + deletedContainerName, + deletedContainerVersion, tracingOptions: updatedOptions.tracingOptions })); return { containerClient, containerUndeleteResponse }; }); } - /** - * 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. - */ - /* 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 = {}) { - return tracingClient.withSpan("BlobServiceClient-renameContainer", options, async (updatedOptions) => { - var _a; - const containerClient = this.getContainerClient(destinationContainerName); - const containerContext = containerClient["storageClientContext"].container; - const containerRenameResponse = assertResponse(await containerContext.rename(sourceContainerName2, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a = options.sourceCondition) === null || _a === void 0 ? void 0 : _a.leaseId }))); - return { containerClient, containerRenameResponse }; - }); - } /** * 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 + * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties * * @param options - Options to the Service Get Properties operation. * @returns Response data for the Service Get Properties operation. */ async getProperties(options = {}) { - return tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getProperties({ + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => { + return (0, utils_common_js_2.assertResponse)(await this.serviceContext.getProperties({ abortSignal: options.abortSignal, tracingOptions: updatedOptions.tracingOptions })); @@ -60540,15 +65747,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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 + * @see https://learn.microsoft.com/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. */ async setProperties(properties, options = {}) { - return tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.setProperties(properties, { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => { + return (0, utils_common_js_2.assertResponse)(await this.serviceContext.setProperties(properties, { abortSignal: options.abortSignal, tracingOptions: updatedOptions.tracingOptions })); @@ -60558,14 +65765,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/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 = {}) { - return tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getStatistics({ + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => { + return (0, utils_common_js_2.assertResponse)(await this.serviceContext.getStatistics({ abortSignal: options.abortSignal, tracingOptions: updatedOptions.tracingOptions })); @@ -60576,14 +65783,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/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 = {}) { - return tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getAccountInfo({ + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => { + return (0, utils_common_js_2.assertResponse)(await this.serviceContext.getAccountInfo({ abortSignal: options.abortSignal, tracingOptions: updatedOptions.tracingOptions })); @@ -60591,7 +65798,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns a list of the containers under the specified account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2 + * @see https://learn.microsoft.com/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 @@ -60603,9 +65810,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Service List Container Segment operation. * @returns Response data for the Service List Container Segment operation. */ - async listContainersSegment(marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.listContainersSegment(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker: marker2 }, options), { include: typeof options.include === "string" ? [options.include] : options.include, tracingOptions: updatedOptions.tracingOptions }))); + async listContainersSegment(marker, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => { + return (0, utils_common_js_2.assertResponse)(await this.serviceContext.listContainersSegment({ + abortSignal: options.abortSignal, + marker, + ...options, + include: typeof options.include === "string" ? [options.include] : options.include, + tracingOptions: updatedOptions.tracingOptions + })); }); } /** @@ -60626,23 +65839,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.filterBlobs({ + async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => { + const response = (0, utils_common_js_2.assertResponse)(await this.serviceContext.filterBlobs({ abortSignal: options.abortSignal, where: tagFilterSqlExpression, - marker: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + const wrappedResponse = { + ...response, + _response: response._response, + // _response is made non-enumerable + blobs: response.blobs.map((blob) => { + let tagValue = ""; + if (blob.tags?.blobTagSet.length === 1) { + tagValue = blob.tags.blobTagSet[0].value; + } + return { ...blob, tags: (0, utils_common_js_1.toTags)(blob.tags), tagValue }; + }) + }; return wrappedResponse; }); } @@ -60662,18 +65879,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }, "findBlobsByTagsSegments_1")); + async *findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) { + let response; + if (!!marker || marker === void 0) { + do { + response = await this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options); + response.blobs = response.blobs || []; + marker = response.continuationToken; + yield response; + } while (marker); + } } /** * Returns an AsyncIterableIterator for blobs. @@ -60684,29 +65899,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) - yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) - throw e_1.error; - } - } - }, "findBlobsByTagsItems_1")); + async *findBlobsByTagsItems(tagFilterSqlExpression, options = {}) { + let marker; + for await (const segment of this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)) { + yield* segment.blobs; + } } /** * Returns an async iterable iterator to find all blobs with specified tag @@ -60714,57 +65911,53 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .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 + * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties * - * Example using `for await` syntax: + * ```ts snippet:BlobServiceClientFindBlobsByTags + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); + * + * // Use for await to iterate the blobs * let i = 1; * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) { - * console.log(`Blob ${i++}: ${container.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let i = 1; + * // Use iter.next() to iterate the blobs + * 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(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = 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}`); - * } + * // Use byPage() to iterate the blobs + * i = 1; + * for await (const page of blobServiceClient + * .findBlobsByTags("tagkey='tagvalue'") + * .byPage({ maxPageSize: 20 })) { + * for (const blob of page.blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); * } * } - * ``` * - * Example using paging with a marker: - * - * ```js - * let i = 1; + * // Use paging with a marker + * 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 @@ -60776,7 +65969,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -60788,7 +65981,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -60807,7 +66002,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -60823,47 +66021,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list containers operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* listSegments_1(marker2, options = {}) { - let listContainersSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listContainersSegmentResponse = yield tslib.__await(this.listContainersSegment(marker2, options)); - listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; - marker2 = listContainersSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listContainersSegmentResponse)); - } while (marker2); - } - }, "listSegments_1")); + async *listSegments(marker, options = {}) { + let listContainersSegmentResponse; + if (!!marker || marker === void 0) { + do { + listContainersSegmentResponse = await this.listContainersSegment(marker, options); + listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; + marker = listContainersSegmentResponse.continuationToken; + yield await listContainersSegmentResponse; + } while (marker); + } } /** * Returns an AsyncIterableIterator for Container Items * * @param options - Options to list containers operation. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* listItems_1(options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) - yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) - throw e_2.error; - } - } - }, "listItems_1")); + async *listItems(options = {}) { + let marker; + for await (const segment of this.listSegments(marker, options)) { + yield* segment.containerItems; + } } /** * Returns an async iterable iterator to list all the containers @@ -60871,45 +66049,41 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the containers in pages. * - * Example using `for await` syntax: + * ```ts snippet:BlobServiceClientListContainers + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); + * + * // Use for await to iterate the containers * let i = 1; * for await (const container of blobServiceClient.listContainers()) { * console.log(`Container ${i++}: ${container.name}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let i = 1; + * // Use iter.next() to iterate the containers + * 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(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Container ${i++}: ${value.name}`); + * ({ value, done } = 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}`); - * } + * // Use byPage() to iterate the containers + * i = 1; + * for await (const page of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { + * for (const container of page.containerItems) { + * console.log(`Container ${i++}: ${container.name}`); * } * } - * ``` * - * Example using paging with a marker: - * - * ```js - * let i = 1; + * // Use paging with a marker + * i = 1; * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; * @@ -60931,7 +66105,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints 10 container names * if (response.containerItems) { * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); + * console.log(`Container ${i++}: ${container.name}`); * } * } * ``` @@ -60943,17 +66117,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (options.prefix === "") { options.prefix = void 0; } - const include2 = []; + const include = []; if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSystem) { - include2.push("system"); + include.push("system"); } - const listSegmentOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const listSegmentOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(listSegmentOptions); return { /** @@ -60972,7 +66149,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -60982,16 +66162,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/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 = {}) { - return tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.getUserDelegationKey({ - startsOn: truncatedISO8061Date(startsOn, false), - expiresOn: truncatedISO8061Date(expiresOn2, false) + async getUserDelegationKey(startsOn, expiresOn, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => { + const response = (0, utils_common_js_2.assertResponse)(await this.serviceContext.getUserDelegationKey({ + startsOn: (0, utils_common_js_2.truncatedISO8061Date)(startsOn, false), + expiresOn: (0, utils_common_js_2.truncatedISO8061Date)(expiresOn, false) }, { abortSignal: options.abortSignal, tracingOptions: updatedOptions.tracingOptions @@ -61005,19 +66185,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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); + const res = { + _response: response._response, + requestId: response.requestId, + clientRequestId: response.clientRequestId, + version: response.version, + date: response.date, + errorCode: response.errorCode, + ...userDelegationKey + }; return res; }); } /** * Creates a BlobBatchClient object to conduct batch operations. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this service. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline); } /** * Only available for BlobServiceClient constructed with a shared key credential. @@ -61025,7 +66213,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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 + * @see https://learn.microsoft.com/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. @@ -61033,21 +66221,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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)) { + generateAccountSasUrl(expiresOn, permissions = AccountSASPermissions_js_1.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { + if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) { throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential"); } - if (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - const sas = generateAccountSASQueryParameters(Object.assign({ + const sas = (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParameters)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).toString(); - return appendToURLQuery(this.url, sas); + services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(), + ...options + }, this.credential).toString(); + return (0, utils_common_js_1.appendToURLQuery)(this.url, sas); } /** * Only available for BlobServiceClient constructed with a shared key credential. @@ -61055,7 +66244,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Generates string to sign for 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 + * @see https://learn.microsoft.com/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. @@ -61063,66 +66252,124 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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. */ - generateSasStringToSign(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + generateSasStringToSign(expiresOn, permissions = AccountSASPermissions_js_1.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { + if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) { throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential"); } - if (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - return generateAccountSASQueryParametersInternal(Object.assign({ + return (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParametersInternal)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).stringToSign; + services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(), + ...options + }, this.credential).stringToSign; } }; - exports2.KnownEncryptionAlgorithmType = void 0; - (function(KnownEncryptionAlgorithmType) { - KnownEncryptionAlgorithmType["AES256"] = "AES256"; - })(exports2.KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = {})); - Object.defineProperty(exports2, "RestError", { - enumerable: true, - get: function() { - return coreRestPipeline.RestError; - } - }); - exports2.AccountSASPermissions = AccountSASPermissions; - exports2.AccountSASResourceTypes = AccountSASResourceTypes; - exports2.AccountSASServices = AccountSASServices; - exports2.AnonymousCredential = AnonymousCredential; - exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; - exports2.AppendBlobClient = AppendBlobClient; - exports2.BaseRequestPolicy = BaseRequestPolicy; - exports2.BlobBatch = BlobBatch; - exports2.BlobBatchClient = BlobBatchClient; - exports2.BlobClient = BlobClient; - exports2.BlobLeaseClient = BlobLeaseClient; - exports2.BlobSASPermissions = BlobSASPermissions; exports2.BlobServiceClient = BlobServiceClient; - exports2.BlockBlobClient = BlockBlobClient; - exports2.ContainerClient = ContainerClient; - exports2.ContainerSASPermissions = ContainerSASPermissions; - exports2.Credential = Credential; - exports2.CredentialPolicy = CredentialPolicy; - exports2.PageBlobClient = PageBlobClient; - exports2.Pipeline = Pipeline; - exports2.SASQueryParameters = SASQueryParameters; - exports2.StorageBrowserPolicy = StorageBrowserPolicy; - exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; - exports2.StorageOAuthScopes = StorageOAuthScopes; - exports2.StorageRetryPolicy = StorageRetryPolicy; - exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; - exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; - exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; - exports2.generateAccountSASQueryParameters = generateAccountSASQueryParameters; - exports2.generateBlobSASQueryParameters = generateBlobSASQueryParameters; - exports2.getBlobServiceAccountAudience = getBlobServiceAccountAudience; - exports2.isPipelineLike = isPipelineLike; - exports2.logger = logger; - exports2.newPipeline = newPipeline; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/BatchResponse.js +var require_BatchResponse = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/BatchResponse.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/generatedModels.js +var require_generatedModels = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/generatedModels.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.KnownEncryptionAlgorithmType = void 0; + var KnownEncryptionAlgorithmType; + (function(KnownEncryptionAlgorithmType2) { + KnownEncryptionAlgorithmType2["AES256"] = "AES256"; + })(KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = KnownEncryptionAlgorithmType = {})); + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/index.js +var require_commonjs15 = __commonJS({ + "node_modules/@azure/storage-blob/dist/commonjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.logger = exports2.RestError = exports2.BaseRequestPolicy = exports2.StorageOAuthScopes = exports2.newPipeline = exports2.isPipelineLike = exports2.Pipeline = exports2.getBlobServiceAccountAudience = exports2.StorageBlobAudience = exports2.PremiumPageBlobTier = exports2.BlockBlobTier = exports2.generateBlobSASQueryParameters = exports2.generateAccountSASQueryParameters = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var core_rest_pipeline_1 = require_commonjs6(); + Object.defineProperty(exports2, "RestError", { enumerable: true, get: function() { + return core_rest_pipeline_1.RestError; + } }); + tslib_1.__exportStar(require_BlobServiceClient(), exports2); + tslib_1.__exportStar(require_Clients(), exports2); + tslib_1.__exportStar(require_ContainerClient(), exports2); + tslib_1.__exportStar(require_BlobLeaseClient(), exports2); + tslib_1.__exportStar(require_AccountSASPermissions(), exports2); + tslib_1.__exportStar(require_AccountSASResourceTypes(), exports2); + tslib_1.__exportStar(require_AccountSASServices(), exports2); + var AccountSASSignatureValues_js_1 = require_AccountSASSignatureValues(); + Object.defineProperty(exports2, "generateAccountSASQueryParameters", { enumerable: true, get: function() { + return AccountSASSignatureValues_js_1.generateAccountSASQueryParameters; + } }); + tslib_1.__exportStar(require_BlobBatch(), exports2); + tslib_1.__exportStar(require_BlobBatchClient(), exports2); + tslib_1.__exportStar(require_BatchResponse(), exports2); + tslib_1.__exportStar(require_BlobSASPermissions(), exports2); + var BlobSASSignatureValues_js_1 = require_BlobSASSignatureValues(); + Object.defineProperty(exports2, "generateBlobSASQueryParameters", { enumerable: true, get: function() { + return BlobSASSignatureValues_js_1.generateBlobSASQueryParameters; + } }); + tslib_1.__exportStar(require_StorageBrowserPolicyFactory2(), exports2); + tslib_1.__exportStar(require_ContainerSASPermissions(), exports2); + tslib_1.__exportStar(require_AnonymousCredential(), exports2); + tslib_1.__exportStar(require_Credential(), exports2); + tslib_1.__exportStar(require_StorageSharedKeyCredential(), exports2); + var models_js_1 = require_models2(); + Object.defineProperty(exports2, "BlockBlobTier", { enumerable: true, get: function() { + return models_js_1.BlockBlobTier; + } }); + Object.defineProperty(exports2, "PremiumPageBlobTier", { enumerable: true, get: function() { + return models_js_1.PremiumPageBlobTier; + } }); + Object.defineProperty(exports2, "StorageBlobAudience", { enumerable: true, get: function() { + return models_js_1.StorageBlobAudience; + } }); + Object.defineProperty(exports2, "getBlobServiceAccountAudience", { enumerable: true, get: function() { + return models_js_1.getBlobServiceAccountAudience; + } }); + var Pipeline_js_1 = require_Pipeline(); + Object.defineProperty(exports2, "Pipeline", { enumerable: true, get: function() { + return Pipeline_js_1.Pipeline; + } }); + Object.defineProperty(exports2, "isPipelineLike", { enumerable: true, get: function() { + return Pipeline_js_1.isPipelineLike; + } }); + Object.defineProperty(exports2, "newPipeline", { enumerable: true, get: function() { + return Pipeline_js_1.newPipeline; + } }); + Object.defineProperty(exports2, "StorageOAuthScopes", { enumerable: true, get: function() { + return Pipeline_js_1.StorageOAuthScopes; + } }); + tslib_1.__exportStar(require_StorageRetryPolicyFactory(), exports2); + var RequestPolicy_js_1 = require_RequestPolicy(); + Object.defineProperty(exports2, "BaseRequestPolicy", { enumerable: true, get: function() { + return RequestPolicy_js_1.BaseRequestPolicy; + } }); + tslib_1.__exportStar(require_AnonymousCredentialPolicy(), exports2); + tslib_1.__exportStar(require_CredentialPolicy(), exports2); + tslib_1.__exportStar(require_StorageRetryPolicyFactory(), exports2); + tslib_1.__exportStar(require_StorageSharedKeyCredentialPolicy(), exports2); + tslib_1.__exportStar(require_SASQueryParameters(), exports2); + tslib_1.__exportStar(require_generatedModels(), exports2); + var log_js_1 = require_log5(); + Object.defineProperty(exports2, "logger", { enumerable: true, get: function() { + return log_js_1.logger; + } }); } }); @@ -61311,7 +66558,7 @@ var require_requestUtils = __commonJS({ }); // node_modules/@azure/abort-controller/dist/index.js -var require_dist5 = __commonJS({ +var require_dist4 = __commonJS({ "node_modules/@azure/abort-controller/dist/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -61535,7 +66782,7 @@ var require_downloadUtils = __commonJS({ exports2.downloadCacheStorageSDK = exports2.downloadCacheHttpClientConcurrent = exports2.downloadCacheHttpClient = exports2.DownloadProgress = void 0; var core = __importStar2(require_core()); var http_client_1 = require_lib(); - var storage_blob_1 = require_dist4(); + var storage_blob_1 = require_commonjs15(); var buffer = __importStar2(require("buffer")); var fs = __importStar2(require("fs")); var stream = __importStar2(require("stream")); @@ -61543,7 +66790,7 @@ var require_downloadUtils = __commonJS({ var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants7(); var requestUtils_1 = require_requestUtils(); - var abort_controller_1 = require_dist5(); + var abort_controller_1 = require_dist4(); function pipeResponseToStream(response, output) { return __awaiter2(this, void 0, void 0, function* () { const pipeline = util.promisify(stream.pipeline); @@ -62018,7 +67265,7 @@ var require_cacheHttpClient = __commonJS({ var core = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); - var crypto4 = __importStar2(require("crypto")); + var crypto2 = __importStar2(require("crypto")); var fs = __importStar2(require("fs")); var url_1 = require("url"); var utils = __importStar2(require_cacheUtils()); @@ -62064,21 +67311,21 @@ var require_cacheHttpClient = __commonJS({ components.push("windows-only"); } components.push(versionSalt); - return crypto4.createHash("sha256").update(components.join("|")).digest("hex"); + return crypto2.createHash("sha256").update(components.join("|")).digest("hex"); } __name(getCacheVersion, "getCacheVersion"); exports2.getCacheVersion = getCacheVersion; function getCacheEntry(keys, paths, options) { return __awaiter2(this, void 0, void 0, function* () { const httpClient = createHttpClient(); - const version2 = 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=${version2}`; + const version = 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=${version}`; const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { if (core.isDebug()) { - yield printCachesListForDiagnostics(keys[0], httpClient, version2); + yield printCachesListForDiagnostics(keys[0], httpClient, version); } return null; } @@ -62098,7 +67345,7 @@ var require_cacheHttpClient = __commonJS({ } __name(getCacheEntry, "getCacheEntry"); exports2.getCacheEntry = getCacheEntry; - function printCachesListForDiagnostics(key, httpClient, version2) { + function printCachesListForDiagnostics(key, httpClient, version) { return __awaiter2(this, void 0, void 0, function* () { const resource = `caches?key=${encodeURIComponent(key)}`; const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter2(this, void 0, void 0, function* () { @@ -62108,7 +67355,7 @@ var require_cacheHttpClient = __commonJS({ const cacheListResult = response.result; const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount; if (totalCount && totalCount > 0) { - core.debug(`No matching cache found for cache key '${key}', version '${version2} 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 + core.debug(`No matching cache found for cache key '${key}', version '${version} 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) || []) { core.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}`); @@ -62140,10 +67387,10 @@ Other caches with similar key:`); function reserveCache(key, paths, options) { return __awaiter2(this, void 0, void 0, function* () { const httpClient = createHttpClient(); - const version2 = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive); + const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive); const reserveCacheRequest = { key, - version: version2, + version, cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize }; const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter2(this, void 0, void 0, function* () { @@ -62501,7 +67748,7 @@ var require_tar = __commonJS({ }); // node_modules/@actions/cache/lib/cache.js -var require_cache2 = __commonJS({ +var require_cache3 = __commonJS({ "node_modules/@actions/cache/lib/cache.js"(exports2) { "use strict"; var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { @@ -62879,77 +68126,77 @@ var require_semver4 = __commonJS({ } } var i; - exports2.parse = parse2; - function parse2(version2, options) { + exports2.parse = parse; + function parse(version, options) { if (!options || typeof options !== "object") { options = { loose: !!options, includePrerelease: false }; } - if (version2 instanceof SemVer) { - return version2; + if (version instanceof SemVer) { + return version; } - if (typeof version2 !== "string") { + if (typeof version !== "string") { return null; } - if (version2.length > MAX_LENGTH) { + if (version.length > MAX_LENGTH) { return null; } var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]; - if (!r.test(version2)) { + if (!r.test(version)) { return null; } try { - return new SemVer(version2, options); + return new SemVer(version, options); } catch (er) { return null; } } - __name(parse2, "parse"); + __name(parse, "parse"); exports2.valid = valid; - function valid(version2, options) { - var v = parse2(version2, options); + function valid(version, options) { + var v = parse(version, options); return v ? v.version : null; } __name(valid, "valid"); exports2.clean = clean; - function clean(version2, options) { - var s = parse2(version2.trim().replace(/^[=v]+/, ""), options); + function clean(version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ""), options); return s ? s.version : null; } __name(clean, "clean"); exports2.SemVer = SemVer; - function SemVer(version2, options) { + function SemVer(version, options) { if (!options || typeof options !== "object") { options = { loose: !!options, includePrerelease: false }; } - if (version2 instanceof SemVer) { - if (version2.loose === options.loose) { - return version2; + if (version instanceof SemVer) { + if (version.loose === options.loose) { + return version; } else { - version2 = version2.version; + version = version.version; } - } else if (typeof version2 !== "string") { - throw new TypeError("Invalid Version: " + version2); + } else if (typeof version !== "string") { + throw new TypeError("Invalid Version: " + version); } - if (version2.length > MAX_LENGTH) { + if (version.length > MAX_LENGTH) { throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); } if (!(this instanceof SemVer)) { - return new SemVer(version2, options); + return new SemVer(version, options); } - debug("SemVer", version2, options); + debug("SemVer", version, options); this.options = options; this.loose = !!options.loose; - var m = version2.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]); + var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]); if (!m) { - throw new TypeError("Invalid Version: " + version2); + throw new TypeError("Invalid Version: " + version); } - this.raw = version2; + this.raw = version; this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; @@ -63133,13 +68380,13 @@ var require_semver4 = __commonJS({ return this; }; exports2.inc = inc; - function inc(version2, release, loose, identifier) { + function inc(version, release, loose, identifier) { if (typeof loose === "string") { identifier = loose; loose = void 0; } try { - return new SemVer(version2, loose).inc(release, identifier).version; + return new SemVer(version, loose).inc(release, identifier).version; } catch (er) { return null; } @@ -63150,16 +68397,16 @@ var require_semver4 = __commonJS({ if (eq(version1, version2)) { return null; } else { - var v12 = parse2(version1); - var v2 = parse2(version2); + var v1 = parse(version1); + var v2 = parse(version2); var prefix = ""; - if (v12.prerelease.length || v2.prerelease.length) { + if (v1.prerelease.length || v2.prerelease.length) { prefix = "pre"; var defaultResult = "prerelease"; } - for (var key in v12) { + for (var key in v1) { if (key === "major" || key === "minor" || key === "patch") { - if (v12[key] !== v2[key]) { + if (v1[key] !== v2[key]) { return prefix + key; } } @@ -63351,19 +68598,19 @@ var require_semver4 = __commonJS({ Comparator.prototype.toString = function() { return this.value; }; - Comparator.prototype.test = function(version2) { - debug("Comparator.test", version2, this.options.loose); - if (this.semver === ANY || version2 === ANY) { + Comparator.prototype.test = function(version) { + debug("Comparator.test", version, this.options.loose); + if (this.semver === ANY || version === ANY) { return true; } - if (typeof version2 === "string") { + if (typeof version === "string") { try { - version2 = new SemVer(version2, this.options); + version = new SemVer(version, this.options); } catch (er) { return false; } } - return cmp(version2, this.operator, this.semver, this.options); + return cmp(version, this.operator, this.semver, this.options); }; Comparator.prototype.intersects = function(comp, options) { if (!(comp instanceof Comparator)) { @@ -63686,31 +68933,31 @@ var require_semver4 = __commonJS({ return (from + " " + to).trim(); } __name(hyphenReplace, "hyphenReplace"); - Range.prototype.test = function(version2) { - if (!version2) { + Range.prototype.test = function(version) { + if (!version) { return false; } - if (typeof version2 === "string") { + if (typeof version === "string") { try { - version2 = new SemVer(version2, this.options); + version = new SemVer(version, this.options); } catch (er) { return false; } } for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version2, this.options)) { + if (testSet(this.set[i2], version, this.options)) { return true; } } return false; }; - function testSet(set, version2, options) { + function testSet(set, version, options) { for (var i2 = 0; i2 < set.length; i2++) { - if (!set[i2].test(version2)) { + if (!set[i2].test(version)) { return false; } } - if (version2.prerelease.length && !options.includePrerelease) { + if (version.prerelease.length && !options.includePrerelease) { for (i2 = 0; i2 < set.length; i2++) { debug(set[i2].semver); if (set[i2].semver === ANY) { @@ -63718,7 +68965,7 @@ var require_semver4 = __commonJS({ } if (set[i2].semver.prerelease.length > 0) { var allowed = set[i2].semver; - if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) { + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true; } } @@ -63729,13 +68976,13 @@ var require_semver4 = __commonJS({ } __name(testSet, "testSet"); exports2.satisfies = satisfies; - function satisfies(version2, range, options) { + function satisfies(version, range, options) { try { range = new Range(range, options); } catch (er) { return false; } - return range.test(version2); + return range.test(version); } __name(satisfies, "satisfies"); exports2.maxSatisfying = maxSatisfying; @@ -63832,18 +69079,18 @@ var require_semver4 = __commonJS({ } __name(validRange, "validRange"); exports2.ltr = ltr; - function ltr(version2, range, options) { - return outside(version2, range, "<", options); + function ltr(version, range, options) { + return outside(version, range, "<", options); } __name(ltr, "ltr"); exports2.gtr = gtr; - function gtr(version2, range, options) { - return outside(version2, range, ">", options); + function gtr(version, range, options) { + return outside(version, range, ">", options); } __name(gtr, "gtr"); exports2.outside = outside; - function outside(version2, range, hilo, options) { - version2 = new SemVer(version2, options); + function outside(version, range, hilo, options) { + version = new SemVer(version, options); range = new Range(range, options); var gtfn, ltefn, ltfn, comp, ecomp; switch (hilo) { @@ -63864,7 +69111,7 @@ var require_semver4 = __commonJS({ default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } - if (satisfies(version2, range, options)) { + if (satisfies(version, range, options)) { return false; } for (var i2 = 0; i2 < range.set.length; ++i2) { @@ -63886,9 +69133,9 @@ var require_semver4 = __commonJS({ if (high.operator === comp || high.operator === ecomp) { return false; } - if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) { + if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false; - } else if (low.operator === ecomp && ltfn(version2, low.semver)) { + } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false; } } @@ -63896,8 +69143,8 @@ var require_semver4 = __commonJS({ } __name(outside, "outside"); exports2.prerelease = prerelease; - function prerelease(version2, options) { - var parsed = parse2(version2, options); + function prerelease(version, options) { + var parsed = parse(version, options); return parsed && parsed.prerelease.length ? parsed.prerelease : null; } __name(prerelease, "prerelease"); @@ -63909,23 +69156,23 @@ var require_semver4 = __commonJS({ } __name(intersects, "intersects"); exports2.coerce = coerce; - function coerce(version2, options) { - if (version2 instanceof SemVer) { - return version2; + function coerce(version, options) { + if (version instanceof SemVer) { + return version; } - if (typeof version2 === "number") { - version2 = String(version2); + if (typeof version === "number") { + version = String(version); } - if (typeof version2 !== "string") { + if (typeof version !== "string") { return null; } options = options || {}; var match = null; if (!options.rtl) { - match = version2.match(safeRe[t.COERCE]); + match = version.match(safeRe[t.COERCE]); } else { var next; - while ((next = safeRe[t.COERCERTL].exec(version2)) && (!match || match.index + match[0].length !== version2.length)) { + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next; } @@ -63936,7 +69183,7 @@ var require_semver4 = __commonJS({ if (match === null) { return null; } - return parse2(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); + return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); } __name(coerce, "coerce"); } @@ -63949,9 +69196,13 @@ var require_manifest = __commonJS({ var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { if (k2 === void 0) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); } : function(o, m, k, k2) { if (k2 === void 0) k2 = k; @@ -63968,7 +69219,7 @@ var require_manifest = __commonJS({ var result = {}; if (mod != null) { for (var k in mod) - if (k !== "default" && Object.hasOwnProperty.call(mod, k)) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } __setModuleDefault2(result, mod); @@ -64019,11 +69270,11 @@ var require_manifest = __commonJS({ let match; let file; for (const candidate of candidates) { - const version2 = candidate.version; - core_1.debug(`check ${version2} satisfies ${versionSpec}`); - if (semver2.satisfies(version2, versionSpec) && (!stable || candidate.stable === stable)) { + const version = candidate.version; + (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); + if (semver2.satisfies(version, versionSpec) && (!stable || candidate.stable === stable)) { file = candidate.files.find((item) => { - core_1.debug(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`); + (0, core_1.debug)(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`); let chk = item.arch === archFilter && item.platform === platFilter; if (chk && item.platform_version) { const osVersion = module2.exports._getOsVersion(); @@ -64036,7 +69287,7 @@ var require_manifest = __commonJS({ return chk; }); if (file) { - core_1.debug(`matched ${candidate.version}`); + (0, core_1.debug)(`matched ${candidate.version}`); match = candidate; break; } @@ -64053,9 +69304,9 @@ var require_manifest = __commonJS({ exports2._findMatch = _findMatch; function _getOsVersion() { const plat = os2.platform(); - let version2 = ""; + let version = ""; if (plat === "darwin") { - version2 = cp.execSync("sw_vers -productVersion").toString(); + version = cp.execSync("sw_vers -productVersion").toString(); } else if (plat === "linux") { const lsbContents = module2.exports._readLinuxVersionFile(); if (lsbContents) { @@ -64063,13 +69314,13 @@ var require_manifest = __commonJS({ for (const line of lines) { const parts = line.split("="); if (parts.length === 2 && (parts[0].trim() === "VERSION_ID" || parts[0].trim() === "DISTRIB_RELEASE")) { - version2 = parts[1].trim().replace(/^"/, "").replace(/"$/, ""); + version = parts[1].trim().replace(/^"/, "").replace(/"$/, ""); break; } } } } - return version2; + return version; } __name(_getOsVersion, "_getOsVersion"); exports2._getOsVersion = _getOsVersion; @@ -64096,9 +69347,13 @@ var require_retry_helper = __commonJS({ var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { if (k2 === void 0) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); } : function(o, m, k, k2) { if (k2 === void 0) k2 = k; @@ -64115,7 +69370,7 @@ var require_retry_helper = __commonJS({ var result = {}; if (mod != null) { for (var k in mod) - if (k !== "default" && Object.hasOwnProperty.call(mod, k)) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } __setModuleDefault2(result, mod); @@ -64210,9 +69465,13 @@ var require_tool_cache = __commonJS({ var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { if (k2 === void 0) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); } : function(o, m, k, k2) { if (k2 === void 0) k2 = k; @@ -64229,7 +69488,7 @@ var require_tool_cache = __commonJS({ var result = {}; if (mod != null) { for (var k in mod) - if (k !== "default" && Object.hasOwnProperty.call(mod, k)) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } __setModuleDefault2(result, mod); @@ -64266,13 +69525,11 @@ var require_tool_cache = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; var core = __importStar2(require_core()); var io = __importStar2(require_io()); + var crypto2 = __importStar2(require("crypto")); var fs = __importStar2(require("fs")); var mm = __importStar2(require_manifest()); var os2 = __importStar2(require("os")); @@ -64282,7 +69539,6 @@ var require_tool_cache = __commonJS({ var stream = __importStar2(require("stream")); var util = __importStar2(require("util")); var assert_1 = require("assert"); - var v4_1 = __importDefault2(require_v4()); var exec_1 = require_exec(); var retry_helper_1 = require_retry_helper(); var HTTPError = class extends Error { @@ -64301,7 +69557,7 @@ var require_tool_cache = __commonJS({ var userAgent = "actions/tool-cache"; function downloadTool(url, dest, auth, headers) { return __awaiter2(this, void 0, void 0, function* () { - dest = dest || path2.join(_getTempDirectory(), v4_1.default()); + dest = dest || path2.join(_getTempDirectory(), crypto2.randomUUID()); yield io.mkdirP(path2.dirname(dest)); core.debug(`Downloading ${url}`); core.debug(`Destination ${dest}`); @@ -64368,8 +69624,8 @@ var require_tool_cache = __commonJS({ __name(downloadToolAttempt, "downloadToolAttempt"); function extract7z(file, dest, _7zPath) { return __awaiter2(this, void 0, void 0, function* () { - assert_1.ok(IS_WINDOWS, "extract7z() not supported on current OS"); - assert_1.ok(file, 'parameter "file" is required'); + (0, assert_1.ok)(IS_WINDOWS, "extract7z() not supported on current OS"); + (0, assert_1.ok)(file, 'parameter "file" is required'); dest = yield _createExtractFolder(dest); const originalCwd = process.cwd(); process.chdir(dest); @@ -64386,7 +69642,7 @@ var require_tool_cache = __commonJS({ const options = { silent: true }; - yield exec_1.exec(`"${_7zPath}"`, args, options); + yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); } finally { process.chdir(originalCwd); } @@ -64410,7 +69666,7 @@ var require_tool_cache = __commonJS({ }; try { const powershellPath = yield io.which("powershell", true); - yield exec_1.exec(`"${powershellPath}"`, args, options); + yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); } finally { process.chdir(originalCwd); } @@ -64428,7 +69684,7 @@ var require_tool_cache = __commonJS({ dest = yield _createExtractFolder(dest); core.debug("Checking tar --version"); let versionOutput = ""; - yield exec_1.exec("tar --version", [], { + yield (0, exec_1.exec)("tar --version", [], { ignoreReturnCode: true, silent: true, listeners: { @@ -64459,7 +69715,7 @@ var require_tool_cache = __commonJS({ args.push("--overwrite"); } args.push("-C", destArg, "-f", fileArg); - yield exec_1.exec(`tar`, args); + yield (0, exec_1.exec)(`tar`, args); return dest; }); } @@ -64467,8 +69723,8 @@ var require_tool_cache = __commonJS({ exports2.extractTar = extractTar; function extractXar(file, dest, flags = []) { return __awaiter2(this, void 0, void 0, function* () { - assert_1.ok(IS_MAC, "extractXar() not supported on current OS"); - assert_1.ok(file, 'parameter "file" is required'); + (0, assert_1.ok)(IS_MAC, "extractXar() not supported on current OS"); + (0, assert_1.ok)(file, 'parameter "file" is required'); dest = yield _createExtractFolder(dest); let args; if (flags instanceof Array) { @@ -64481,7 +69737,7 @@ var require_tool_cache = __commonJS({ args.push("-v"); } const xarPath = yield io.which("xar", true); - yield exec_1.exec(`"${xarPath}"`, _unique(args)); + yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); return dest; }); } @@ -64525,7 +69781,7 @@ var require_tool_cache = __commonJS({ pwshCommand ]; core.debug(`Using pwsh at path: ${pwshPath}`); - yield exec_1.exec(`"${pwshPath}"`, args); + yield (0, exec_1.exec)(`"${pwshPath}"`, args); } else { const powershellCommand = [ `$ErrorActionPreference = 'Stop' ;`, @@ -64545,7 +69801,7 @@ var require_tool_cache = __commonJS({ ]; const powershellPath = yield io.which("powershell", true); core.debug(`Using powershell at path: ${powershellPath}`); - yield exec_1.exec(`"${powershellPath}"`, args); + yield (0, exec_1.exec)(`"${powershellPath}"`, args); } }); } @@ -64558,44 +69814,44 @@ var require_tool_cache = __commonJS({ args.unshift("-q"); } args.unshift("-o"); - yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest }); + yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); }); } __name(extractZipNix, "extractZipNix"); - function cacheDir(sourceDir, tool, version2, arch) { + function cacheDir(sourceDir, tool, version, arch) { return __awaiter2(this, void 0, void 0, function* () { - version2 = semver2.clean(version2) || version2; + version = semver2.clean(version) || version; arch = arch || os2.arch(); - core.debug(`Caching tool ${tool} ${version2} ${arch}`); + core.debug(`Caching tool ${tool} ${version} ${arch}`); core.debug(`source dir: ${sourceDir}`); if (!fs.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } - const destPath = yield _createToolPath(tool, version2, arch); + const destPath = yield _createToolPath(tool, version, arch); for (const itemName of fs.readdirSync(sourceDir)) { const s = path2.join(sourceDir, itemName); yield io.cp(s, destPath, { recursive: true }); } - _completeToolPath(tool, version2, arch); + _completeToolPath(tool, version, arch); return destPath; }); } __name(cacheDir, "cacheDir"); exports2.cacheDir = cacheDir; - function cacheFile(sourceFile, targetFile, tool, version2, arch) { + function cacheFile(sourceFile, targetFile, tool, version, arch) { return __awaiter2(this, void 0, void 0, function* () { - version2 = semver2.clean(version2) || version2; + version = semver2.clean(version) || version; arch = arch || os2.arch(); - core.debug(`Caching tool ${tool} ${version2} ${arch}`); + core.debug(`Caching tool ${tool} ${version} ${arch}`); core.debug(`source file: ${sourceFile}`); if (!fs.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } - const destFolder = yield _createToolPath(tool, version2, arch); + const destFolder = yield _createToolPath(tool, version, arch); const destPath = path2.join(destFolder, targetFile); core.debug(`destination file ${destPath}`); yield io.cp(sourceFile, destPath); - _completeToolPath(tool, version2, arch); + _completeToolPath(tool, version, arch); return destFolder; }); } @@ -64696,16 +69952,16 @@ var require_tool_cache = __commonJS({ function _createExtractFolder(dest) { return __awaiter2(this, void 0, void 0, function* () { if (!dest) { - dest = path2.join(_getTempDirectory(), v4_1.default()); + dest = path2.join(_getTempDirectory(), crypto2.randomUUID()); } yield io.mkdirP(dest); return dest; }); } __name(_createExtractFolder, "_createExtractFolder"); - function _createToolPath(tool, version2, arch) { + function _createToolPath(tool, version, arch) { return __awaiter2(this, void 0, void 0, function* () { - const folderPath = path2.join(_getCacheDirectory(), tool, semver2.clean(version2) || version2, arch || ""); + const folderPath = path2.join(_getCacheDirectory(), tool, semver2.clean(version) || version, arch || ""); core.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io.rmRF(folderPath); @@ -64715,8 +69971,8 @@ var require_tool_cache = __commonJS({ }); } __name(_createToolPath, "_createToolPath"); - function _completeToolPath(tool, version2, arch) { - const folderPath = path2.join(_getCacheDirectory(), tool, semver2.clean(version2) || version2, arch || ""); + function _completeToolPath(tool, version, arch) { + const folderPath = path2.join(_getCacheDirectory(), tool, semver2.clean(version) || version, arch || ""); const markerPath = `${folderPath}.complete`; fs.writeFileSync(markerPath, ""); core.debug("finished caching tool"); @@ -64732,7 +69988,7 @@ var require_tool_cache = __commonJS({ __name(isExplicitVersion, "isExplicitVersion"); exports2.isExplicitVersion = isExplicitVersion; function evaluateVersions(versions, versionSpec) { - let version2 = ""; + let version = ""; core.debug(`evaluating ${versions.length} versions`); versions = versions.sort((a, b) => { if (semver2.gt(a, b)) { @@ -64744,28 +70000,28 @@ var require_tool_cache = __commonJS({ const potential = versions[i]; const satisfied = semver2.satisfies(potential, versionSpec); if (satisfied) { - version2 = potential; + version = potential; break; } } - if (version2) { - core.debug(`matched: ${version2}`); + if (version) { + core.debug(`matched: ${version}`); } else { core.debug("match not found"); } - return version2; + return version; } __name(evaluateVersions, "evaluateVersions"); exports2.evaluateVersions = evaluateVersions; function _getCacheDirectory() { const cacheDirectory = process.env["RUNNER_TOOL_CACHE"] || ""; - assert_1.ok(cacheDirectory, "Expected RUNNER_TOOL_CACHE to be defined"); + (0, assert_1.ok)(cacheDirectory, "Expected RUNNER_TOOL_CACHE to be defined"); return cacheDirectory; } __name(_getCacheDirectory, "_getCacheDirectory"); function _getTempDirectory() { const tempDirectory = process.env["RUNNER_TEMP"] || ""; - assert_1.ok(tempDirectory, "Expected RUNNER_TEMP to be defined"); + (0, assert_1.ok)(tempDirectory, "Expected RUNNER_TEMP to be defined"); return tempDirectory; } __name(_getTempDirectory, "_getTempDirectory"); @@ -65126,7 +70382,7 @@ var require_versions = __commonJS({ }[platform]; } __name(extForPlatform2, "extForPlatform"); - function resolveCommit2(arch, platform, version2) { + function resolveCommit2(arch, platform, version) { const ext = extForPlatform2(platform); const resolvedOs = { linux: "linux", @@ -65140,9 +70396,9 @@ var require_versions = __commonJS({ riscv64: "riscv64", x64: "x86_64" }[arch]; - const downloadUrl = `https://ziglang.org/builds/zig-${resolvedOs}-${resolvedArch}-${version2}.${ext}`; - const variantName = `zig-${resolvedOs}-${resolvedArch}-${version2}`; - return { downloadUrl, variantName, version: version2 }; + const downloadUrl = `https://ziglang.org/builds/zig-${resolvedOs}-${resolvedArch}-${version}.${ext}`; + const variantName = `zig-${resolvedOs}-${resolvedArch}-${version}`; + return { downloadUrl, variantName, version }; } __name(resolveCommit2, "resolveCommit"); function getJSON(opts) { @@ -65157,7 +70413,7 @@ var require_versions = __commonJS({ }); } __name(getJSON, "getJSON"); - async function resolveVersion2(arch, platform, version2) { + async function resolveVersion2(arch, platform, version) { const ext = extForPlatform2(platform); const resolvedOs = { linux: "linux", @@ -65174,14 +70430,14 @@ var require_versions = __commonJS({ const host = `${resolvedArch}-${resolvedOs}`; const index = await getJSON({ url: "https://ziglang.org/download/index.json" }); const availableVersions = Object.keys(index); - const useVersion = semver2.valid(version2) ? semver2.maxSatisfying(availableVersions.filter((v) => semver2.valid(v)), version2) : null; - const meta = index[useVersion || version2]; + const useVersion = semver2.valid(version) ? semver2.maxSatisfying(availableVersions.filter((v) => semver2.valid(v)), version) : null; + const meta = index[useVersion || version]; if (!meta || !meta[host]) { - throw new Error(`Could not find version ${useVersion || version2} for platform ${host}`); + throw new Error(`Could not find version ${useVersion || version} for platform ${host}`); } const downloadUrl = meta[host].tarball; const variantName = path2.basename(meta[host].tarball).replace(`.${ext}`, ""); - return { downloadUrl, variantName, version: useVersion || version2 }; + return { downloadUrl, variantName, version: useVersion || version }; } __name(resolveVersion2, "resolveVersion"); module2.exports = { @@ -65197,7 +70453,7 @@ var os = require("os"); var path = require("path"); var semver = require_semver2(); var actions = require_core(); -var cache = require_cache2(); +var cache = require_cache3(); var toolCache = require_tool_cache(); var { extForPlatform, @@ -65205,9 +70461,9 @@ var { resolveVersion } = require_versions(); var TOOL_NAME = "zig"; -async function downloadZig(arch, platform, version2, useCache = true) { +async function downloadZig(arch, platform, version, useCache = true) { const ext = extForPlatform(platform); - const { downloadUrl, variantName, version: useVersion } = version2.includes("+") ? resolveCommit(arch, platform, version2) : await resolveVersion(arch, platform, version2); + const { downloadUrl, variantName, version: useVersion } = version.includes("+") ? resolveCommit(arch, platform, version) : await resolveVersion(arch, platform, version); const cachedPath = toolCache.find(TOOL_NAME, useVersion); if (cachedPath) { actions.info(`using cached zig install: ${cachedPath}`); @@ -65236,9 +70492,9 @@ async function downloadZig(arch, platform, version2, useCache = true) { } __name(downloadZig, "downloadZig"); async function main() { - const version2 = actions.getInput("version") || "master"; + const version = actions.getInput("version") || "master"; const useCache = actions.getInput("cache") || "true"; - if (semver.valid(version2) && semver.lt(version2, "0.3.0")) { + if (semver.valid(version) && semver.lt(version, "0.3.0")) { actions.setFailed("This action does not work with Zig 0.1.0 and Zig 0.2.0"); return; } @@ -65246,7 +70502,7 @@ async function main() { actions.setFailed('`with.cache` must be "true" or "false"'); return; } - const zigPath = await downloadZig(os.arch(), os.platform(), version2, useCache === "true"); + const zigPath = await downloadZig(os.arch(), os.platform(), version, useCache === "true"); actions.addPath(zigPath); actions.info(`zig installed at ${zigPath}`); }